Skip to content

prakh0/Expense_Tracker_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧾 Expense Tracker CLI

A command-line based Expense Tracker built in Python to help you log and manage your expenses locally. Supports adding, updating, deleting, and summarizing expenses, with all data stored in a simple JSON file from your Terminal.


Features

  • Add, update, and delete expense records
  • View all expenses in a readable table format
  • Filter by category
  • Get total or monthly summaries
  • Data stored persistently in expenses.json
  • Auto-generates unique IDs
  • Lightweight and fast – no external dependencies

🛠️ Tech Stack

  • Language: Python 3.8+
  • Libraries: Standard Library only (argparse, json, datetime, os)
  • Storage: JSON-based (expenses.json)

📁 Project Structure

expense-tracker-cli/                              
├── main.py             # Entry point: CLI interface using argparse                                                                                  
├── expense.py          # ExpenseManager class (handles business logic)                                                           
├── file.py             # Handles loading/saving data and ID generation                                                    
├── expenses.json       # Local JSON database (auto-generated)                                                                         
└── README.md

⚙️ Getting Started

1. Clone the repository

git clone https://github.com/prakh0/Expense_Tracker_cli.git
cd expense-tracker-cli

2. Run the Application

Make sure you have Python 3 installed.

python3 main.py --help

📚 Example Usage

➕ Add an Expense

python3 main.py add --description "Lunch" --amount 12.5 --category Food

Output:

Expense added successfully (ID: 1)

📃 List All Expenses

python3 main.py list

Output:

| ID  | Date       | Description       | Amount  | Category  |
|-----|------------|-------------------|---------|-----------|
| 1   | 2025-08-02 | Bought vegetables | $250.0  | Groceries |
| 2   | 2025-08-02 | test              | $1500.0 | unknown   |
| 3   | 2025-08-02 | Lunch             | $12.5   | Food      |

🧾 View Summary

python3 main.py summary

Output:

Total expenses: $1762.50

🗓️ Monthly Summary

python3 main.py monthly-summary --month 8

Output:

Total expenses for August: $1762.50

🧼 Delete an Expense

python3 main.py delete --id 1

Output:

Expense with ID 1 deleted successfully.

🛠️ Update an Expense

python3 main.py update --id "2" --description "OTT" --amount 1500 --category Entertainment 

Output:

Expense with ID 2 updated successfully.

📁 Filter by Category

python3 main.py filter-category --category Food

💡 Tips

  • You can run --help with any subcommand to see its arguments:

    python3 main.py --help

About

A lightweight command line expense tracker that helps you record, categorize, and analyze your daily expenses. Built for simplicity and speed, this CLI tool allows you to manage finances efficiently without leaving the terminal.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages