0% found this document useful (0 votes)
2 views7 pages

Project File

The Personal Expense Tracker is a command-line application developed in Python that allows users to record, view, filter, and summarize their daily expenses offline. The project aims to help students and young adults manage their finances more effectively by providing a simple, lightweight tool without the need for internet or third-party software. Future enhancements may include features like monthly budget limits, date range filtering, and a graphical user interface.
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)
2 views7 pages

Project File

The Personal Expense Tracker is a command-line application developed in Python that allows users to record, view, filter, and summarize their daily expenses offline. The project aims to help students and young adults manage their finances more effectively by providing a simple, lightweight tool without the need for internet or third-party software. Future enhancements may include features like monthly budget limits, date range filtering, and a graphical user interface.
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

BYOP — Project Report

Personal Expense Tracker

Submitted By
Your Name
Roll No: XXXXXXXX
Course: Python Programming
Institution: Your College Name
Year: 2025

1. Introduction

This project is a Personal Expense Tracker built using Python. It is a command-line application
that enables users to record, view, filter, and summarize their daily expenses without requiring
any internet connection or third-party software.
The idea emerged from a simple observation: students and young adults often lose track of their
monthly spending, leading to financial stress. While many budgeting apps exist, most are either
too complex or require account creation. This project offers a lightweight, fully offline alternative.
All data is stored locally in a CSV file, making it transparent and easy to access. The project
uses only Python's standard library, ensuring it works on any system with Python installed.

2. Implementation Details

The application is structured as a single Python file with clearly separated functions for each
feature. Below is a breakdown of the implementation:

2.1 File Structure


• expense_tracker.py — Main application file containing all logic
• [Link] — Auto-generated data file created on first run
• [Link] — Setup and usage instructions

2.2 Modules Used


• csv — For reading and writing expense data to a CSV file
• os — To check whether the data file already exists before creating it
• datetime — For handling dates and defaulting to today's date

2.3 Application Flow


• On startup, the app checks if [Link] exists; if not, it creates it with headers
• A while loop presents the main menu repeatedly until the user exits
• Each menu option calls a dedicated function (add_expense, view_expenses, etc.)
• User input is validated using try/except to prevent crashes
• All data is appended to the CSV file in real time after each entry

3. Objective

The primary objectives of this project are:


• To build a functional, real-world Python application from scratch
• To apply core Python concepts such as functions, file I/O, loops, and exception handling
• To solve a genuine everyday problem — tracking personal expenses — using
programming
• To demonstrate clean code structure, input validation, and good software practices
• To create a project that is immediately usable and easy to extend in the future

4. Methodology

The project was developed using the following step-by-step methodology:

Step 1 — Problem Identification


The problem of poor personal expense management was identified through observation of day-
to-day student life. The absence of a simple, offline tracking tool was confirmed.

Step 2 — Requirement Analysis


Key features were listed: adding expenses, viewing records, filtering by category, and
summarizing spending. Constraints were identified: no external libraries, no internet, beginner-
friendly.
Step 3 — Design
The application was designed around a menu-driven CLI interface. A function-per-feature
approach was chosen for modularity and readability.

Step 4 — Development
Code was written incrementally — starting with file initialization and the add feature, then adding
view, filter, and summary features one at a time.

Step 5 — Testing
Each feature was tested manually with valid and invalid inputs to ensure robustness. Edge
cases such as empty files, invalid amounts, and wrong date formats were handled.

Step 6 — Documentation
A README file and this project report were written to document the project clearly for
submission.

5. Hardware Requirements

This project is a lightweight software application and does not require any specialized hardware.
The minimum hardware requirements are:

Processor Any modern CPU (Intel/AMD/ARM)


RAM Minimum 512 MB (1 GB or more recommended)
Storage At least 10 MB free disk space
Display Any monitor or screen capable of showing terminal output
Input Standard keyboard for text input
OS Windows 7+, macOS 10.12+, or any Linux distribution

6. Software Requirements

The following software is required to run this project:

Programming Language Python 3.6 or higher


External Libraries None — uses Python standard library only
Modules Used csv, os, datetime
Terminal / Shell Command Prompt, PowerShell, Terminal, or Bash
Text Editor (optional) VS Code, PyCharm, Notepad++, or any editor
Version Control (optional) Git and GitHub for submission

No pip installations or virtual environments are required.

7. Project Code

Below is the complete source code for the Personal Expense Tracker:

