Skip to main content

Personal Finance Tracker

家計簿アプリCourse project
Personal Finance Tracker screenshot
Desktop GUI with live pie chart and 3-level budget alerts

A desktop expense tracker designed for university students: most live on a fixed monthly allowance yet run short by the end of the month because of small costs like eating out, in-game purchases and commuting. It uses a PyQt5 interface, CSV storage and Matplotlib charts for an ad-free, lightweight tracker that starts fast. Group final project for the Programming III course.

Problem

Most university students live on a fixed monthly allowance, but small costs — eating out, entertainment, commuting — easily leave them short by the end of the month. The goal was a desktop expense tracker with no sign-up and no ads that you can open and use right away.

My roleGroup final project for the Programming III course, built together with teammates.

Key decisions

  1. 01

    Store data in CSV files instead of a database

    The file is created automatically on first run, so users don't install or configure anything.

  2. 02

    Three-level budget warning

    Based on the share of the budget spent, it shows "on track / close to the limit / over budget" with the text colour changing, so the status is clear at a glance.

  3. 03

    Read files on a background thread (QThread)

    The table and the pie chart update together once the data is loaded, and the window doesn't freeze while it reads.

Trade-offs

  • CSV has no transactions or protection against concurrent writes, so it suits one person on one machine; deleting a record rewrites the whole file
  • The budget field says "this month's budget", but total spending sums every record in the CSV without filtering by month, so using it across months means clearing the file by hand (found when revisiting the code in 2026-11; not fixed yet)
  • The four categories (food, transport, entertainment, other) are fixed and can't be customised

Results

  • A desktop app (PyQt5) for adding and deleting expenses, setting a monthly budget, with a category pie chart that updates live
  • The date defaults to today, amounts accept whole numbers only, and deleting asks for confirmation

Architecture

add / delete records

check monthly budget

PyQt5 main window

data_manager.py

CSV files
expenses.csv / budget.txt

chart_utils.py
pie chart

Three-level warning
on track / close / over

add / delete records

check monthly budget

PyQt5 main window

data_manager.py

CSV files
expenses.csv / budget.txt

chart_utils.py
pie chart

Three-level warning
on track / close / over

Design Principles

  • Simplicity first: complex features cut, focused on the core of tracking expenses
  • Light and fast: CSV storage, no database to install, files created automatically on first run
  • Budget monitoring: a three-level warning (on track / close to the limit / over budget) with the text colour changing

Features

  • Expense records: add and delete expenses (date, item, category, amount), shown in a table
  • Budget: set this month's limit and see total spending against it in real time
  • Charts: a pie chart shows the category breakdown live, and still renders correctly with no data
  • No freezing: data is read on a background thread (QThread), and the table and chart update together when it's done

Code structure

  • main.py (about 210 lines): the PyQt5 main window — budget bar on top, input row and table in the middle, pie chart on the side
  • data_manager.py: ExpenseManager is a singleton (__new__ creates it only once), so the whole program shares one data manager; records live in expenses.csv (date, item, category, amount) and the budget in budget.txt
  • chart_utils.py: wraps a Matplotlib Figure as a PyQt5 widget (FigureCanvasQTAgg) embedded in the window; the pie chart shows percentages, with the Chinese font set to Microsoft JhengHei to avoid garbled text
  • Budget warning thresholds: spending over budget → red "over budget"; over 80% → orange "close to the limit"; otherwise green "on track"; with no budget set it shows total spending only
  • The background QThread hands the data back to the main thread with a signal to update the window, and won't start another read while the previous one is still running

Group final project for the Programming III course, built with teammates. The screenshot uses sample data.

Type to search projects and posts too