This project focuses on analyzing transactional expense data to extract meaningful insights. It demonstrates a step-by-step evolution from basic CSV-based analysis to SQL-powered analytics using Python.
- Python
- Pandas
- SQLite
- Matplotlib
- SQL
expense-data-analysis/
│
├── expenses.csv # Source dataset
├── dashboard.py # streamlit dashboard UI
├── load_to_db.py # Loads CSV data into SQLite database
├── analysis.py # Executes SQL queries and generates charts
├── sql_queries.sql # SQL queries for analytics
├── requirements.txt
├── README.md
└── .gitignore
In Level 1, expense data is analyzed directly from a CSV file using Python and Pandas. The goal is to understand the dataset and perform basic aggregations and visualizations.
- Load CSV data using Pandas
- Category-wise expense aggregation
- Monthly spending trend analysis
- City-wise and payment-method analysis
- Data visualization using Matplotlib
- Data cleaning and preprocessing
- Pandas
groupbyoperations - Basic data visualization
- Python scripting
- Comment out the level-2 part in analysis.py
- Uncomment the level-1 part in analysis.py
- Install dependencies
pip install -r requirements.txt- Run in terminal
python analysis.pyIn Level 2, the project is expanded by introducing an SQL database. The CSV data is loaded into an SQLite database, and all analytics are performed using SQL queries. Python is used to execute queries and visualize results.
- Load CSV data into SQLite3 database
- Write reusable SQL queries for analytics
- Execute SQL queries using Python
- Generate charts from SQL query results
- Category-wise total spending
- Monthly spending trend
- City-wise spending distribution
- Payment method usage analysis
- SQL aggregation and grouping
- SQLite database handling
- Python–SQL integration
- Data-driven visualization
- Clean project architecture
- Bar chart for category-wise spending and payment method analysis
- Line chart for monthly spending trends
- Pie chart for city-wise spending
pip install -r requirements.txt- Load CSV data into database
python load_to_db.py- Run analysis and generate charts
python analysis.pyAn interactive dashboard built using Streamlit to visualize SQL-based expense analytics. The dashboard presents category-wise, monthly, city-wise and payment method spending insights in a user-friendly web interface.
- Interactive web dashboard
- Charts generated from SQL query results
- Clean and minimal UI
pip install -r requirements.txt- Run the following command
streamlit run dashboard.py- You'll be redirected to local url in your web browser