Use when a user asks for:
NOT for:
bank-reconciliationpl-deep-analysiscash-flow-forecastar-collectionsbudget-vs-actualbash
# Standard monthly ratio report
python3 scripts/pipelines/financial-ratios.py --slug sb-paulson --month 2026-03
# Custom output directory
python3 scripts/pipelines/financial-ratios.py --slug <client-slug> --month 2026-03 --out ~/Desktop/reports
# QBO sandbox
python3 scripts/pipelines/financial-ratios.py --slug sb-paulson --month 2026-03 --sandbox
Unknown slugs use default thresholds and disable inventory/valuation ratios unless SOP file found.
Excel workbook saved to ~/Desktop (or --out path):
FinancialRatios_{slug}_{YYYY_MM}.xlsx
TabContentsRatio SummaryAll ratios with traffic lights, benchmarks, DuPont & Altman summaryProfitabilityGross/Operating/Net margins, ROA, ROE, EBITDA margin + 6-mo trendLiquidityCurrent/Quick/Cash ratios, Working capital + 6-mo trendLeverageD/E, D/A, Interest coverage, Equity multiplier + 6-mo trendEfficiencyAsset/Inventory/Receivable/Payable turnover, DSO, DPO, CCC + 6-mo trendGrowthRevenue (MoM/QoQ/YoY), Expense, Net income growth + 6-mo trendDuPont Analysis3-factor + 5-factor ROE decomposition, 6-month component trendTrendsAll ratios × 6 months with direction arrows + trend reversal flagsCDC LogRatio changes vs. prior run with trend reversal detection
RatioFormulaGross Margin %Gross Profit / Revenue × 100Operating Margin %EBIT / Revenue × 100Net Margin %Net Income / Revenue × 100EBITDA Margin %EBITDA / Revenue × 100ROANet Income / Total Assets × 100ROENet Income / Total Equity × 100
RatioFormulaCurrent RatioCurrent Assets / Current LiabilitiesQuick Ratio(Current Assets − Inventory) / Current LiabilitiesCash RatioCash / Current LiabilitiesWorking CapitalCurrent Assets − Current LiabilitiesWorking Capital RatioWorking Capital / Total Assets × 100
RatioFormulaDebt-to-EquityTotal Liabilities / Total EquityDebt-to-AssetsTotal Liabilities / Total AssetsInterest CoverageEBIT / Interest ExpenseEquity MultiplierTotal Assets / Total Equity
RatioFormulaAsset TurnoverRevenue / Total AssetsInventory TurnoverCOGS / Inventory (annualized)Receivable TurnoverRevenue / Accounts ReceivableDSO (Days Sales Outstanding)AR / (Revenue / Days)Payable TurnoverCOGS / Accounts PayableDPO (Days Payable Outstanding)AP / (COGS / Days)Cash Conversion CycleDSO + DIO − DPO
RatioFormulaRevenue Growth MoM(Current − Prior) /Revenue Growth QoQ(Current − 3mo ago) /Revenue Growth YoY(Current − 12mo ago) /Expense Growth(Current Opex − Prior Opex) /Net Income Growth(Current NI − Prior NI) /
RatioFormulaRevenue MultipleEnterprise Value / (Revenue × 12)EBITDA MultipleEnterprise Value / (EBITDA × 12)
text
ROE = Net Margin × Asset Turnover × Equity Multiplier
text
ROE = Tax Burden × Interest Burden × EBIT Margin × Asset Turnover × Equity Multiplier
Both models computed; trend shown for each component across 6 months.
Bankruptcy risk indicator. Model selected automatically by entity_type in SOP config:
ModelUsed ForZonesZ' (Revised)Private/Services (default)Safe >2.9 | Grey 1.23-2.9 | Distress <1.23Z (Original)ManufacturingSafe >2.99 | Grey 1.81-2.99 | Distress <1.81
Formula (Z' model): Z' = 0.717×(WC/TA) + 0.847×(RE/TA) + 3.107×(EBIT/TA) + 0.420×(BVE/TL) + 0.998×(Revenue/TA)
Each ratio scores GREEN / YELLOW / RED based on thresholds configured per client SOP.
Thresholds are configured in CLIENT_CONFIGS within the script. Override by editing the dict or adding a client SOP file.
The pipeline detects when a ratio reverses direction over the 6-month window:
⚡ Trend Reversal — Now Improving or ⚠ Trend Reversal — Now DecliningPlace a sop.md file at clients/{slug}/sop.md. The pipeline reads it to detect:
SOP SignalEffect"POS collection" / "no accounts receivable"Disables AR ratios (DSO, receivable turnover)"no inventory" / "service-based"Disables inventory ratios"manufacturing" / "distribution"Switches to original Altman Z modelenterprise value: $XEnables valuation ratios (revenue/EBITDA multiples)benchmark: {key} {value}Overrides specific benchmark values
Add clients to CLIENT_CONFIGS in the script with:
ratios_enabled list (which ratios to compute/display)thresholds dict per ratio: {"green": (min, max), "yellow": (min, max)}benchmarks dict per ratio: Decimal valuesentity_type: "services" or "manufacturing" (for Altman Z model)ReportPurposeP&L (current month)Revenue, COGS, OpEx, Net Income, Interest, D&ABalance Sheet (current month-end)Assets, Liabilities, Equity, Cash, AR, Inventory, APCash Flow (current month)Operating/Investing/Financing cash flowsP&L (prior month)MoM growth ratiosP&L (3 months ago)QoQ growth ratioP&L (12 months ago)YoY growth ratioAll of the above × 6 monthsHistorical trend analysis
Total QBO calls: ~17 per run (6-month history + current + prior + QoQ + YoY)
Cache stored at: .cache/financial-ratios/{slug}.json
Tracks:
ZERO, never crashesZERO (safe fallback), does not inflate ratiosFileDescriptionscripts/pipelines/financial-ratios.pyMain pipeline scriptskills/financial-ratios/SKILL.mdThis file.cache/financial-ratios/{slug}.jsonCDC cache per client