↑↓ move ↵ open esc close
Tax documents and financial paperwork neatly arranged on a desk
Open-source

Ledger: Australian personal finance, filed by what you actually bought

8 min read Isaac Rowntree

Zack Design’s ledger is a personal finance tool for Australians that runs on your own machine. It reads bank, card and PayPal statements from eight Australian sources into one SQLite file, files every transaction into your own categories, and shows a tax return laid out the way the Australian Taxation Office (ATO) wants it, plus a net worth dashboard, in your browser. It needs no cloud account, and nothing leaves your machine unless you ask it to. MIT licensed.

This post covers:

  • how it files transactions with no regex rules to maintain;
  • handing the leftovers to Claude, and why it answers “sure”, “likely” or “unsure” instead of a percentage;
  • reading your email receipts, so a $30 Amazon charge is filed as the tyre inflator it was;
  • money that comes back: friends paying their share, PayPal purchases counted twice, and a 10,000 won refund that read as $10,000;
  • the rule underneath it all: a statement that doesn’t add up is refused, and the bugs that rule caught.

Why it exists

Every July I rebuilt the same spreadsheet for the accountant: paste in ING, PayPal and the credit card, categorise everything by hand, split it by business, and spot the $200 that shows up twice, once on the card and once on the account that paid it. Ledger replaces that. You drop statements in a folder, run one command, and open a dashboard.

Filing transactions without regex rules

The obvious approach is pattern rules: “if the description contains WOOLWORTHS, it’s Groceries”. They don’t scale. My own set reached 430, and every new merchant meant another. Learning from corrections doesn’t rescue them either: saving the whole description, receipt number and date included, means the same café never matches twice, so every correction is a one-off.

Ledger works like this instead:

  1. Clean the description down to the merchant. Receipt numbers, dates, card digits, reference codes, foreign amounts, the suburb of the card terminal and “Visa Purchase”-style prefixes are stripped. Visa Purchase - Receipt 105183 SOME CAFE NEWTOWN Date 24/11/24 Card 1234 and next week’s visit both become SOME CAFE NEWTOWN.
  2. Known merchant? Use its label. You set labels by changing a category once in the dashboard, and every later visit follows.
  3. New merchant? Compare it with the merchants and transactions you’ve already filed, and borrow their category if they agree strongly enough. Otherwise leave it for review, with the top suggestions as one-click chips.

Step 3 uses a small embedding model, bge-small, running locally through ONNX, and a vector index, sqlite-vec, inside the same SQLite file. Neither needs a GPU or the internet. Without them, ledger falls back to comparing character patterns with NumPy, and still works.

Two details made a measurable difference:

  • Raw descriptions beat cleaned ones for finding neighbours. Cleaning helps exact matching, but the “noise” (a suburb, a payment type) helps judge how similar two transactions are. Matching on the cleaned name and searching on the raw text gave the most transactions filed automatically at 95% precision.
  • Guesses never become evidence. Only transactions you confirmed, or that were filed confidently, count as neighbours. Otherwise one wrong guess would quietly spread.

ledger categorise --evaluate measures all this on your own history: it learns from transactions before a date and scores its guesses on the ones after. On three and a half months of my data, three quarters of transactions were filed automatically, about 98% of them correctly. The rest went to review.

Letting Claude do the long tail

What’s left are merchants nobody has seen before, like “J SMITH PTY LTD” or a café in a city you visited once. A name alone often isn’t enough; research on card transactions puts classifiers that only see the merchant name at around 57%. A language model that knows what “Into Laksa” or “Phonebot” is does much better.

ledger categorise --llm sends the pending transactions to Claude in batches. Each one goes with the most similar merchants you’ve filed, a few examples of what each category holds, and your own conventions from a short guide file (“cafés are Coffee, meals are Eating Out”). The answer is restricted to your category names, so nothing invalid can come back.

Claude doesn’t answer with a confidence percentage. Language models tend to give the same 70 to 80% to everything, so instead each answer comes in one of three buckets:

  • sure: the transaction is filed and the merchant learned for good;
  • likely: filed, and flagged for you to glance at;
  • unsure: filed under the best guess, and the merchant goes on a Merchants to check page with the alternative and a one-line reason.

Anything that changes a tax figure (business expenses, rental costs, income) is “unsure” unless the evidence is clear. If you’d rather not use the API, --export writes the same file for any model and --import reads the answers back.

Some merchants can’t have one label. Amazon sells camera gear and kitchenware. A friend’s transfers might be rent one week and their share of dinner the next. These are marked mixed: each transaction is looked at on its own, and filing one never relabels the merchant.

Reading your receipts

The best evidence of what you bought is the receipt in your inbox. ledger receipts reads your email through himalaya, a command-line mail client, so it works with Gmail or any IMAP account.

  • PayPal receipts carry a transaction ID that matches the statement exactly.
  • Everything else is matched by sender (“amazon.com.au” for an AMAZON charge), a date window around the purchase, and the exact amount appearing in the email.

