Overview
A menu-driven command-line application for tracking personal expenses and income, and computing the resulting wallet balance from both histories. It supports filtering expense and income records by date, category, and amount, and persists all data to a local JSON file so history survives between runs.
Architecture
The application is organized around an object-oriented model of expenses, income, and the wallet, with expense and income histories tracked separately and the wallet balance derived from both rather than stored as an independent value. All state loads from and saves to a single local JSON file.
Key Features
- Add and remove individual expense and income entries
- View full expense and income history
- Filter expenses by amount, category, or date, and income by amount or date
- Automatic wallet balance calculation from combined expense and income history
- Input validation on entered amounts, categories, and dates
- Persistent local storage via a JSON save file
Technical Challenges
- Keeping the wallet balance correct and consistently derived from two separately tracked histories instead of letting it drift out of sync
- Designing multi-criteria filtering by date, category, and amount over a plain list of records without a database query layer
Engineering Decisions
- Kept expenses and income as two distinct histories rather than one combined ledger, since they're filtered and displayed differently, and derived the balance from both instead of storing it separately
- Chose JSON file storage over a database for a project at this scale, while recognizing in hindsight that splitting the single-file script into separate modules and moving to SQLite would be the right next step for maintainability
Technologies Used
Python, using the standard library's json module for persistence and datetime for date handling and filtering, with no external dependencies.
Lessons Learned
- Practiced core object-oriented programming and organizing a larger Python program than a single script
- Learned practical JSON read/write persistence and date/time handling
- Recognized in retrospect that a single-file structure limits maintainability, which now informs how later projects are split into modules from the start