A simple command-line Expense Tracker application written in Python. This tool allows you to add, update, delete, list, and summarize your expenses, storing all data in a JSON file.
It is inspired from the Expense Tracker project https://roadmap.sh/projects/expense-tracker featured in the Backend Roadmap from roadmap.sh.
- Add Expense: Add a new expense with description and amount.
- Update Expense: Edit an existing expense by its ID.
- Delete Expense: Remove an expense by its ID.
- List Expenses: Display all recorded expenses in a formatted table.
- Monthly Summary: Show the total expenses for a specific month.
- General Summary: Show the total of all expenses.
git clone https://github.com/Alvix11/Expense-Tracker-CLI.git
cd expense-trackerMake sure you have Python 3.7 or higher.
python expense-tracker.py <command> [options]-
Add an expense:
python expense-tracker.py add --description "Buy bread" --amount 50 -
Update an expense:
python expense-tracker.py update --id 1 "Buy coffee" 30 -
Delete an expense:
python expense-tracker.py delete --id 1
-
List all expenses:
python expense-tracker.py list
-
Show monthly summary:
python expense-tracker.py summary --month 5
-
Show general summary:
python expense-tracker.py summary
expense-tracker/
├── expense_manager.py
├── helpers.py
├── utils.py
├── settings.py
├── expense-tracker.py
├── expense.json
└── .gitignore
expense_manager.py: Main logic for managing expenses.helpers.py: Helper functions for validation and file operations.utils.py: Utility functions (e.g., date handling).settings.py: Argument parsing and configuration.expense-tracker.py: Entry point for the application.expense.json: Data storage file.
- The
expense.jsonfile is automatically created when you add your first expense. - This file is not tracked by git (
.gitignore) to avoid committing personal data.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License.