Ashish · field notes
All notes
← back to the system map
LiveFinance & Books2 min read

Bank reconciliation

The monthly "does the book match the bank" chore is now a script that explains the gap to the penny.

Every operating account, every entity, has to reconcile the accounting register against the bank statement every month. By hand it is tedious and easy to fumble, and the one question actually worth asking (why book and bank disagree) gets buried under the matching.

How it works

Two files go in. The QuickBooks register export is a binary .xls I read with xlrd. The bank download is a CSV or a Quicken .dat. I set the statement cutoff, take the register's running balance at that date as the book balance, and compare it to the bank's ending balance. To explain the gap the script does a two-way greedy match of bank lines against book lines by exact amount inside a date window (checks clear on a lag), then verifies the residual by check number.

It runs whenever a statement lands and writes a markdown working paper. Docyt auto-imports transactions, so balances often already tie. The script's real job is to prove it and surface the stale items, like a check that never cleared months later.

This is the whole thesis in miniature. The reconciliation is not the work. The exceptions are. The script does the matching so the only thing that reaches me is the short list of things that genuinely do not line up.

Got an idea? Tell me →More field notes