Expense Tracker is a lightweight command‑line application for recording daily spending in a CSV file and generating useful summaries and charts. It is ideal for quickly tracking expenses without relying on a full database or web interface.
- Add expense entries with a date, amount, category, and optional description.
- Show the most recent entries or filter history by date range or category.
- Produce a summary that reports totals by category and the average daily spending. The output is saved to
reports/summary.txt. - Visualize expenses with bar and line charts saved in the
reportsdirectory.
- Python 3.10+
- Python packages:
pandas,matplotlib, andtabulate
-
Clone the repository:
git clone <repository-url> cd expense_tracker
-
(Optional) Create and activate a virtual environment.
-
Install the dependencies:
pip install pandas matplotlib tabulate
-
Create folders for data storage and generated reports:
mkdir -p data reports
Run the CLI by invoking main.py with one of the available commands.
python main.py <command> [--argument value]python main.py add --date 2025-07-01 --amount 120 --category food --description "grocery shopping"python main.py history
python main.py history --last 5
python main.py history --filtered_by date --date_range_from 2025-07-01 --to 2025-07-15
python main.py history --filtered_by category --category foodpython main.py summarypython main.py visualizeThe visualization command produces a bar chart of spending by category and a line chart of daily totals. Both images are saved under reports/.
├── expense.py # Expense data model
├── main.py # Command-line interface
├── manager.py # CSV storage and history filtering
├── report.py # Summary generation
├── utils.py # Input validators
└── visualize.py # Chart rendering
Contributions, issues, and feature requests are welcome. Feel free to open a pull request or submit an issue on GitHub.
This project is provided without a specific license. Use at your own discretion.