import csv, os
from datetime import datetime

FILE_NAME = '[Link]'
CATEGORIES = ['Food','Transport','Shopping','Bills','Entertainment','Other']

def initialize_file():
if not [Link](FILE_NAME):
with open(FILE_NAME, 'w', newline='') as f:
writer = [Link](f)
[Link](['Date','Category','Amount','Description'])

def add_expense():
date_input = input('Date (YYYY-MM-DD) or Enter for today: ').strip()
if not date_input:
date_input = [Link]().strftime('%Y-%m-%d')
category = CATEGORIES[int(input('Category (1-6): '))-1]
amount = float(input('Amount: '))
description = input('Description: ').strip() or 'No description'
with open(FILE_NAME, 'a', newline='') as f:
[Link](f).writerow([date_input, category, amount, description])

def view_expenses():
with open(FILE_NAME, 'r') as f:
for row in [Link](f):
print(row['Date'], row['Category'], row['Amount'], row['Description'])

def summary():
totals = {}
with open(FILE_NAME, 'r') as f:
for row in [Link](f):
totals[row['Category']] = [Link](row['Category'],0) +
float(row['Amount'])
for cat, amt in [Link]():
print(f'{cat}: Rs.{amt:.2f}')
def main():
initialize_file()
while True:
choice = input('[Link] [Link] [Link] [Link]: ')
if choice=='1': add_expense()
elif choice=='2': view_expenses()
elif choice=='3': summary()
elif choice=='4': break

if __name__ == '__main__':
main()

The full code with comments is available in the GitHub repository linked in the README.

8. Sample Output

The following shows a sample session of the application being used to add expenses, view
records, and check the spending summary:

========================================
Personal Expense Tracker
========================================

[Link] [Link] [Link] [Link]: 1

Date (YYYY-MM-DD) or Enter for today:


Category: [Link] [Link] [Link] [Link] [Link] [Link]
Choose (1-6): 1
Amount: 150
Description: Lunch at canteen

Expense of Rs.150.00 added under 'Food'.

[Link] [Link] [Link] [Link]: 2

Date Category Amount Description


----------------------------------------------------
2025-03-25 Food Rs.150.00 Lunch at canteen
2025-03-25 Transport Rs.50.00 Auto fare
2025-03-26 Bills Rs.499.00 Mobile recharge
----------------------------------------------------
TOTAL Rs.699.00

[Link] [Link] [Link] [Link]: 3

--- Spending Summary ---


Food Rs.150.00 21.5%
Transport Rs.50.00 7.2%
Bills Rs.499.00 71.4%
-----------------------------
GRAND TOTAL Rs.699.00
9. Conclusion

The Personal Expense Tracker successfully demonstrates how Python can be used to solve a
real everyday problem with minimal complexity. The project covers a wide range of fundamental
Python concepts including file handling, functions, loops, dictionaries, exception handling, and
formatted output.
The application works entirely offline, requires no external dependencies, and produces
persistent data that survives between sessions. It is practical, purposeful, and well-structured for
a beginner-level project.
Building this project reinforced the importance of planning before coding, validating user input,
and writing readable, maintainable code. It also showed how even a simple script can have real-
world utility when it targets a genuine problem.

10. Future Scope

The current version of the application provides a solid foundation. The following enhancements
can be added in the future:
• Monthly budget limits — Set a spending cap per category and alert the user when it is
exceeded
• Date range filtering — View expenses for a specific week or month
• Export reports — Generate a .txt or .pdf summary of monthly expenses
• Data visualization — Use matplotlib to display bar charts of spending by category
• GUI interface — Build a graphical interface using tkinter for non-technical users
• Multi-currency support — Allow users to log expenses in different currencies
• Search feature — Search expenses by keyword in the description field
• Cloud sync — Optionally back up the CSV file to Google Drive or Dropbox

11. Bibliography

The following resources were referenced during the development of this project:

[1] Python Official Documentation


Python Software Foundation. Python 3 Documentation. [Link]
[2] csv Module Reference
Python Software Foundation. csv — CSV File Reading and Writing.
[Link]

[3] datetime Module Reference


Python Software Foundation. datetime — Basic date and time types.
[Link]

[4] os Module Reference


Python Software Foundation. os — Miscellaneous operating system interfaces.
[Link]

[5] Course Material


Python Programming Course — Lecture notes and exercises provided during the course.

You might also like