0% found this document useful (0 votes)
35 views20 pages

Project Ip

Uploaded by

bestgamer9201
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views20 pages

Project Ip

Uploaded by

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

SPRINGDALES SCHOOL

INFORMATICS PRACTICES (065)


PROJECT FILE
PERSONAL FINANCE MANAGER

NAME – HIMANSHU BHATIA


CLASS - XII-E
ROLL NUMBER-
INDEX
Serial Number Title
1 Acknowledgement
2 Certificate
3 Introduction
4 CSV File
5 Source Code
6 Output
7 Conclusion
8 Bibliography
ACKNOWLEDGEMENT

I selected this project as a part of my studies, titled “Personal


Finance Manager”. It would be my utmost pleasure to express
my sincere thanks to Ms. Pooja Kumar Makol in providing a
helping hand in this project. Her valuable guidance, support
and supervision helped me tremendously in the completion
of this project.

Project by – Himanshu Bhatia


CERTIFICATE
This is to certify Himanshu Bhatia, a student of class XII-E of
Springdales School, Session 2024-25, has satisfactorily
completed the required Informatics Practices Project Work on
the topic - “Personal Finance Manager” as per the syllabus of
Grade XII.

Teacher’s Signature
INTRODUCTION
Designed to help the users manage their Personal
Finance, this is a complete tool for managing their
personal finances. It covers them with a gathering of
highlights that will guide you to follow your income and
expenses in a kempt and easy to use manner. This
program then provides the users with an understanding
of their total expenses and savings on an easy to read
basis for them to gauge their own financial health.
Furthermore, detailed category by category breakdown is
available to assist you identify the spending pattern and
take informed financial decisions. Users can also see their
financial data via several types of graph, such as line
graphs, bar charts, and histograms to give themselves a
better look into it. With the tool users can continue
adding new expense or savings records to their financial
data with real time updates. The Personal Finance
Manager is designed so that anyone can use its
interactive menu and easy to use design to accurately
monitor there finances. Moreover, this project is a good
example for learning programming problems, such as
data visualization and processing.
CSV FILE
SOURCE CODE
import pandas as pd
import matplotlib.pyplot as plt

data = 'C:/Users/himan/OneDrive/Desktop/personal_finance_data.csv'
df = pd.read_csv(data)

def save_data():
'Save the updated DataFrame back to the CSV file.'
df.to_csv(data, index=False)

def add_expense():
'Allow the user to add a new expense or savings entry.'
print('=' * 50)
print('Add New Expense/Savings')
print('=' * 50)
try:
date = input('Enter the date (YYYY-MM-DD): ')
category = input('Enter the category: ')
amount = float(input('Enter the amount: '))
type_ = input('Enter the type (Expense/Savings): ').capitalize()
payment_method = input('Enter the payment method: ')

if type_ not in ['Expense', 'Savings']:


print('Invalid input! Please enter correct details.')
return

new_record = {
'Date': date, 'Category': category, 'Amount': amount, 'Type': type_,
'Payment Method': payment_method
}
global df
df = df._append(new_record, ignore_index=True)
save_data()
print('New record added successfully!')
except ValueError:
print('Invalid input! Please try again.')

def update_record():
'Update an existing record in the DataFrame.'
print('=' * 50)
print('Update Existing Record')
print('=' * 50)
print('Here are the current records:')
print(df.reset_index()) # Display records with an index
try:
row_index = int(input('Enter the index of the record you want to update: '))
if row_index < 0 or row_index >= len(df):
print('Invalid index! Please try again.')
return

print('Leave a field blank if you do not want to change it.')


