Expense Tracker
A Python desktop app for logging spending in four currencies and charting it in pounds
Overview
A desktop app for keeping track of where money goes. You log each expense with a date, category, amount, currency and description; the app keeps them in a CSV file, totals them in pounds and draws a bar chart of spending by category.
Exchange rates are fixed examples, not live rates. The point was a complete, small application: a form, validation, storage, a table and a chart.
What I found when I came back to it
It looked finished. Checking the numbers showed otherwise:
- The chart added currencies together. $25 and £12.40 were summed as 37.40 “pounds”. The total underneath was right, so the two disagreed.
- “Delete All Expenses” deleted nothing. It only recreated the file when the file was missing.
- “Delete Expense” could delete too much. It matched rows by their values, so deleting one of two identical expenses removed both.
- The total was hidden. A fixed-size window cut it off below the list.
- The repository held a 38,000-file virtual environment, and its requirements listed libraries the app doesn’t use while missing one it does.
What changed
- Every amount is converted to pounds before it is added, in the chart and the total alike, through one tested function.
- Deleting goes by row number, so exactly the selected expense is removed, and “Delete All” really empties the file. File handling lives in its own module with its own tests.
- The window sizes itself to its contents.
- Tests for every fix, run on every push, in a clean repository.
Brought up to date
- Money is held as
Decimal, not floating point, so totals are exact to the penny. In floating point, 0.10 + 0.20 comes to 0.30000000000000004. - The amount box now refuses
nan,inf, zero and negative numbers. Before, typingnansaved an expense of “£nan”. - uv installs everything from one project file and a lock file, Ruff lints and formats, and mypy checks the money and file-handling code in strict mode.
- 14 tests, run on Python 3.13, 3.14 and 3.15 on every push.
I made the 2026 review and fixes with Claude, an AI assistant, as a pair programmer. Each logic fix comes with a test.
The demo video on this page shows the 2023 version, before these fixes.
Run it
Needs uv, which fetches Python 3.13 or later (with Tkinter) and every dependency.
git clone https://github.com/mcneillium/expense-tracker.git
cd expense-tracker
uv run main_gui.py # opens the app
uv run pytest # runs the tests
Tech stack
Python 3.13 to 3.15, Tkinter, tkcalendar, pandas 3, Matplotlib, pytest, mypy, Ruff, uv, GitHub Actions.