A feature-rich, professional Python CLI application designed for tracking personal expenses, setting and monitoring monthly budgets, performing detailed data filtering, and generating insightful visual reports (Bar & Pie charts).
- Overview
- Key Features
- Screenshots & Visual Walkthrough
- Project Architecture
- Directory Structure
- Installation & Setup
- Usage Guide
- Dependencies
- Author
- License
Expense Tracker Pro brings modern financial logging and budget intelligence directly to your terminal. Built with a clean modular Python architecture and backed by SQLite3, it provides robust storage, audit history logging, smart budget warning alerts, and automated graphical charts via Matplotlib.
- Full CRUD Expense Management: Effortlessly add, view, edit, and delete expense entries with safety confirmations.
- Visual Analytics: Automatically generate and export high-resolution Bar Charts and Pie Charts categorizing spending.
- Budget Tracker & Overspend Alerts: Set monthly budget caps with automated real-time spending summaries and warning indicators when limits are exceeded.
- Multi-Criteria Search & Filtering: Filter transactions by pre-set/custom categories, date ranges (
DD-MM-YYYY), or keyword search in descriptions. - Statistical Summaries: View monthly breakdown totals, overall spending averages, and largest single transactions.
- CSV Export & Audit Trail: Export all financial records to
.csvand log system events automatically into structured log and history files.
The main interactive menu displays real-time budget status alerts alongside clear navigation options.
Easily record expenses with customizable categories and view all entries in a formatted, tabular presentation with unique record IDs.
| Add Expense | View All Expenses |
|---|---|
Select records by ID to modify specific fields or remove expenses with built-in safety confirmation prompts.
| Edit Expense | Delete Expense |
|---|---|
Filter transactions by keyword, analyze monthly spending statistics, and monitor your monthly budget limit.
| Search & Filter | Monthly Summary & Stats | Budget Management |
|---|---|---|
Generate visual insights into your spending patterns with Matplotlib graphics.
| Category Bar Chart | Category Pie Chart |
|---|---|
The project follows clean object-oriented design principles and separation of concerns across multiple modules:
app.py: CLI interaction layer handling user inputs, menu options, and UI rendering.tracker.py: Core domain module (ExpenseTracker) encapsulating business logic.database.py: Data access layer managing SQLite schema and SQL query execution.reports.py: Data processing module generating CSV exports and Matplotlib chart visualizations.config.py: Centralized configuration management for project directory paths.utils.py: Utility functions for logging (app.log), user history logging, and banner formatting.
02-Expense-Tracker-Pro/
├── app.py # Main application CLI runner
├── tracker.py # Core ExpenseTracker business logic
├── database.py # SQLite database layer
├── reports.py # CSV export & Matplotlib chart generation
├── config.py # Centralized path configurations
├── utils.py # Logging & history utilities
├── requirements.txt # Project dependencies
├── README.md # Project documentation
├── assets/
│ └── banner.txt # Terminal ASCII banner
├── charts/ # Output folder for generated charts
│ ├── category_bar.png
│ └── category_pie.png
├── database/
│ └── expenses.db # SQLite persistent database
├── exports/
│ └── expenses.csv # Exported CSV spreadsheets
├── history/
│ └── history.txt # Audit trail history log
├── logs/
│ └── app.log # Application system logs
└── screenshots/ # Visual documentation images
├── home.png
├── add-expense.png
├── view-expenses.png
├── edit-expense.png
├── delete-expense.png
├── search.png
├── summary.png
├── budget.png
├── bar-chart.png
└── pie-chart.png
- Python 3.8 or higher installed on your machine.
git clone https://github.com/sanjansahdev/02-Expense-Tracker-Pro.git
cd 02-Expense-Tracker-Pro# Windows
python -m venv venv
venv\Scripts\activate
# macOS / Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython app.pyUpon launching the application, select from options 1 to 15:
- Add Expense: Pick a predefined category (Food, Bills, Travel, etc.) or type a custom one, enter description and amount.
- View All Expenses: Display all recorded expenses in a clean table with IDs, dates, categories, amounts, and descriptions.
- Edit an Expense: View expenses table, pick an ID, and selectively update category, description, or amount using interactive
(y/n)prompts. - Delete Expense: View expenses table, select an expense ID, and confirm deletion.
- Filter by Category: View total spending and transactions for a selected category.
- Search by Keyword: Quick search across expense descriptions.
- Filter by Date Range: View transactions between two
DD-MM-YYYYdates. - Monthly Summary: Group total spending by month with a grand total.
- Spending Summary (Stats): Display total spent, average per entry, and largest single expense.
- Set / View Monthly Budget: Define monthly spending limit and receive automated alerts when exceeding.
- Export to CSV: Save all database records to
exports/expenses.csv. - Generate Bar Chart: Render a category-wise spending bar chart saved in
charts/category_bar.png. - Generate Pie Chart: Render a category spending distribution pie chart saved in
charts/category_pie.png. - Exit: Gracefully quit the application.
- Help: View quick-reference operational guide.
- Matplotlib: Used for rendering bar charts and pie charts.
- SQLite3: Embedded relational database engine (built into Python standard library).
- CSV & Logging: Native Python standard modules for data export and logging.
Sanjan Sah
- GitHub: @sanjansahdev
This project is licensed under the MIT License. Feel free to use, modify, and distribute it for personal or commercial projects.