A small command-line tool to track daily expenses, written in Python with the standard library only (no dependencies). Expenses are stored in a local CSV file.
- Add an expense (amount + category, auto-dated)
- View all expenses in a numbered table
- Total spent, with a per-category breakdown
- Delete an expense by its number
- CSV storage — your data lives in
expenses.csv
python3 expense_tracker.pyNo installation needed (Python 3 standard library only). A menu appears:
--- Expense Tracker ---
1. Add Expense
2. View Expenses
3. Show Total
4. Delete Expense
5. Exit
Enter choice:
Example — after adding a few expenses:
Total Spent: 157.50
By category:
Rent 100.00
Food 57.50
Expenses are read/written with Python's csv.DictReader / csv.DictWriter, so the
header row is handled automatically. add appends a row; delete rewrites the file
without the chosen row. Data persists in expenses.csv in the current directory.
Python 3 · csv · datetime (standard library only)