Smart Personal Finance Management Right from Your Terminal
Track Income • Manage Expenses • Generate Reports • Visualize Analytics
Quick Start • Features • Tech Stack • Usage
Expense Tracker CLI is a lightweight, command-line personal finance management tool that makes tracking your income and expenses effortless. Built with Python and SQLite, it provides a simple yet powerful interface to manage your finances without leaving the terminal.
Whether you're a student managing monthly budgets, a freelancer tracking multiple income streams, or someone who simply wants better control over their spending, Expense Tracker CLI offers all the tools you need in an intuitive, interactive environment.
With features like monthly summaries, category-wise breakdowns, CSV exports, and visual pie charts, you can understand your financial patterns at a glance and make informed decisions about your money.
- ✅ Add Income — Track multiple income sources (Salary, Freelance, Investment, etc.)
- ✅ Add Expenses — Log expenses with categories (Food, Transport, Entertainment, etc.)
- ✅ View Transactions — Browse all transactions with detailed information
- ✅ Monthly Summary — Get total income, expenses, and balance for any month
- ✅ Category-wise Summary — Analyze spending patterns by category
- ✅ Export to CSV — Download transaction data for external analysis
- ✅ Generate Pie Charts — Visualize expense breakdown with beautiful charts
- ✅ SQLite Storage — Persistent data storage with no external dependencies
- ✅ Interactive CLI — User-friendly menu-driven interface
- ✅ Date Flexibility — Default to current date or specify custom dates
- Python 3.8+ — Modern, readable, and powerful programming language
- SQLite3 — Lightweight, serverless database for reliable data persistence
- Matplotlib — Professional data visualization for charts and graphs
- CSV — Standard format for data export and analysis
- Python's
datetimemodule for date handling - SQL for structured data queries
- Matplotlib's pie chart capabilities for visual analytics
Syntecxhub_ExpenseTrackerCLI/
├── expense_tracker.py # Main application file
├── requirements.txt # Python dependencies
├── README.md # Project documentation
├── LICENSE # MIT License
├── .gitignore # Git ignore rules
├── data/ # Database storage
│ └── expenses.db # SQLite database (auto-created)
└── reports/ # Generated reports
├── expenses_*.csv # Exported transactions
└── expense_chart_*.png # Generated pie charts
- Python 3.8 or higher installed on your system
- Git (for cloning the repository)
# Clone the repository
git clone https://github.com/LegendarySumit/Syntecxhub_ExpenseTrackerCLI.git
cd Syntecxhub_ExpenseTrackerCLI
# Install dependencies
pip install -r requirements.txt# On Windows
python expense_tracker.py
# On macOS/Linux
python3 expense_tracker.pyThe interactive menu will appear, and you can start managing your finances!
By default, the SQLite database is stored in data/expenses.db. The application automatically creates the necessary directories and tables on first run.
You can modify the database location by editing expense_tracker.py:
# Line 244: Modify the db_path parameter
tracker = ExpenseTracker(db_path="your/custom/path/expenses.db")- No environment variables required
- No API keys needed
- Works offline with local SQLite database
When you run the application, you'll see:
==================================================
💰 EXPENSE TRACKER CLI - Main Menu
==================================================
1. ➕ Add Income
2. ➖ Add Expense
3. 📋 View Transactions
4. 📊 Monthly Summary
5. 🏷️ Category Summary
6. 📁 Export to CSV
7. 📈 Generate Pie Chart
8. ❌ Exit
==================================================
Add Income Example:
Select an option (1-8): 1
Enter date (YYYY-MM-DD) [Today]: 2024-06-15
Enter income category (Salary/Freelance/Investment/Other): Freelance
Enter amount: $1500
Enter description (optional): Web Development Project
✅ Income of $1500.00 added successfully!
Add Expense Example:
Select an option (1-8): 2
Enter date (YYYY-MM-DD) [Today]: 2024-06-15
Enter expense category (Food/Transport/Entertainment/Utilities/Health/Other): Food
Enter amount: $25.50
Enter description (optional): Lunch
✅ Expense of $25.50 added successfully!
Select an option (1-8): 3
View last N transactions (press Enter for all): 10
================================================================================
ID Date Type Category Amount Description
================================================================================
1 2024-06-15 💸 expense Food $25.50 Lunch
2 2024-06-15 💰 income Freelance $1500.00 Web Development Project
================================================================================
Select an option (1-8): 4
Enter month (1-12) [Current]: 6
Enter year [Current]: 2024
==================================================
📊 Monthly Summary - June 2024
==================================================
💰 Total Income: $1500.00
💸 Total Expenses: $25.50
📈 Balance: $1474.50
==================================================
Select an option (1-8): 5
Enter month (1-12) [Current]: 6
Enter year [Current]: 2024
==================================================
🏷️ Category Summary - June 2024
==================================================
💰 INCOME:
--------------------------------------------------
Freelance $1500.00
💸 EXPENSE:
--------------------------------------------------
Food $25.50
==================================================
Select an option (1-8): 6
✅ Exported 15 transactions to reports/expenses_20240615_143022.csv
The CSV file contains all transactions in a format compatible with Excel, Google Sheets, and other spreadsheet applications.
Select an option (1-8): 7
Enter month (1-12) [Current]: 6
Enter year [Current]: 2024
✅ Pie chart saved to reports/expense_chart_20240615_143022.png
A beautiful pie chart visualizing your expense breakdown is generated and displayed.
Here's a typical workflow using the application:
# 1. Start the application
python expense_tracker.py
# 2. Add your monthly income
# Menu option 1
# 3. Add daily expenses throughout the month
# Menu option 2
# 4. Check your progress
# Menu option 3 or 4
# 5. Analyze spending patterns
# Menu option 5
# 6. Export data for records
# Menu option 6
# 7. Visualize your spending
# Menu option 7| Metric | Details |
|---|---|
| Lines of Code | ~390 LOC |
| Python Version | 3.8+ |
| Dependencies | 1 (matplotlib) |
| Database | SQLite3 (Built-in) |
| Memory Footprint | ~5MB |
| Setup Time | <2 minutes |
- SQLite3 for lightweight, file-based persistence
- Single
transactionstable storing all records - No server required, data stored locally
- Automatic schema creation on first run
- Date format validation (YYYY-MM-DD)
- Amount validation (numeric values)
- Month range validation (1-12)
- Graceful error handling for invalid inputs
- CSV Export — Compatible with all spreadsheet applications
- Pie Charts — Visual representation of expense categories
- Monthly Reports — Income vs. Expense summaries
- Category Reports — Spending breakdown by category
- Budget setting and alerts
- Multi-user support with authentication
- Advanced filtering and search
- Recurring transactions automation
- Tax category tagging
- Financial goals tracking
- Year-on-year comparisons
- Web-based dashboard interface
- Mobile app version
- Bank statement import
Solution:
pip install -r requirements.txt
# or
pip install matplotlib==3.8.2Solution:
# macOS
brew install python-tk@3.9
# Ubuntu/Debian
sudo apt-get install python3-tk
# Fedora
sudo dnf install python3-tkinterSolution: Ensure only one instance of the application is running. Close any other terminals running the app.
Solution: Check folder permissions:
chmod 755 data/
chmod 755 reports/Want to test the application? Here's sample data you can enter:
Income Entries:
- Date: 2024-06-01, Category: Salary, Amount: $3000
- Date: 2024-06-15, Category: Freelance, Amount: $500
Expense Entries:
- Date: 2024-06-02, Category: Food, Amount: $45
- Date: 2024-06-05, Category: Transport, Amount: $30
- Date: 2024-06-10, Category: Entertainment, Amount: $60
- Date: 2024-06-15, Category: Utilities, Amount: $120
- Date: 2024-06-20, Category: Health, Amount: $50
- Local Storage — All data stored locally on your machine
- No Cloud Upload — Your financial data never leaves your computer
- No Tracking — Application collects no usage analytics
- Open Source — Full code transparency, audit the code yourself
- Regular Backups — Periodically copy your
data/expenses.dbfile - Consistent Categories — Use the same category names for better analysis
- Detailed Descriptions — Add descriptions for future reference
- Monthly Reviews — Check your monthly summary regularly
- Export Archives — Export CSV files monthly for historical records
This project is licensed under the MIT License — you are free to use, modify, and distribute this software. See the LICENSE file for details.
LegendarySumit
- GitHub: @LegendarySumit
- Project: Syntecxhub_ExpenseTrackerCLI
- Email: prustysumit78@gmail.com
- Portfolio: legendarysumit.github.io
Found a bug? Have an idea? Contributions are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request