Skip to content

umer-analysis/expense-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

💰 Expense Tracker

A Python command-line expense tracking application that helps you manage daily expenses by category and subcategory with data persistence using JSON.


🎯 Features

  • ✅ 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

🛠️ Skills Used

  • Python functions
  • Nested dictionaries
  • JSON file handling
  • OS module
  • Error handling (try/except)
  • While loops
  • enumerate()
  • f-strings

📁 Project Structure

expense-tracker/
├── expense_tracker.py    # Main program (all in one file)
├── expenses.json         # Auto-created when you save
└── README.md             # Project documentation

▶️ How to Run

Requirements

  • Python 3.x installed

Steps

# 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

📖 How to Use

=== EXPENSE TRACKER ===
1. Add Expense
2. Show Report
3. Save Data
4. Quit

Choose: 1

Adding an Expense

--- 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

Viewing Report

--- EXPENSE REPORT ---

📦 Food
   Lunch    : 500 Rs
   Dinner   : 300 Rs
   Subtotal : 800 Rs

📦 Travel
   Bike     : 200 Rs
   Subtotal : 200 Rs

💰 Total : 1000 Rs

Saving Data

Choose: 3
💾 Data saved!
Goodbye! 👋

💡 Example Categories

Category Subcategories
Food Breakfast, Lunch, Dinner, Snacks
Travel Bike, Car, Plane, Train
Shopping Clothes, Electronics, Groceries
Custom You can create your own! ✅

🔄 Data Persistence

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! ✅

🚀 Future Improvements

  • Delete expense feature
  • Edit existing expense
  • Monthly expense reports
  • Export report to Excel
  • Budget limit warnings
  • Expense categories with colors

👨‍💻 Author

Umer Farooq


📝 License

This project is open source and available for learning purposes.


⭐ If you found this helpful, please give it a star on GitHub!

About

Python expense tracker with JSON storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages