0% found this document useful (0 votes)
14 views19 pages

Ip Project 2024-25

Uploaded by

sgs.heer.06jan.8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views19 pages

Ip Project 2024-25

Uploaded by

sgs.heer.06jan.8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

TABLE OF CONTENTS

S.No. Topic Page No.

1 INTRODUCTION 5

2 ABOUT PYTHON 6

3 OBJECTIVE 7

4 METHODOLOGY USED 8

5 SYSTEM REQUIRED 9

6 PRE-REQUISITES 10

7 SOURCE CODE 11 – 15

8 OUTPUT 16 – 18

9 FUTURE EXTENTION 19

10 CONCLUSION 20

11 BIBLIOGRAPHY 21

12 TEAM MEMBERS 22
INTRODUCTION
My project name is TRACK MY EXPENSE. It is a digital tool designed to
help individuals and businesses monitor, manage, and analyze their
financial transactions. It simplifies the process of recording income and
expenditures, offering users better visibility and control over their
finances. Whether you're trying to budget effectively, save money, or
analyze spending habits, an expense tracker app can be a powerful
solution.

Benefits:

• Encourages mindful spending and helps users identify unnecessary


expenses.
• Simplifies financial goal setting, such as saving for a big purchase or
paying off debt.

• Reduces the hassle of manually organizing finances, saving time and


effort.

• Facilitates collaboration for family or team budgets.

Whether you are a student, professional, or small business owner, an


expense tracker app can be a valuable tool for achieving financial
stability and reaching your financial goals.
ABOUT PYTHON
Python was created by Guido Van Rossum in 1991 and further
developed by Python Software Foundation. Python is considered a
better option because of the increased productivity it provides. Since
there is no compilation step, the edit-test-debug cycle is incredibly fast.
Debugging Python programs is easy: a bug or bad input will never cause
a segmentation fault. Instead, when the interpreter discovers an error,
it raises an exception. When the program doesn't catch the exception,
the interpreter prints a stack trace. A source level debugger allows
inspection of local and global variables, evaluation of arbitrary
expressions, setting breakpoints, stepping through the code a line at a
time, and so on. The debugger is written in Python itself, testifying to
Python's introspective power. On the other hand, often the quickest
way to debug a program is to add a few print statements to the source:
the fast edit- test-debug cycle makes this simple approach very
effective.

Python is an interpreted, object-oriented, high-level programming


language with dynamic semantics. Its high-level built in data structures,
combined with dynamic typing and dynamic binding, make it very
attractive for Rapid Application Development, as well as for use as a
scripting or glue language to connect existing components together.
Python's simple, easy to learn syntax emphasizes readability and
therefore reduces the cost of program maintenance. Python supports
modules and packages, which encourages program modularity and
code reuse. The Python interpreter and the extensive standard library
are available in source or binary form without charge for all major
platforms, and can be freely distributed.
OBJECTIVE
The primary objective of an expense tracker app is to help users
manage their personal or business finances effectively by providing
tools to monitor, analyze, and control their expenses. Here are the
key objectives:
1. Financial Awareness:
• Provide a clear overview of income, expenses, and savings.
• Highlight spending patterns and trends to improve financial habits.
2. Budget Management:
• Allow users to set and track budgets for specific categories (e.g.,
groceries, entertainment, rent).
3. Expense Categorization:
• Organize expenses into customizable categories for easier tracking
and analysis.
• Provide insights on where the majority of money is being spent.
4. Savings and Goal Setting:
• Encourage users to save money by setting financial goals (e.g.,
travel, emergency funds).
• Track progress toward these goals.
5. Data Visualization:
• Offer charts, graphs, and reports for a visual representation of
financial data.
• Help users make data-driven financial decisions.

By fulfilling these objectives, an expense tracker app helps users


achieve better financial discipline and long-term financial stability.
METHODOLOGY USED
1. Python Libraries:

• argparse: To handle command-line arguments for specifying the CSV


file path.
• pandas: For data manipulation and management, allowing the app to
read, store, and process expense data in a structured format.
• tkinter: For creating a graphical user interface (GUI) for interacting
with users.
• matplotlib: For visualizing expense data as a pie chart.

