Runs a period-over-period variance analysis on the Statement of Cash Flows (SCF) pulled directly from QuickBooks Online. Outputs a 4-tab Excel workbook: Summary | Detail | Flags | CDC Log.
Mirrors the pl-quick-compare pattern exactly but for the Cash Flow Statement — Operating / Investing / Financing sections, balance validation, and SCF-specific analysis notes on flagged items.
Use when:
NOT for:
cash-flow-forecast.pypl-quick-compare.pyar-collectionstext
scripts/pipelines/scf-quick-compare.py
pip install openpyxl (already installed in workspace)bash
# Current month vs. prior month (auto-detects prior)
python3 scripts/pipelines/scf-quick-compare.py \
--slug my-client \
--current-start 2026-03-01 --current-end 2026-03-31
# Explicit prior period
python3 scripts/pipelines/scf-quick-compare.py \
--slug my-client \
--current-start 2026-02-01 --current-end 2026-02-28 \
--prior-start 2026-01-01 --prior-end 2026-01-31
# YTD vs prior YTD (Jan 1 → end of last completed month)
python3 scripts/pipelines/scf-quick-compare.py \
--slug my-client --ytd --year 2026
# Custom output directory
python3 scripts/pipelines/scf-quick-compare.py \
--slug my-client \
--current-start 2026-03-01 --current-end 2026-03-31 \
--out ~/Desktop/reports
# Sandbox mode (QBO sandbox environment)
python3 scripts/pipelines/scf-quick-compare.py \
--slug my-client \
--current-start 2026-03-01 --current-end 2026-03-31 \
--sandbox
FlagRequiredDescription--slug✅Company slug (must be connected in qbo-client)--current-start✅*Current period start date (YYYY-MM-DD)--current-end✅*Current period end date (YYYY-MM-DD)--prior-start❌Prior period start (auto-shifts 1 month if omitted)--prior-end❌Prior period end (auto-shifts 1 month if omitted)--ytd✅*YTD mode (alternative to explicit dates)--year❌Year for --ytd (default: current year)--out❌Output directory (default: ~/Desktop)--sandbox❌Use QBO sandbox environment
*Either --current-start/ --current-end OR --ytd is required.
Excel file: SCF_QuickCompare_{slug}_{period}.xlsx saved to Desktop (or --out directory).
Operating + Investing + Financing = Net Change and Beginning + Net Change = Ending Cash.cache/scf-quick-compare/{slug}.jsonThe parser classifies each QBO CF row into sections by keyword matching on row names:
For SCF: positive delta = Favorable (more cash generated/retained vs prior). This is directionally correct for all sections — the goal is always more net cash.
text
Net Change = Operating + Investing + Financing (≤$1 tolerance)
Ending Cash = Beginning Cash + Net Change (≤$1 tolerance)
Both checks run on both periods and displayed in the Summary tab.
--ytd: Current = Jan 1 → end of last completed month. Prior = same date range in prior year.
Example: run on March 17, 2026 → Current = Jan 1 – Feb 28, 2026 | Prior = Jan 1 – Feb 28, 2025.
The Flags tab includes an Analysis Note column with SCF-specific interpretation for each material variance:
ItemNote logicNet IncomeProfitability driver — directs to P&L for root causeDepreciation / AmortizationNon-cash add-back explanationAccounts ReceivableAR buildup (cash tied up) vs. collection accelerationAccounts PayableAP extension (cash benefit) vs. paydown (cash use)InventoryBuildup (cash use) vs. drawdown (cash release)Equipment / CapExStrategic capex alert — verify against growth planLoan proceeds / repaymentsDebt structure activity — review debt scheduleDistributionsOwner draw alert — verify cash availabilitySAFE / EquityCap table activity — verify with investor recordsNet ChangeOverall cash generation summary
text
.cache/scf-quick-compare/{slug}.json
Stores the flat map of all SCF line names → amounts for the most recent run. On re-run, diffs against the prior cache and shows exactly what changed. Useful for catching mid-month QBO adjustments or reconciliation entries.
All calculations use Python Decimal with ROUND_HALF_UP — no floating-point rounding errors in financial outputs.