Production-grade Python application demonstrating OOP, SOLID principles, and 4 design patterns. Enterprise-level code with logging, error handling, and type hints.
- ✅ Add/View/Delete Expenses with automatic validation
- ✅ Advanced Analytics (min, max, average, totals)
- ✅ Category-wise Breakdown with percentage charts
- ✅ Filtering by category and date range
- ✅ CSV Export for external analysis
- ✅ Comprehensive Logging (file + console)
- ✅ Production-Grade Error Handling
- ✅ Type Hints & Custom Exceptions
Requirements: Python3 No external dependencies needed! Just run: python expense_tracker.py
Enter your choice (1-9): 1
Enter date (DDMMYyyyy): 07122025
Select category (1-8): 1
Enter description: Coffee at Cafe
Enter amount (₹): 150
Expense added: Coffee at Cafe (₹150)
Enter your choice (1-9): 3
TOTAL SPENDING SUMMARY
Total Expenses: 5
Total Spending: ₹2,500.00
Average Expense: ₹500.00
Enter your choice (1-9): 7
Exported 5 expenses to expenses_export.csv
- Format: JSON (expenses.json)
- Location: Root directory
- Auto-created: Yes, on first run
- File: logs/expense_tracker.log
- Levels: DEBUG (file), INFO (console)
- Auto-created: Yes
ExpenseCategory:
1. Food
2. Travel
3. Shopping
4. Entertainment
5. Utilities
6. Health
7. Education
8. OtherView All Expenses:
ALL EXPENSES
────────────────────────────────────────────────────────────
# Date Category Description Amount
────────────────────────────────────────────────────────────
1 07122025 Food Coffee ₹150.00
2 07122025 Travel Taxi ₹300.00
3 08122025 Shopping Books ₹1,200.00
────────────────────────────────────────────────────────────
Category Breakdown:
SPENDING BY CATEGORY
──────────────────────────────────────
Shopping ████████████░░ ₹1,200.00 (48.0%)
Travel ██████░░░░░░░░ ₹300.00 (12.0%)
Food ████░░░░░░░░░░ ₹150.00 (6.0%)
──────────────────────────────────────
TOTAL ₹2,500.00 (100.0%)
Design Patterns Implemented:
- Singleton: LoggerSetup (centralized logging)
- Repository: DataRepository + JSONRepository
- Strategy: Multiple filtering approaches
- Enum: Type-safe categories
SOLID Principles:
- Single Responsibility: Each class has one purpose
- Open/Closed: Easy to extend (add SQLRepository)
- Liskov Substitution: Any repository implementation works
- Interface Segregation: Minimal, focused interfaces
- Dependency Injection: Manager receives repository as parameter
- Database Integration - Add SQLRepository for PostgreSQL/MySQL
- Budget Limits - Set spending caps per category
- Monthly Reports - Generate comprehensive monthly analysis
- Web Interface - Convert to Flask/Django web app
- Data Visualization - Add matplotlib charts
If you have any feedback, please reach out to me at samithnitta1@gmail.com
MIT License file for details.