Use when a user needs to process raw accounting source documents into standardized transaction records for QBO import. Triggers on:
bank-reconciliation skill)pl-quick-compare skill)ar-collections-agent skill)Processes 6 document types → standardized records → Excel workbook + QBO import CSV.
Input TypeFormatsExtractsBank StatementsCSV, OFX/QFX, PDFDate, vendor, amountCredit Card StmtsCSV, PDFDate, merchant, amount, categoryInvoicesPDFVendor, total, date, due date, invoice #, line itemsReceiptsPDF, JPG/PNG*Merchant, date, amount1099 / Tax FormsPDFPayer, TIN, form type, box amountsPayroll ReportsCSV, PDFEmployee, gross, taxes, net per employee
*Image OCR requires tesseract installed.
.cache/document-ingestion/{slug}.jsonTabContentsProcessed TransactionsAll records with category, confidence, dup flag, exception⚠ ExceptionsRecords needing manual review before importDuplicatesFlagged potential duplicates with "Dup Of" referenceCategory MappingUnique vendor → QBO account map with confidenceImport ReadyQBO-format rows (Date, Description, Amount, Account, Memo)CDC LogDelta metrics vs. prior run + this-run stats summary
text
scripts/pipelines/document-ingestion.py
bash
# Process a directory of mixed documents
python3 scripts/pipelines/document-ingestion.py \
--slug sb-paulson \
--input-dir ~/Downloads/month-end-docs
# Single file
python3 scripts/pipelines/document-ingestion.py \
--slug sb-paulson \
--file ~/Downloads/invoice_march.pdf
# Multiple files + custom output dir
python3 scripts/pipelines/document-ingestion.py \
--slug glowlabs \
--file ~/Downloads/stmt.csv \
--file ~/Downloads/payroll.csv \
--out ~/Desktop/ingested
# Offline mode (no QBO auth needed)
python3 scripts/pipelines/document-ingestion.py \
--slug sb-paulson \
--input-dir ./docs \
--no-qbo-coa
# QBO sandbox
python3 scripts/pipelines/document-ingestion.py \
--slug sb-paulson \
--input-dir ./docs \
--sandbox
FlagDefaultDescription--slugrequiredCompany slug (QBO + client vendor map)--input-dir—Directory of docs to process--file—Single file (repeatable)--out``~/DesktopOutput directory--no-qbo-coafalseUse built-in COA only (offline)--sandboxfalseQBO sandbox mode
bash
pip install openpyxl
bash
pip install pdfminer.six # Better PDF text extraction
pip install ofxparse # Better OFX/QFX parsing
brew install tesseract # Image receipt OCR (JPG/PNG)
text
Node.js QBO client # Auth token must be configured
HIGH confidenceHIGH confidenceMEDIUM confidenceLOW confidence50+ known vendors pre-mapped:
VENDOR_MAP in script)Auto-loaded by --slug:
clients/{slug}/categorization-map*.md markdown tablesDUP_WINDOW_DAYS constant)is_duplicate=True, excluded from import fileConditionFlagMissing transaction date"Missing transaction date"Zero amount (non-1099)"Zero amount — verify or skip"Empty/unknown vendor"Vendor name missing or unknown"LOW confidence category"Low categorization confidence — manual review"PDF extraction failed"PDF text extraction failed — manual review required"Image without tesseract"Image OCR not available — manual entry required"
Ready-to-import columns:
text
Date | Description | Amount | Vendor/Customer | Account | Class | Memo | Doc Number
Location: .cache/document-ingestion/{slug}.json
Tracks between runs:
docs_processed, records_extracted, duplicates_caughtexceptions_flagged, import_readyhigh_confidence, medium_confidence, low_confidencetext
DocIngestion_{slug}_{YYYYMMDD}.xlsx
DocIngestion_{slug}_{YYYYMMDD}_QBO_Import.csv
sb-paulson, glowlabs, etc.)--no-qbo-coa--input-dir pointing to client's document drop folderbank-reconciliation.pynano-pdf skill or manual entryVENDOR_MAP in script or add to clients/{slug}/categorization-map.mdEdit load_client_vendor_map() in the script:
python
if slug_lower in ("new-client", "nc"):
client_map.update({
"vendor name": "QBO Account Name",
})
Or create clients/{slug}/categorization-map.md with markdown table:
markdown
| Vendor / Memo Keyword | Primary Account | Notes |
|---|---|---|
| Amazon | Office Supplies | |
| Comcast | Utilities | |
All amounts use Python Decimal with ROUND_HALF_UP to 2 decimal places. No float arithmetic.