Expense Tracker
Expense Tracker is a command-line application developed in Python as part of a team assignment for a Python Fundamentals course. It allows users to record, view, filter, calculate, and delete daily expenses.
The project was designed to practice function-based programming, input validation, file handling, sorting, and filtering without depending on external libraries.
How the Application Stores Expenses
The application uses a structured text file namedexpenses.txt as its data store. The file is created automatically when the first expense is added.
This approach keeps the project simple and makes the stored records easy to inspect while practicing file reading and writing. The main Python script contains the application functions and the command-line interaction.
Recording and Managing Expenses
When adding an expense, the user provides a date, amount, category, and description. Dates use the dd/mm/yyyy format, and amounts must be positive numbers with up to two decimal places.
Users can list all expenses, view the total amount spent, view totals by category, and delete an expense by its ID. When all expenses are listed, the records are sorted by date and ID so that the output is consistent and easier to read.
Filtering Expenses
The application supports filtering expenses by date and by category. This allows a user to focus on one day or one type of spending instead of reading the complete expense list.
The filtering functions read the stored records, compare them with the user's input, and display the matching expenses in a structured format. This was also the main part of the project that I implemented.
My Contribution
I worked as a team member on this project. My responsibilities were implementing the feature to list expenses by date, implementing the feature to list expenses by category, and contributing to the README documentation.
For the date and category features, I focused on accepting the relevant user input, finding the matching records, and presenting the results clearly. The README documents how to install and run the project, what the application supports, and how the repository is organized.
Team-Based Development
Different team members worked on different parts of the application, including adding expenses, listing all records, calculating totals, and implementing the filtering features. Working this way gave me practice contributing to an existing codebase while keeping my changes focused on specific responsibilities.
What I Practiced
- Organizing a small program into functions.
- Validating user input.
- Reading and writing structured text files.
- Sorting and filtering records.
- Working with dates and regular expressions.
- Documenting a project for other users.
- Collaborating on a shared Python project.
Technology
Python 3, the re module, file handling, and datetime.