Personal Expense Tracker

A simple command-line application to help you track your personal expenses by category and date. It allows you to add, view, edit, and delete expenses, as well as provides both textual and graphical summaries to better understand your spending habits.

Features

  • Add Expense: Record expenses with amount, category, and date.
  • View Summary: View total spending by category, overall spending, and spending over time (daily, weekly, or monthly).
  • Edit Expense: Modify existing expenses by updating the amount, category, or date.
  • Delete Expense: Remove expenses that are no longer needed.
  • Graphical Summary: Visualize spending by category using a bar chart.

Getting Started

Prerequisites

  • Python 3.x
  • matplotlib library (for graphical summaries)

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/expense-tracker.git
  2. Change to the project directory:
    cd expense-tracker
  3. Install required libraries:
    pip install matplotlib

Running the Application

To start the expense tracker, simply run:

python expense_tracker.py

Usage

After running the application, you will be presented with a menu:

  1. Add Expense: Enter the amount, category, and date (optional).
  2. View Summary:
    • Choose to view total spending by a specific category or overall.
    • View spending over time (daily, weekly, or monthly).
    • View a graphical summary of expenses by category.
  3. Edit Expense: Select an expense by its index and update the details.
  4. Delete Expense: Select an expense by its index to delete it.
  5. Exit: Save all changes and exit the program.

File Structure

  • expense_tracker.py: Main script for the expense tracker application.
  • expenses.json: Data file where expenses are stored as JSON (automatically created).