0% found this document useful (0 votes)
33 views

CSC Project On Expense Tracker Application

just some source from open ai

Uploaded by

suryasanjevan016
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

CSC Project On Expense Tracker Application

just some source from open ai

Uploaded by

suryasanjevan016
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 24

ACKNOWLEDGEMENT

I would like to extend my heartfelt gratitude to everyone who contributed to the


successful completion of this project, "The Expense Tracker Application."

First and foremost, I would like to thank my teacher, Mrs Sunantha, for their
invaluable guidance, support, and constructive feedback throughout this project.
Their expertise, patience, and encouragement were instrumental in shaping this
project and overcoming various challenges. The insightful discussions and thorough
evaluations provided by Mrs Sunantha significantly contributed to the depth and
quality of this work.

I am also profoundly grateful to Zion International Public School for providing the
necessary resources and a conducive environment for carrying out this project. The
support from the faculty and access to the institution's facilities significantly
contributed to the project's successful completion.

Special thanks to my classmates and peers for their insightful discussions,


collaborative spirit, and willingness to share knowledge and resources. Their
camaraderie made the project journey enjoyable and enriching.

Lastly, I would like to thank my family and friends, who provided unwavering
support and motivation during the project. Their patience and understanding were
vital in allowing me to dedicate the necessary time and effort to this endeavor.

This project would not have been possible without the collective efforts and support
of all these individuals. I am truly grateful for their contributions and encouragement.
ABSTRACT

The Expense Tracker application is a comprehensive financial management tool


designed to help users monitor and control their personal spending habits. This
application provides a user-friendly interface that allows individuals to easily log
daily expenses, categorize them, and track their financial progress over time. With
features such as real-time expense recording, customizable categories, and detailed
analytics, users can gain valuable insights into their spending patterns.

The application supports budget setting, enabling users to establish spending limits
and receive notifications when approaching their budget thresholds. Additionally,
users can generate visual reports and charts to visualize their financial data,
promoting informed decision-making and better financial discipline. Key
functionalities include tracking recurring expenses, generating monthly summaries,
and accessing historical data for comparative analysis.

By empowering users with the tools to manage their finances effectively, the Expense
Tracker application aims to enhance financial literacy and promote responsible
spending habits. Whether for students, families, or professionals, this application
serves as an essential resource for anyone looking to achieve their financial goals and
improve their overall financial well-being. Through intuitive design and robust
functionality, the Expense Tracker is poised to become an indispensable companion
in the journey toward financial stability
REQUIREMENT ANALYSIS

1. Hardware Requirements

To run the Expense Tracker Application, the hardware requirements are minimal due
to its lightweight nature. Here are the basic hardware requirements:

Hardware Requirements
Minimum Requirements: Recommended Requirements:
Processor: Dual-core processor (e.g., Processor: Quad-core processor (e.g.,
Intel i3 or equivalent) Intel i5 or equivalent)
RAM: 4 GB RAM RAM: 8 GB RAM or higher
Storage: 500 MB of available disk space Storage: 1 GB or more of available disk
space
Display: 1366 x 768 resolution Display: 1920 x 1080 resolution or
higher
Internet Connection: Required for cloud- Internet Connection: High-speed
based features internet for optimal performance

2. Software Requirements

To ensure the effective operation of the expense tracker application, it is crucial to


outline the necessary software requirements. These requirements will support the
development process and enhance user experience. Below are the specific software
requirements needed for the application.

Operating System:
Windows: Windows 10 or later
macOS: macOS Mojave or later
Linux: Ubuntu 18.04 or later
APPLICATION

The expense tracker application serves as a valuable tool for individuals looking to
take control of their finances. By providing features that facilitate the monitoring of
income and expenditures, the application empowers users to make informed financial
decisions. Below are the key applications of the expense tracker:

1. Financial Management:
The application facilitates real-time monitoring of both income and expenses,
allowing users to keep track of their financial activities seamlessly. This ongoing
visibility helps users stay aware of their financial situation, enabling them to make
timely adjustments as needed.

2. Expense Tracking:
Users can easily record their daily expenses within the application. By categorizing
these expenses—such as groceries, transportation, and entertainment—individuals
can gain a clearer understanding of where their money is going. This organized
approach simplifies financial analysis and planning.

3. Budgeting:
The application allows users to set budgets for various spending categories, helping
them to allocate funds wisely. By establishing spending limits, users can avoid
overspending and ensure that they remain within their financial means. This feature
promotes disciplined financial behavior.

4. Insights and Reports:


