Expense Tracker With Graphs Using PictoBlox Python Editor

by karishmathakur in Design > Software

9 Views, 0 Favorites, 0 Comments

Expense Tracker With Graphs Using PictoBlox Python Editor

Screenshot 2026-06-17 114145.png
Expense Tracker with Graphs

Managing money wisely is an important life skill. Keeping track of daily expenses helps individuals understand their spending habits and make better financial decisions. In this project, I developed an Expense Tracker with Graphs using the PictoBlox Python Editor (Py Editor). The application allows users to record their daily expenses, categorize them, analyze spending patterns, and visualize the data through graphs.

The project demonstrates the use of Python programming, data handling, and data visualization to create a practical solution for personal finance management.

Supplies

  1. PictoBlox
  2. Python Editor (Py Editor) in PictoBlox
  3. Python Libraries:
  4. pandas (for data handling)
  5. matplotlib (for graph generation)

Create the Expense Entry System

The first step is to create a system where users can enter:

  1. Date
  2. Expense Category
  3. Expense Amount
  4. Description (optional)

The program stores these details for further analysis.

Example Categories:

  1. Food
  2. Transportation
  3. Education
  4. Entertainment
  5. Shopping
  6. Utilities
  7. Others


Store and Organize Data

The entered expense data is stored in a structured format using Python data structures such as lists or dataframes.

This allows the program to:

  1. Retrieve records easily.
  2. Calculate totals.
  3. Group expenses by category.
  4. Generate reports.


Analyze the Expense Data

The program processes the stored information and calculates:

  1. Total Expenses
  2. Category-wise Expenses
  3. Highest Spending Category
  4. Average Daily Spending

This analysis helps users understand their financial habits.

Generate Graphs

Using Python visualization libraries, the expense data is converted into graphical charts.

Types of Graphs Used:

Bar Graph

Shows spending across different categories.

Pie Chart

Displays the percentage share of each category.

Line Graph

Shows spending trends over time.

These visualizations make financial data easier to understand.

Python Code

import pandas as pd

import matplotlib.pyplot as plt


# Step 1: Create empty list to store data

data = []


print("Expense Tracker")

print("Enter your expenses (type 'done' to finish)\n")


# Step 2: Take user input

while True:

date = input("Enter date (YYYY-MM-DD) or 'done': ")

if date.lower() == 'done':

break

category = input("Enter category (Food/Travel/Shopping/etc): ")

amount = float(input("Enter amount: "))

data.append([date, category, amount])

print("Expense added!\n")


# Step 3: Create DataFrame

df = pd.DataFrame(data, columns=["Date", "Category", "Amount"])


# Convert Date column to datetime

df["Date"] = pd.to_datetime(df["Date"])


# Step 4: Category-wise total

category_total = df.groupby("Category")["Amount"].sum()


# Step 5: Daily total

daily_total = df.groupby("Date")["Amount"].sum()


# Step 6: Find overspending category

max_category = category_total.idxmax()

max_amount = category_total.max()


print("\n Summary:")

print(category_total)


print(f"\n You are spending the most on: {max_category} (Rs. {max_amount})")


# Step 7: Pie Chart (Category-wise)

plt.figure()

category_total.plot(kind='pie', autopct='%1.1f%%')

plt.title("Category-wise Expense Distribution")

plt.ylabel("")

plt.show()


# Step 8: Line Graph (Daily Spending)

plt.figure()

daily_total.plot(kind='line', marker='o')

plt.title("Daily Expense Trend")

plt.xlabel("Date")

plt.ylabel("Amount (₹)")

plt.grid()


plt.show()