2. Object-Oriented Design:
• The ExpenseTrackerApp class encapsulates the logic for the expense
tracker, ensuring modularity, reusability, and maintainability.

3. File-Based Storage:
• Data is stored in a CSV file (expenses.csv) to ensure persistence across
sessions.

4. User Interaction:
• GUI components (e.g., entry fields, buttons) are used to input and
display data.
• Validation checks are implemented for user inputs (e.g., numeric
validation for amount).
SYSTEM REQUIRED
1. Hardware:

Processor: 1 GHz or faster

RAM: 2 GB or more

Disk Space: 100 MB for the application and CSV file storage

2. Software:

Operating System: Windows/Linux/macOS

Python 3.x installed with the following packages:

• pandas

• tkinter (usually pre-installed with Python)

• matplotlib
PRE-REQUISITES
The major topics that must be refreshed before creating and building
the TRACK MY EXPENSE Python project are as follows:

1. Basic Python Programming:

• Understanding of functions, classes, and error handling.

• Familiarity with libraries like pandas and matplotlib.

2. Working with CSV Files:

• Knowledge of CSV data formats and their use for storing structured
data.

3. Tkinter GUI Development:

• Understanding the basics of tkinter for building user-friendly


interfaces.

4. Data Visualization:

• Using matplotlib to create simple visualizations like pie charts.


SOURCE CODE
import argparse
import pandas as pd
import tkinter as tk
from tkinter import PhotoImage, messagebox
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg

def parse_args():
parser = argparse.ArgumentParser(description='TRACK MY EXPENSE')
parser.add_argument('-f', '--file', type=str, default='expenses.csv',
help='CSV file to load expenses from')
return parser.parse_args()

class ExpenseTrackerApp:
def init (self, root, file_name):
self.root = root
self.root.title("TRACK MY EXPENSE")
self.root.geometry('425x700')

# Load background image (replace with your image path)