With built-in analytics, the application generates insightful reports and visualizations
that help users comprehend their spending patterns over time. These insights can
reveal trends and highlight areas for improvement, guiding users toward better
financial decisions.

5. Alerts and Reminders:


The application can send timely reminders for upcoming bills or budget limits,
ensuring that users stay on track with their financial commitments. These alerts help
prevent late payments and encourage adherence to set budgets, promoting financial
responsibility.
6. Savings Goals:
Users can set specific savings goals within the application, such as saving for a
vacation or an emergency fund. By tracking progress toward these goals, individuals
are motivated to prioritize saving and make informed spending choices that align
with their financial objectives.

7. User-Friendly Interface:
Designed with the user in mind, the application features an intuitive interface that
simplifies navigation and enhances the overall user experience. This ease of use
ensures that individuals of all backgrounds can effectively utilize the application
without technical difficulties.

8. Data Security:

Recognizing the importance of financial privacy, the application incorporates robust


security features to protect user data. This ensures that sensitive financial information
is safeguarded against unauthorized access, providing users with peace of mind as
they manage their finances.
By leveraging these features, the expense tracker application serves as a
comprehensive solution for individuals seeking to improve their financial literacy
and achieve their financial goals.
EXAMPLES OF USAGE

Daily Expense Tracking:

A user starts their day by recording all their expenses, including coffee, lunch, and transportation.
By categorizing each entry (e.g., "Food," "Transport"), they can easily see where their money is
going at the end of the week, helping them identify spending habits.

Monthly Budgeting:

At the beginning of the month, a user sets a budget for various categories, such as
groceries ($300), entertainment ($150), and savings ($200). Throughout the month,
the application tracks their spending against these budgets, sending alerts if they
approach their limits, which helps them stay financially disciplined.

Goal Setting for Savings:

A user wants to save for a vacation in six months. They set a savings goal of $1,200
within the app. The application calculates that they need to save $200 each month and
tracks their progress, encouraging them to adjust their spending habits to reach their
goal by the target date.
ii) EXPLANATION

User Interface:

The front-end component of the application where users interact with various
features. It is designed for accessibility on both web and mobile platforms, ensuring a
seamless user experience across devices.

Expense Input:

This section is dedicated to the functionality that allows users to easily add and track
their daily expenses. Users can input amounts, descriptions, and dates, facilitating
accurate and timely expense management.

Expense Categories:

This feature categorizes expenses into predefined groups, such as Food, Transport,
and Entertainment. By organizing expenses, users can gain better insights into their
spending habits and make informed financial decisions.

Budgeting Module:

The budgeting module enables users to set financial limits for different categories,
helping them manage their spending effectively. Users can monitor their budget
adherence in real-time, promoting responsible financial behavior.

Reports & Insights:

This component generates visualizations and detailed reports that help users
understand their spending patterns over time. By analyzing this data, users can
identify trends and areas where they can improve their financial habits.
Notifications & Alerts:

The application sends timely reminders for upcoming bills and alerts when users are
approaching their budget limits. These notifications encourage users to stay on track
with their financial commitments and avoid overspending.

Database Layer:

The backend system that securely stores all user data, including expenses, budgets,
and user settings. This layer ensures data integrity and enables efficient retrieval and
storage of information.

Security Module:

This module implements robust security measures to protect user data and ensure
privacy. It includes features like encryption and secure authentication to safeguard
sensitive financial information.
ALGORITHM

Here’s a step-by-step algorithm outlining the key functionalities of the expense


tracker application:

1. Initialize Application
• Start the application and display the main menu.

2. User Authentication
• Prompt user for login credentials.
• If credentials are valid, proceed to the dashboard.
• If not, prompt to re-enter or create a new account.

3. Main Menu Options


• Display options:
• Add Expense
• View Expenses
• Set Budget
• View Reports
• Manage Categories
• Set Savings Goals
• Exit

4. Add Expense
• Prompt user for the amount, category, and description.
• Store the expense in the database.
• Update the total expenses and display a confirmation message.

5. View Expenses
• Retrieve all recorded expenses from the database.
• Display expenses categorized by date and type.
• Allow the user to filter by category or date range.

6. Set Budget
• Prompt user to set budgets for different categories.
• Store the budget limits in the database.
• Display a confirmation of the set budgets.
7. View Reports
• Generate visual reports (e.g., pie charts, bar graphs) of spending habits.
• Display trends over time and comparisons against budget limits.

8. Manage Categories
• Allow users to add, edit, or delete expense categories.
• Update the categories in the database.