What was bought is stored next to the transaction and sent along to --llm. On my own ledger, matching Amazon receipts moved 56 shipments, about $2,000, out of “business equipment”: they were light bulbs, kitchen gear and phone cables. A few genuine lenses and light stands moved the other way.

Email text stays on your machine. Only --llm sends anything out, and only when you run it.

Money that comes back

Three traps only show up once the categories are trustworthy enough to read.

Friends paying their share. When you pay for a group dinner and six people send you $70, those aren’t income. ledger reimbursements links each repayment to what it repaid: the whole cost or an even share, soon after, or several people sending the same per-head amount within a few days (a couple paying double, someone adding $10 for the tip). The repayment is then counted as less Eating Out, not as money earned. Regular transfers like rent, Medicare refunds, and anything touching a deduction are left alone. One special case: if a co-owner pays half a cost on a jointly owned rental, that’s not an offset, because each owner already claims only their share.

PayPal purchases counted twice. A PayPal purchase appears in PayPal’s export and again on the card that paid PayPal. A dedup step marks the card copy as a transfer. Its marks are final, because a later re-categorisation could otherwise quietly undo them. It also looks further than two days apart, because some cards post four days late.

A 10,000 won refund that read as $10,000. When PayPal’s export has no Australian dollar conversion for a foreign payment, the foreign amount sits in the dollar column. Read naively, a handful of taxi rides abroad come to $50,000 of spending. Ledger converts those rows at the rate PayPal used for your nearest converted payments in the same currency, and marked as estimated.

The rule underneath: a statement that doesn’t add up is refused

Everything above depends on the numbers being right, and statements are messy.

Each bank parser only describes a statement: its period, its printed opening and closing balances, which way they point, and its rows. The engine decides what goes in. If the rows don’t add up to the difference between the printed balances, nothing is loaded:

  ! balance_mismatch: rows sum to -1,234.56 but opening 1,000.00 -> closing 2,204.58 implies -1,204.58 (-29.98)
  REFUSED -- statement does not account for its own printed balances; nothing was ingested.

That is almost always a parser bug, and it caught some real ones.

Reading columns from where numbers end. CBA, Bankwest and HSBC print debits and credits in separate columns as plain positive numbers. Turn the PDF into text and a $10 fee and a $10 deposit look identical. Ledger keeps each number’s position on the page instead. The numbers are right-aligned, so it matches each one’s right edge to the column heading.

Left: the statement as flat text, where a ten dollar fee and a ten dollar deposit read identically. Right: the same rows as laid out on the PDF under Debit and Credit headings; the numbers are right-aligned, so their left edges wander with the number's width while their right edges line up exactly under the heading, which is what the parser matches on.

Guessing direction books every HSBC deposit as spending. A rule of “expense unless the description sounds like income” gets deposits wrong, and with no balances the safety check has nothing to catch it with. The HSBC parser reads the column positions and carries each printed balance through.

A loan read the wrong way round costs a $3,746 deduction. Deciding which way a statement’s balances point by a vote across its rows looks reasonable. On a new loan’s first statements, though, interest and fees outnumber repayments, so they win the vote. On my data, six interest rows got the wrong sign and understated one year’s rental interest deduction by about $3,746 before tax. Ledger reads the statement’s own header instead, and only the first 15 lines: searching the whole document matches a loan product’s footer printed on an everyday account.

PayPal spells Authorisation with an s. A skip list for PayPal’s authorisation holds with the American spelling misses them, and on my data stored eleven purchases twice.

ledger reconcile then checks the stored transactions against every balance the banks printed, which turns a silent gap into a named transaction.

Sources supported today

Source Formats
ING Australia PDF statements, CSV export
CBA transaction account PDF, credit card PDF
Bankwest credit card PDF, home loan / offset PDF, CSV
HSBC credit card PDF, everyday account PDF, CSV
Coles Mastercard PDF, CSV
PayPal CSV activity report
Amex CSV download
Airbnb CSV payout report
CommSec PDF contract notes, into a capital gains schedule

Trying it

git clone https://github.com/isaacrowntree/ledger.git && cd ledger
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[vectors]"          # local embeddings and sqlite-vec; plain -e . works too
ledger ingest                        # statements dropped in staging/
ledger categorise --setup            # learn from what you've already filed
ledger receipts                      # optional: match email receipts (himalaya)
ledger categorise --llm --dry-run    # optional: Claude files the rest (pip install -e ".[llm]")
python -m api                        # dashboard on http://127.0.0.1:5050

The documentation covers configuring accounts and categories, adding a bank, business splits and the tax views. The repo has a test suite, and a private corpus of real statements must ingest cleanly before anything merges.