A terminal-based personal finance tool built with Python. Track your daily expenses, categorize them, analyze spending patterns, and visualize your habits through charts β all from the command line, with each user's data stored separately.
- Multi-user support β Each user gets a unique ID and their own private data file
- Add & delete expenses β Log expenses with amount, category, date, and description
- Category filtering β View expenses under any specific category instantly
- Summary & stats β See total spending and breakdowns by category and month
- Charts & visualizations β Bar chart, pie chart, and monthly trend line using Matplotlib
- Persistent storage β All data is saved as CSV files, no database needed
- Re-login support β Switch between users within the same session
expense-tracker/
β
βββ main.py # Entry point β handles UI, menus, and user flow
βββ tracker.py # ExpenseTracker class β core logic, file I/O, and pandas analysis
βββ expense.py # Expense data model with serialization helpers
βββ charts.py # Matplotlib chart functions (bar, pie, monthly trend)
β
βββ data/ # Auto-created folder β stores per-user CSV files
β βββ USR1234.csv # Example: one CSV per user ID
β
βββ users.json # Stores user ID β name mappings
| Tool | Purpose |
|---|---|
| Python 3 | Core language |
| Pandas | Data analysis and CSV handling |
| Matplotlib | Chart visualizations |
| JSON | User registry storage |
| CSV | Per-user expense storage |
When you launch the app, you either register as a new user or log in with your existing User ID. New users get a generated ID like SUJ7823 β save it for future logins.
Once logged in, a menu lets you:
- Add an expense (amount β category β description)
- View all recorded expenses with a running total
- Filter expenses by category
- Delete any expense by its number
- View a full summary with category and monthly breakdowns
- View charts (bar, pie, or trend line)
- Exit or switch to another user account
All data is automatically saved to data/<userID>.csv after every add or delete.
Food | Transport | Shopping | Entertainment | Health | Bills | Other
========================================
PERSONAL EXPENSE TRACKER
========================================
1. I'm a new user
2. I'm an existing user
========================================
Select (1 or 2): 1
Enter your name: Sujit
Welcome, Sujit!
Your User ID is: SUJ4821
Please save this ID to log in next time.
========================================
PERSONAL EXPENSE TRACKER
========================================
1. Add Expense
2. View All Expenses
...
| Chart | Description |
|---|---|
| Bar Chart | Total spending per category |
| Pie Chart | Percentage distribution of expenses |
| Monthly Trend | Line graph showing spending over months |