9. Set Savings Goals


• Prompt user to set a savings goal with a target amount and deadline.
• Store the goal in the database and track progress.

10. Notifications & Alerts


• Check for budget limits and send alerts if limits are nearing.
• Notify users of upcoming bills or budget deadlines.

11. Exit Application


• Prompt the user to confirm exit.
• Save any unsaved changes and close the application.

FUNCTION DEFINITIONS

• AddExpense():
• INPUT amount, category, description
• STORE expense in the database
• UPDATE total expenses
• RETURN confirmation message

• ViewExpenses():
• RETRIEVE expenses from the database
• DISPLAY expenses

• SetBudget():
• INPUT budget limits for categories
• STORE budget in the database
• RETURN confirmation message
• ViewReports():
• GENERATE reports based on expenses
• DISPLAY visualizations

• ManageCategories():
• INPUT category actions (add/edit/delete)
• UPDATE categories in the database

• SetSavingsGoals():
• INPUT goal amount and deadline
• STORE goal in the database
• TRACK progress

This algorithm provides a structured approach to developing the expense tracker


application and can serve as a foundation for implementation.
SOURCE CODE

import datetime
import mysql
from tkcalendar import DateEntry

from tkinter import *


import tkinter.messagebox as mb
import tkinter.ttk as ttk

# Connecting to the Database


connector = sqlite3.connect("Expense Tracker.db")
cursor = connector.cursor()

connector.execute('CREATE TABLE IF NOT EXISTS ExpenseTracker (ID


INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Date DATETIME,
Payee TEXT, Description TEXT, Amount FLOAT, ModeOfPayment TEXT’)

connector.commit()

# Functions
def list_all_expenses():
global connector, table

table.delete(*table.get_children())

all_data = connector.execute('SELECT * FROM ExpenseTracker')


data = all_data.fetchall()

for values in data:


table.insert('', END, values=values)
def view_expense_details():
global table
global date, payee, desc, amnt, MoP