img_path = PhotoImage(file='C:\\Program Files\\Python312\\ip
project\\bg.png')
bg_img = tk.Label(root, image=img_path)
bg_img.place(relx=0,rely=0,relheight=1, relwidth=1)
bg_img.image=img_path

self.file_name = file_name
self.df = self.load_data()
self.create_widgets()
def load_data(self):
try:
df = pd.read_csv(self.file_name)
except FileNotFoundError:
messagebox.showerror("File Not Found", f"The file '{self.file_name}'
was not found.")
df = pd.DataFrame(columns=["Date", "Category", "Amount"])
return df

def save_data(self):
self.df.to_csv(self.file_name, index=False)

def create_widgets(self):
# Title
title_label = tk.Label(self.root, text="WELCOME TO TRACK MY
EXPENSE !", font=("Georgia", 18), bg='lightblue', fg='black')
title_label.grid(row=0, column=0, columnspan=2, pady=20)

# Expense Form (Category, Amount, Date)


category_label = tk.Label(self.root, text="Category:", bg='lightblue',
fg='black',font=("Georgia", 16,'bold'))
category_label.grid(row=1, column=0, padx=10, pady=5)

self.category_entry = tk.Entry(self.root)
self.category_entry.grid(row=1, column=1, padx=10, pady=5)

amount_label = tk.Label(self.root, text="Amount:", bg='lightblue',


fg='black',font=("Georgia", 16,'bold'))
amount_label.grid(row=2, column=0, padx=10, pady=5)

self.amount_entry = tk.Entry(self.root)
self.amount_entry.grid(row=2, column=1, padx=10, pady=5)
date_label = tk.Label(self.root, text="Date (YYYY-MM-DD):",
bg='lightblue', fg='black',font=("Georgia", 16,'bold'))
date_label.grid(row=3, column=0, padx=10, pady=5)

self.date_entry = tk.Entry(self.root)
self.date_entry.grid(row=3, column=1, padx=10, pady=5)

# Add Expense Button


add_button = tk.Button(self.root, text="Add Expense",
command=self.add_expense)
add_button.config(font=('Ink
Free',16,'bold'),bg='black',fg='white',activebackground='grey',activeforegro
und='white')
add_button.grid(row=4, column=0, columnspan=2, pady=10)

# Display Summary Button


summary_button = tk.Button(self.root, text="View Expense
Summary", command=self.view_summary)
summary_button.config(font=('Ink
Free',16,'bold'),bg='black',fg='white',activebackground='grey',activeforegro
und='white')
summary_button.grid(row=5, column=0, columnspan=2, pady=10)

# Plot Expense Graph Button


plot_button = tk.Button(self.root, text="Plot Expense Graph",
command=self.plot_graph)
plot_button.config(font=('Ink
Free',16,'bold'),bg='black',fg='white',activebackground='grey',activeforegro
und='white')
plot_button.grid(row=6, column=0, columnspan=2, pady=10)

def add_expense(self):
category = self.category_entry.get()
try:
amount = float(self.amount_entry.get())
except ValueError:
messagebox.showerror("Input Error", "Please enter a valid
amount")
return
date = self.date_entry.get()

if category and amount > 0 and date:


new_expense = pd.DataFrame([[date, category, amount]],
columns=["Date", "Category", "Amount"])
self.df = pd.concat([self.df, new_expense], ignore_index=True)
self.save_data()
messagebox.showinfo("Expense Added", "Expense has been added
successfully.")
self.clear_form()
else:
messagebox.showerror("Input Error", "Please fill all fields
correctly.")

def clear_form(self):
self.category_entry.delete(0, tk.END)
self.amount_entry.delete(0, tk.END)
self.date_entry.delete(0, tk.END)

def view_summary(self):
summary_window = tk.Toplevel(self.root)
summary_window.title("Expense Summary")

summary_label = tk.Label(summary_window, text="Expense


Summary", font=("Helvetica", 14))
summary_label.pack(pady=10)
summary_text = tk.Text(summary_window, width=50, height=10)
summary_text.pack(padx=10, pady=10)

summary = self.df.groupby('Category').agg({'Amount':
'sum'}).reset_index()
summary_text.insert(tk.END, summary.to_string(index=False))

def plot_graph(self):
categories = self.df.groupby('Category')['Amount'].sum()

if categories.empty:
messagebox.showerror("No Data", "No expense data available to
plot.")
return

fig, ax = plt.subplots(figsize=(3,3))
ax.pie(categories, labels=categories.index, autopct='%1.1f%%',
startangle=90)
ax.axis('equal')

canvas = FigureCanvasTkAgg(fig, master=self.root)


canvas.get_tk_widget().grid(row=7, column=0, columnspan=2,
pady=10)
canvas.draw()

if name == " main ":


args = parse_args()
root = tk.Tk()
root.resizable(False,False)
app = ExpenseTrackerApp(root, args.file)
root.mainloop()
OUTPUT

INSERTING EXPENSE
START RUNNING
DATA IN ENTRY
THE PROGRAM:-
FIELDS:-
PRESSING ADD PRESSING VIEW
EXPENSE BUTTON:- EXPENSE SUMMARY
BUTTON:-
PRESSING PLOT
EXPENSE GRAPH
BUTTON:-
FUTURE EXTENSIONS

1. Multi-Device Synchronization:
Implementing cloud storage for accessing expense data across multiple
devices.

2. Enhanced Visualization:
Adding bar charts, line graphs, or monthly trends for detailed financial
analysis.

3. Mobile App Integration:


Creating mobile versions of the app using frameworks like Kivy or Flutter.

4. Expense Predictions:
Incorporating machine learning to predict future expenses based on past
data.

5. User Authentication:
Adding login/logout functionality to secure individual user data.

6. Automated Data Input:


Integrating APIs for bank account synchronization or OCR for scanning
receipts.
CONCLUSION
This expense tracker app is a practical tool for managing finances. It
provides users with an intuitive interface to log, summarize, and visualize
their expenses. The use of Python libraries ensures flexibility, scalability,
and ease of use. While the current version is effective for personal use,
future enhancements such as cloud support, advanced analytics, and
mobile compatibility can expand its usability to a broader audience.
BIBLIOGRAPHY
Website:
https://www.youtube.com

https://www.gemini.com

https://www.google.com

https://www.chatgpt.com
TEAM MEMBERS
AAKHYA
HEER LALWNI

You might also like