A Python command-line expense tracking application that helps you manage daily expenses by category and subcategory with data persistence using JSON.
- ✅ Add expenses by category and subcategory
- ✅ Create your own custom categories
- ✅ Create your own custom subcategories
- ✅ View detailed expense report with subtotals
- ✅ Save data permanently to JSON file
- ✅ Load previous data on startup automatically
- ✅ Error handling for invalid inputs
- ✅ Clean and easy to use menu system
- Python functions
- Nested dictionaries
- JSON file handling
- OS module
- Error handling (try/except)
- While loops
- enumerate()
- f-strings
expense-tracker/
├── expense_tracker.py # Main program (all in one file)
├── expenses.json # Auto-created when you save
└── README.md # Project documentation
- Python 3.x installed
# Clone the repository
git clone https://github.com/umer-analysis/expense-tracker.git
# Go to project folder
cd expense-tracker
# Run the program
python expense_tracker.py=== EXPENSE TRACKER ===
1. Add Expense
2. Show Report
3. Save Data
4. Quit
Choose: 1
--- SELECT CATEGORY ---
1. Food
2. Travel
3. Shopping
4. Create my own
Choose: 1
--- SELECT SUBCATEGORY ---
1. Breakfast
2. Lunch
3. Dinner
4. Snacks
5. Create my own
Choose: 2
Amount (Rs): 500
✅ Added Food → Lunch → 500 Rs
--- EXPENSE REPORT ---
📦 Food
Lunch : 500 Rs
Dinner : 300 Rs
Subtotal : 800 Rs
📦 Travel
Bike : 200 Rs
Subtotal : 200 Rs
💰 Total : 1000 Rs
Choose: 3
💾 Data saved!
Goodbye! 👋
| Category | Subcategories |
|---|---|
| Food | Breakfast, Lunch, Dinner, Snacks |
| Travel | Bike, Car, Plane, Train |
| Shopping | Clothes, Electronics, Groceries |
| Custom | You can create your own! ✅ |
Data is saved in expenses.json file:
{
"Food": {
"Lunch": 500,
"Dinner": 300
},
"Travel": {
"Bike": 200
}
}
Every time you run the program →
previous data loads automatically! ✅
- Delete expense feature
- Edit existing expense
- Monthly expense reports
- Export report to Excel
- Budget limit warnings
- Expense categories with colors
Umer Farooq
- GitHub : github.com/umer-analysis
- Fiverr : fiverr.com/umer_analysis
- Country : Pakistan 🇵🇰
This project is open source and available for learning purposes.
⭐ If you found this helpful, please give it a star on GitHub!