if not table.selection():
mb.showerror('No expense selected', 'Please select an expense from the
table to view its details')

current_selected_expense = table.item(table.focus())
values = current_selected_expense['values']

expenditure_date = datetime.date(int(values[1][:4]), int(values[1][5:7]),


int(values[1][8:]))

date.set_date(expenditure_date) ; payee.set(values[2]) ; desc.set(values[3]) ;


amnt.set(values[4]) ; MoP.set(values[5])

def clear_fields():
global desc, payee, amnt, MoP, date, table

today_date = datetime.datetime.now().date()

desc.set('') ; payee.set('') ; amnt.set(0.0) ; MoP.set('Cash'),


date.set_date(today_date)
table.selection_remove(*table.selection())

def remove_expense():
if not table.selection():
mb.showerror('No record selected!', 'Please select a record to delete!')
return
current_selected_expense = table.item(table.focus())
values_selected = current_selected_expense['values']

surety = mb.askyesno('Are you sure?', f'Are you sure that you want to delete
the record of {values_selected[2]}')

if surety:
connector.execute('DELETE FROM ExpenseTracker WHERE ID=%d'
% values_selected[0])
connector.commit()

list_all_expenses()
mb.showinfo('Record deleted successfully!', 'The record you wanted to
delete has been deleted successfully')

def remove_all_expenses():
surety = mb.askyesno('Are you sure?', 'Are you sure that you want to delete all
the expense items from the database?', icon='warning')

if surety:
table.delete(*table.get_children())

connector.execute('DELETE FROM ExpenseTracker')


connector.commit()

clear_fields()
list_all_expenses()
mb.showinfo('All Expenses deleted', 'All the expenses were successfully
deleted')
else:
mb.showinfo('Ok then', 'The task was aborted and no expense was
deleted!')
def add_another_expense():
global date, payee, desc, amnt, MoP
global connector

if not date.get() or not payee.get() or not desc.get() or not amnt.get() or not


MoP.get():
mb.showerror('Fields empty!', "Please fill all the missing fields before
pressing the add button!")
else:
connector.execute(
'INSERT INTO ExpenseTracker (Date, Payee, Description, Amount,
ModeOfPayment) VALUES (?, ?, ?, ?, ?)',
(date.get_date(), payee.get(), desc.get(), amnt.get(), MoP.get())
)
connector.commit()

clear_fields()
list_all_expenses()
mb.showinfo('Expense added', 'The expense whose details you just
entered has been added to the database')

def edit_expense():
global table

def edit_existing_expense():
global date, amnt, desc, payee, MoP
global connector, table

current_selected_expense = table.item(table.focus())
contents = current_selected_expense['values']
connector.execute('UPDATE ExpenseTracker SET Date = ?, Payee = ?,
Description = ?, Amount = ?, ModeOfPayment = ? WHERE ID = ?',
(date.get_date(), payee.get(), desc.get(), amnt.get(),
MoP.get(), contents[0]))
connector.commit()

clear_fields()
list_all_expenses()

mb.showinfo('Data edited', 'We have updated the data and stored in the
database as you wanted')
edit_btn.destroy()
return

if not table.selection():
mb.showerror('No expense selected!', 'You have not selected any
expense in the table for us to edit; please do that!')
return

view_expense_details()

edit_btn = Button(data_entry_frame, text='Edit expense', font=btn_font,


width=30,
bg=hlb_btn_bg, command=edit_existing_expense)
edit_btn.place(x=10, y=395)

def selected_expense_to_words():
global table

if not table.selection():
mb.showerror('No expense selected!', 'Please select an expense from the
table for us to read')
return
current_selected_expense = table.item(table.focus())
values = current_selected_expense['values']

message = f'Your expense can be read like: \n"You paid {values[4]} to


{values[2]} for {values[3]} on {values[1]} via {values[5]}"'

mb.showinfo('Here\'s how to read your expense', message)

def expense_to_words_before_adding():
global date, desc, amnt, payee, MoP

if not date or not desc or not amnt or not payee or not MoP:
mb.showerror('Incomplete data', 'The data is incomplete, meaning fill all
the fields first!')

message = f'Your expense can be read like: \n"You paid {amnt.get()} to


{payee.get()} for {desc.get()} on {date.get_date()} via {MoP.get()}"'

add_question = mb.askyesno('Read your record like: ', f'{message}\n\nShould I


add it to the database?')

if add_question:
add_another_expense()
else:
mb.showinfo('Ok', 'Please take your time to add this record')

# Backgrounds anf Fonts


dataentery_frame_bg = 'Red'
buttons_frame_bg = 'Tomato'
hlb_btn_bg = 'IndianRed'
lbl_font = ('Georgia', 13)
entry_font = 'Times 13 bold'
btn_font = ('Gill Sans MT', 13)

# Initializing the GUI window


root = Tk()
root.title('PythonGeeks Expense Tracker')
root.geometry('1200x550')
root.resizable(0, 0)

Label(root, text='EXPENSE TRACKER', font=('Noto Sans CJK TC', 15, 'bold'),


bg=hlb_btn_bg).pack(side=TOP, fill=X)

# StringVar and DoubleVar variables


desc = StringVar()
amnt = DoubleVar()
payee = StringVar()
MoP = StringVar(value='Cash')

# Frames
data_entry_frame = Frame(root, bg=dataentery_frame_bg)
data_entry_frame.place(x=0, y=30, relheight=0.95, relwidth=0.25)

buttons_frame = Frame(root, bg=buttons_frame_bg)


buttons_frame.place(relx=0.25, rely=0.05, relwidth=0.75, relheight=0.21)

tree_frame = Frame(root)
tree_frame.place(relx=0.25, rely=0.26, relwidth=0.75, relheight=0.74)

# Data Entry Frame


Label(data_entry_frame, text='Date (M/DD/YY) :', font=lbl_font,
bg=dataentery_frame_bg).place(x=10, y=50)
date = DateEntry(data_entry_frame, date=datetime.datetime.now().date(),
font=entry_font)
date.place(x=160, y=50)

Label(data_entry_frame, text='Payee\t :', font=lbl_font,


bg=dataentery_frame_bg).place(x=10, y=230)
Entry(data_entry_frame, font=entry_font, width=31, text=payee).place(x=10, y=260)

Label(data_entry_frame, text='Description :', font=lbl_font,


bg=dataentery_frame_bg).place(x=10, y=100)
Entry(data_entry_frame, font=entry_font, width=31, text=desc).place(x=10, y=130)

Label(data_entry_frame, text='Amount\t :', font=lbl_font,


bg=dataentery_frame_bg).place(x=10, y=180)
Entry(data_entry_frame, font=entry_font, width=14, text=amnt).place(x=160, y=180)

Label(data_entry_frame, text='Mode of Payment:', font=lbl_font,


bg=dataentery_frame_bg).place(x=10, y=310)
dd1 = OptionMenu(data_entry_frame, MoP, *['Cash', 'Cheque', 'Credit Card', 'Debit
Card', 'Paytm', 'Google Pay', 'Razorpay'])
dd1.place(x=160, y=305) ; dd1.configure(width=10, font=entry_font)

Button(data_entry_frame, text='Add expense', command=add_another_expense,


font=btn_font, width=30,
bg=hlb_btn_bg).place(x=10, y=395)
Button(data_entry_frame, text='Convert to words before adding', font=btn_font,
width=30, bg=hlb_btn_bg).place(x=10,y=450)

# Buttons' Frame
Button(buttons_frame, text='Delete Expense', font=btn_font, width=25,
bg=hlb_btn_bg, command=remove_expense).place(x=30, y=5)

Button(buttons_frame, text='Clear Fields in DataEntry Frame', font=btn_font,


width=25, bg=hlb_btn_bg,
command=clear_fields).place(x=335, y=5)

Button(buttons_frame, text='Delete All Expenses', font=btn_font, width=25,


bg=hlb_btn_bg, command=remove_all_expenses).place(x=640, y=5)

Button(buttons_frame, text='View Selected Expense\'s Details', font=btn_font,


width=25, bg=hlb_btn_bg,
command=view_expense_details).place(x=30, y=65)

Button(buttons_frame, text='Edit Selected Expense', command=edit_expense,


font=btn_font, width=25, bg=hlb_btn_bg).place(x=335,y=65)

Button(buttons_frame, text='Convert Expense to a sentence', font=btn_font,


width=25, bg=hlb_btn_bg,
command=selected_expense_to_words).place(x=640, y=65)

# Treeview Frame
table = ttk.Treeview(tree_frame, selectmode=BROWSE, columns=('ID', 'Date',
'Payee', 'Description', 'Amount', 'Mode of Payment'))

X_Scroller = Scrollbar(table, orient=HORIZONTAL, command=table.xview)


Y_Scroller = Scrollbar(table, orient=VERTICAL, command=table.yview)
X_Scroller.pack(side=BOTTOM, fill=X)
Y_Scroller.pack(side=RIGHT, fill=Y)

table.config(yscrollcommand=Y_Scroller.set, xscrollcommand=X_Scroller.set)

table.heading('ID', text='S No.', anchor=CENTER)


table.heading('Date', text='Date', anchor=CENTER)
table.heading('Payee', text='Payee', anchor=CENTER)
table.heading('Description', text='Description', anchor=CENTER)
table.heading('Amount', text='Amount', anchor=CENTER)
table.heading('Mode of Payment', text='Mode of Payment', anchor=CENTER)

table.column('#0', width=0, stretch=NO)


table.column('#1', width=50, stretch=NO)
table.column('#2', width=95, stretch=NO) # Date column
table.column('#3', width=150, stretch=NO) # Payee column
table.column('#4', width=325, stretch=NO) # Title column
table.column('#5', width=135, stretch=NO) # Amount column
table.column('#6', width=125, stretch=NO) # Mode of Payment column

table.place(relx=0, y=0, relheight=1, relwidth=1)

list_all_expenses()

# Finalizing the GUI window


root.update()
root.mainloop()
FUTURE ENHANCEMENT

Integration with Banking APIs:


Implement features that allow users to automatically sync transactions from their
bank accounts for real-time expense tracking.

Advanced Analytics:
Incorporate machine learning algorithms to provide personalized insights and
predictions about spending habits and future expenses.

Multi-Currency Support:
Add the ability to handle multiple currencies, enabling users to track expenses while
traveling or using different currencies.

Collaboration Features:
Enable users to share their expenses with family or friends for joint budgeting or
shared expenses in group activities.

Expense Receipt Scanning:


Introduce OCR (Optical Character Recognition) technology to allow users to scan
receipts and automatically input expenses.

Customizable Reports:
Allow users to generate customized reports based on specific criteria, such as date
ranges or expense categories.

Investment Tracking:
Include features to track investments and savings accounts alongside regular
expenses for a comprehensive financial overview.
Mobile Wallet Integration:
Integrate with mobile wallet services to facilitate easy payments and automatic
expense tracking from transactions.

Gamification Elements:
Add gamification features, such as rewards for meeting budgeting goals, to encourage
user engagement and motivation.

Enhanced Security Features:


Implement advanced security measures, such as biometric authentication and two-
factor authentication, to protect user data.

These enhancements can significantly improve user experience and broaden the
functionality of the expense tracker application.
BIBLIOGRAPHY

 Openai.com

 NCERT textbooks

 Class notes

You might also like