A command-line personal finance tracker built using Python that allows users to record income, expenses, and recurring subscriptions, calculate balances, and analyze spending patterns.
This project focuses on writing clean, modular, and production-style Python code, using proper packages, modules, and separation of concerns—similar to real-world backend systems.
- Add income transactions
- Add expense transactions
- View complete transaction history
- Search transactions by category, description, or amount
- View current balance (income − expenses)
- View expenses grouped by category
- View adjusted balance (after subscriptions)
- Add recurring subscriptions
- View all subscriptions
- Calculate total monthly subscription cost
- View top subscriptions by cost
- Interactive, menu-driven CLI
- Safe numeric input handling
- Modular, scalable project structure
- Python packages & modules
- Object-Oriented Programming (OOP)
- Encapsulation & separation of concerns
- Lists and dictionaries
- Loops and conditional logic
- User input handling & validation
- Data aggregation and reporting
- Sorting and filtering data
- CLI application design
__name__ == "__main__"execution pattern
personal-finance-tracker/
│
├── README.md
├── main.py
└── finance_tracker/
├── __init__.py
├── models.py
├── account.py
└── cli.py
Contains data-only classes:
TransactionSubscription
No calculations or user interaction logic.
Acts as the business logic layer.
Responsibilities:
- Store transactions and subscriptions
- Calculate:
- Total income
- Total expenses
- Current balance
- Adjusted balance (after subscriptions)
- Expenses grouped by category
- Monthly subscription cost
- Top subscriptions by cost
This is the single source of truth for financial data.
Handles all user interaction.
Responsibilities:
- Display menu options
- Collect and validate user input
- Create
TransactionandSubscriptionobjects - Call methods on the
Accountclass - Format and display output
The CLI performs no calculations itself.
The application entry point.
Responsibilities:
- Start the CLI application
- Ensure code only runs when executed directly
Uses the standard Python pattern:
if __name__ == "__main__":
run()run() is imported from finance_tracker.cli
User Input
↓
CLI collects input
↓
Account stores and processes data
↓
Account returns calculated or filtered results
↓
CLI formats and displays output
The Account object is the single source of truth for all financial data.
Make sure Python 3 is installed.
From the project root directory:
python3 main.pyFollow the on-screen menu to:
- Add income, expenses, and subscriptions
- View balances and adjusted balances
- Review spending by category
- Analyze subscription costs
- Search transaction history
- Track daily or monthly expenses
- Monitor recurring subscriptions
- Understand spending habits by category
- See how subscriptions affect available balance
- Practice building structured Python CLI applications
- Persist data using JSON (save/load)
- Add timestamps to transactions
- Edit or delete transactions and subscriptions
- Normalize subscription billing cycles to monthly cost
- Monthly and yearly summaries
- Export reports to CSV
- Unit tests
- Web-based interface in the future
Built as part of a hands-on Python learning journey by Vishal Dsouza
Focused on writing clean, readable, and extensible code.