This is a simple web application built using Flask, a Python web framework, to track and visualize expenses from a CSV file. The application allows users to upload a CSV file containing transaction data, performs data validation and cleaning, and presents a summary of income, expenses, and a breakdown of expenses by category. The expense data is visualized using a bar chart, and users can filter the chart based on predefined amount ranges.
- Upload CSV File: Users can upload a CSV file containing transaction data.
- Data Validation: The application performs validation checks on the CSV file to ensure it contains the required columns ('Amount', 'Type', 'Beneficiary name').
- Data Cleaning: Empty or invalid entries in the 'Type', 'Beneficiary name', and 'Amount' columns are handled.
- Dynamic Mapping: The application dynamically maps similar beneficiary names to a standardized name for better categorization.
- Manual Mapping: Specific beneficiary names are manually mapped for accurate categorization.
- Expense Summary: Provides an overview of total income, total expenses, and a breakdown of expenses by category.
- Filtering: Users can filter the expense chart based on predefined amount ranges.
-
Upload CSV File:
- Click on the "Upload CSV File" button on the home page.
- Select a CSV file with the required columns ('Amount', 'Type', 'Beneficiary name') and click "Upload."
-
View Summary:
- After uploading, click on the file name to view the expense summary.
- The summary includes total income, total expenses, and a table of categorized expenses.
-
Filter Chart:
- Use the dropdown menu to filter the expense chart based on predefined amount ranges.
- The chart dynamically updates based on the selected filter.
- Python 3.x
- Flask
- Pandas
- NumPy
- Chart.js (JavaScript library)
-
Clone the repository:
git clone https://github.com/tyagi-achint/expense-tracker.git
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the Flask application:
python app.py
-
Open your web browser and go to
http://localhost:5000
to use the Expense Tracker.
- app.py: Flask application code.
- templates/: HTML templates for the web pages.
- static/: Static files (CSS, JS, images).
- uploads/: Folder to store uploaded CSV files.
- Dynamic Mapping: Adjust the
add_to_dynamic_mapping
function inapp.py
to modify dynamic mapping behavior. - Manual Mapping: Update the
manual_mapping
dictionary inapp.py
to add or modify manual mappings.
-Achint Tyagi achinttyagi001@gmail.com
Feel free to contribute, report issues, or suggest improvements.