Turn bank CSVs into a weekly money review

Your spending went up this week. Before changing your budget, it helps to know what caused it.
A bank CSV is a spreadsheet file of transactions. With a little preparation, you can turn those rows into a weekly review and use an AI assistant to explore what the numbers mean.
This example uses fictional bank and card records. Spending rises from $248 to $356. Dining explains $82 of that $108 increase. You can follow the review below without writing code, then try the optional walkthrough to see how the calculations work.
The downloadable project runs on your computer. It has no bank connection and sends no data to an AI service.
Check the week before asking AI to explain it
The review covers October 19 to 25, 2026 and compares it with October 12 to 18.
Category | Previous week | Review week |
Groceries | $110 | $120 |
Dining | $62 | $144 |
Transport | $46 | $38 |
Subscriptions | $30 | $34 |
Shopping | $0 | $20 |
Total | $248 | $356 |
Groceries include $150 of purchases less a $30 refund, leaving $120. Transfers and credit card payments are excluded so the same spending is not counted again.
Dining rose from $62 to $144. This week’s $144 includes an $88 restaurant meal, $36 of takeout and $20 at a cafe. Those purchases explain this week’s total. The $82 increase is the difference between the two weeks.
There is a limit to what the script can check. It cannot know that a bank omitted an account or that a pending transaction will arrive tomorrow. Reconcile the records with the source before treating a real version as complete.
Give the assistant a result it can explain
After checking the output, try this with the fictional data:
Explain this weekly spending review in plain language. Use the supplied totals and state the dates covered. Describe the largest category change and ask what I want to investigate. Do not assume higher spending is a mistake or claim these records cover accounts that are not included.
Then ask:
Dining rose by $82. What would you want to know before suggesting a change to my budget?
The household may have had a one time dinner or an unrealistic limit. The assistant can help explore that context. The database holds the records that make the conversation checkable.
For the month through October 25, dining and groceries together total $646. Against an assumed $730 Food and Drink limit, that leaves $84 in the plan. It does not tell you how much cash is available.
Optional: build the review from the CSV files
Cash Coach weekly review example v2. Open weekly-review.txt for the readable example. To reproduce the calculations, unzip the download and open a terminal in the project folder. You will need Python 3.10 or later; no extra packages are required.
python3 -m unittest -v
python3 review.pyThe first command checks the calculations and import behaviour. The second prints the review. To keep the example in a local database, run:
python3 review.py --db household.sqliteRun that command again. The same transactions should not appear twice.
The package includes two fictional source files, a readable review, the importer, tests and a README. Start with the supplied records.
Decide what each column means
The bank file uses dates such as 2026-10-19. Money leaving the account is negative. Incoming money is positive.
The card file uses dates such as 10/19/2026. Purchases are positive charges and payments are negative.
Those differences matter. Reading both amount columns the same way would produce the wrong spending total. Guessing whether 03/04 means March 4 or April 3 would create a quieter mistake.
The example assigns a known date format to each source. It converts money to integer cents and gives spending a consistent sign: purchases increase spending, refunds reduce it.
Every record has a source, account and transaction ID. Together they identify the row so importing the same file again does not count it twice. A changed amount under an existing ID raises an error for review.
Keep categories and transaction types separate
A transaction can belong to a category and still require different treatment in the calculation.
Groceries are spending. A grocery refund reduces that spending. A payment to your credit card settles a balance; counting it alongside the original purchases would inflate the result. Moving money between your own accounts is another case to handle separately.
This first version labels those types explicitly in the sample files. It also supplies categories rather than pretending merchant names always make the answer obvious.
You can ask an assistant to suggest classification rules as you extend the project. Keep uncertain cases visible and let the person correct them. Do not silently classify every unfamiliar merchant just to make the table look complete.
The reference stores category corrections separately from the imported records. Importing the file again therefore preserves a correction instead of overwriting it.
The work continues after the first import
A useful prototype still needs care when real data arrives. Bank formats change. Pending transactions become posted transactions. An export may overlap with another source. Categories need corrections, and backups need a way to be restored.
The example handles repeat imports from the same source. It does not automatically reconcile the same purchase imported through different feeds. It rejects changed records instead of guessing which version is right.
Keep real exports and databases out of a public repository. If you decide to send financial information to an AI provider, understand what you are sharing and how that provider handles it.
Building this can be a worthwhile project. It also shows why keeping a finance system useful takes more than a good prompt.
If you would rather spend the time on your money
Cash Coach AI maintains spending records, budgets and goals in a dedicated app, with coaching you can return to. You can also connect a compatible assistant to ask questions using those records.
The current external connection reads information. It does not change records or move money. You continue making supported changes in the app.
The downloadable project runs separately from Cash Coach AI.
If you’re new to the product, get the Cash Coach AI app. It has a free trial period.


Comments