date = input(f"Enter new date (current: {df.loc[row_index, 'Date']}): ")
category = input(f"Enter new category (current: {df.loc[row_index,
'Category']}): ")
amount = input(f"Enter new amount (current: {df.loc[row_index, 'Amount']}):
")
type_ = input(f"Enter new type (current: {df.loc[row_index, 'Type']}): ")
payment_method = input(f"Enter new payment method (current:
{df.loc[row_index, 'Payment Method']}): ")

df.loc[row_index, 'Date'] = date


df.loc[row_index, 'Category'] = category
if amount:
df.loc[row_index, 'Amount'] = float(amount)
df.loc[row_index, 'Type'] = type_
df.loc[row_index, 'Payment Method'] = payment_method

save_data()
print('Record updated successfully!')
except ValueError:
print('Invalid input! Please try again.')
def overview():
total_expenses = df[df['Type'] == 'Expense']['Amount'].sum()
total_savings = df[df['Type'] == 'Savings']['Amount'].sum()
print('=' * 50)
print('Total balance of expenses and savings.')
print('=' * 50)
print(f'Total Expenses: ₹{total_expenses}')
print(f'Total Savings: ₹{total_savings}')
print('=' * 50)

def category_totals():
category_summary = df.groupby('Category')['Amount'].sum()
print('=' * 50)
print('Total Amount for Each Category')
print('=' * 50)
print(category_summary)
category_summary.plot(kind='bar', figsize=(10, 6), color='skyblue')
plt.title('Total Amount for Each Category')
plt.ylabel('Total Amount (₹)')
plt.xlabel('Category')
plt.xticks(rotation=45)
plt.tight_layout()
plt.show()

def expense_trends():
expense_trend = df[df['Type'] == 'Expense'].groupby('Date')['Amount'].sum()
expense_trend.plot(kind='line', marker='o', figsize=(10, 6), color='red')
plt.title('Daily Expense Trends')
plt.ylabel('Total Expenses (₹)')
plt.xlabel('Date')
plt.grid(True)
plt.tight_layout()
plt.show()

def plot_category_graph():
'Plot and view a graph for a selected category.'
print('=' * 50)
print('Plot Graph for a Category')
print('=' * 50)
category = input('Enter the category: ')

if category not in df['Category'].unique():


print('Invalid category! Please try again.')
return

print('Choose the type of graph:')


print('1. Line Graph')
print('2. Bar Chart')
print('3. Histogram')
graph_choice = input('Enter your choice (1-3): ')

category_data = df[df['Category'] == category]

if graph_choice == '1':
category_data.groupby('Date')['Amount'].sum().plot(kind='line', marker='o',
figsize=(10, 6), color='blue')
plt.title(f'Line Graph for {category}')
plt.ylabel('Amount (₹)')
plt.xlabel('Date')
plt.grid(True)
plt.tight_layout()
plt.show()

elif graph_choice == '2':


category_data.groupby('Date')['Amount'].sum().plot(kind='bar', figsize=(10, 6),
color='green')
plt.title(f'Bar Chart for {category}')
plt.ylabel('Amount (₹)')
plt.xlabel('Date')
plt.xticks(rotation=45)
plt.tight_layout()
plt.show()
elif graph_choice == '3':
category_data['Amount'].plot(kind='hist', bins=10, figsize=(10, 6),
color='purple')
plt.title(f'Histogram of Amounts for {category}')
plt.xlabel('Amount (₹)')
plt.ylabel('Frequency')
plt.tight_layout()
plt.show()

else:
print('Invalid choice! Please try again.')

def payment_methods():
'Display payment methods summary based on user selection.'
print('=' * 50)
print('Payment Methods Summary')
print('=' * 50)
print('1. Total Payment Method')
print('2. Category-wise Payment Method')
choice = input('Enter your choice (1 or 2): ')

if choice == '1':
# Payment Method Total
payment_summary = df.groupby('Payment Method')['Amount'].sum()
print('=' * 50)
print('Total Payment Method Summary')
print('=' * 50)
print(payment_summary)
payment_summary.plot(kind='bar', figsize=(10, 6), color='orange')
plt.title('Total Payment Methods Summary')
plt.ylabel('Total Amount (₹)')
plt.xlabel('Payment Method')
plt.xticks(rotation=45)
plt.tight_layout()
plt.show()
elif choice == '2':
# Payment Method Category-wise
payment_category_summary = df.groupby(['Category', 'Payment Method'])
['Amount'].sum().unstack().fillna(0)
print('=' * 50)
print('Category-wise Payment Method Summary')
print('=' * 50)
print(payment_category_summary)
payment_category_summary.plot(kind='bar', figsize=(12, 8), stacked=True)
plt.title('Category-wise Payment Methods Summary')
plt.ylabel('Total Amount (₹)')
plt.xlabel('Category')
plt.xticks(rotation=45)
plt.legend(title='Payment Method')
plt.tight_layout()
plt.show()

else:
print('Invalid choice! Please try again.')

while True:
print('\n' + '=' * 50)
print('Personal Finance Manager')
print('=' * 50)
print('1. Add New Expense/Savings')
print('2. To View/Update Record')
print('3. View Overview')
print('4. View Total Amounts by Category')
print('5. View Expense Trends')
print('6. Plot Graph for a Category')
print('7. View Payment Methods Summary')
print('8. Exit')
choice = input('Enter your choice (1-8): ')

if choice == '1':
add_expense()
elif choice == '2':
update_record()
elif choice == '3':
overview()
elif choice == '4':
category_totals()
elif choice == '5':
expense_trends()
elif choice == '6':
plot_category_graph()
elif choice == '7':
payment_methods()
elif choice == '8':
print('Thank you for using the Personal Finance Manager!')
break
else:
print('Invalid choice. Please try again.')

OUTPUT
1. Addition Of Records:
2. Display/Updation of Record:-
3. Display Overview of the Balance:

4. Display Total amount of each Category


5. Display the Trend of our Expenses

6. To Plot Graph for any Category


a) Line Graph
b) Bar Chart

c) Histogram
7. To Display the Summary of Methods of Payment
a) Total Payment by each Method

b) Category-wise Total Payment by each Method


CONCLUSION
The Personal Finance Manager is a powerful yet friendly
tool to tame the mess of personal finance. It has bells
and whistles like expense tracking, savings analysis by
categories, analysis of your data by categories, and
customizable data visualizations that give users insight
into their financial habits to make more informed
decisions. The ability to add new records and keep real
time updates makes the ability to keep financial data
accurate and organized. Beyond that, the tool helps users
gain budgeting and financial responsibility knowledge,
putting their financial goals within reach. As a project it
shows how effective it can be in displaying programming
skills like data analysis, visualization or real time
processing for example, making it a very educational and
real life practice activity.
BIBLIOGRAPHY
1. NCERT Informatics Practices Textbook
Class XI & XII
2. www.geeksforgeeks.org
3. www.w3schools.com
4.Informatics Practices Textbook for Class XII
by Sumita Arora

You might also like