Skip to content

CPS7/Expense-Tracker-CLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Expense Tracker CLI

Release

A Python CLI app to manage personal expenses with budgets, analytics, exports, and optional encrypted notes.


If you like this tool, ⭐ it on GitHub!

Features

  • 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

Tech Stack


Setup

  1. Clone repo
git clone https://github.com/CPS7/Expense-Tracker-CLI.git
cd Expense-Tracker-CLI
  1. Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux / macOS
venv\Scripts\activate     # Windows
  1. Install dependencies
pip install -r requirements.txt
  1. 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=0 or leaving EXPENSE_KEY empty.


Usage

Run the CLI app:

python main.py

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

Examples

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

Database Schema

  • categories → Expense categories
  • expenses → Stores individual expenses
  • budgets → Monthly budgets per category
  • expense_history → Tracks create/update/delete actions
  • meta_info → Schema version info

Notes

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

License

MIT License © 2025 CPS7


About

Expense-Tracker-CLI is a powerful command-line personal finance manager built with Python and SQLite. It allows you to track, analyze, and visualize your expenses with advanced features like budgeting, trend charts, and encrypted notes—all from the terminal.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages