A Python CLI app to manage personal expenses with budgets, analytics, exports, and optional encrypted notes.
If you like this tool, ⭐ it on GitHub!
- Add, update, and soft-delete expenses
- Categorize expenses and track monthly budgets
- View monthly totals per category
- Filter/search expenses by category, date, amount, or keyword
- Export to Excel (.xlsx) and PDF (.pdf)
- Optional note encryption using Fernet
- Spending trend visualization (ASCII + chart embedded in PDF)
- Rich interactive CLI with tables, prompts, and panels
- Python 3.10+
- SQLite via SQLAlchemy ORM
- CLI UI:
rich - PDF export:
fpdf - Excel export:
openpyxl - Charting:
matplotlib - Optional encryption:
cryptography
- Clone repo
git clone https://github.com/CPS7/Expense-Tracker-CLI.git
cd Expense-Tracker-CLI- Create virtual environment
python -m venv venv
source venv/bin/activate # Linux / macOS
venv\Scripts\activate # Windows- Install dependencies
pip install -r requirements.txt- Optional: Enable note encryption
Create a .env file with:
EXPENSE_ENCRYPT_NOTES=1
EXPENSE_KEY=<your_32byte_base64_key>
Key must be 32 url-safe base64 bytes. Encryption can be disabled by setting
EXPENSE_ENCRYPT_NOTES=0or leavingEXPENSE_KEYempty.
Run the CLI app:
python main.pyYou’ll see a menu like:
1. Add Expense
2. View Expenses
3. Soft Delete Expense
...
14. Exit
- Navigate with number input
- Follow prompts for amount, date, note, category, etc.
- Export options available for Excel and PDF reports
Add an expense:
Amount (₹): 500
Note: Groceries
Date (YYYY-MM-DD): 2025-11-15
Category: Food
Currency: INR
✔ Expense saved (id: 1)
View monthly category totals:
Category Totals - November 2025
-------------------------------
Food 1500.00
Transport 800.00
Utilities 300.00
-------------------------------
Total all categories: 2600.00
Export filtered expenses to PDF with trend chart
Search & Export -> Export as PDF -> Embed trend chart: Yes
✔ PDF exported: expenses_report_20251115_221530.pdf
categories→ Expense categoriesexpenses→ Stores individual expensesbudgets→ Monthly budgets per categoryexpense_history→ Tracks create/update/delete actionsmeta_info→ Schema version info
- Soft delete sets
deleted=True; hard delete removes record. - Notes cannot be searched reliably if encryption is enabled.
- Budgets trigger warnings at 80% spent and 100% exceeded.
- Trend charts are embedded in PDF; temporary files are cleaned automatically.
MIT License © 2025 CPS7