The link to My Finance Tracker
My Finance Tracker is a Python terminal project whose primary purpose is to keep record of one's income and expenses.
This is a personal finance tracker that allows users to add income and expenses, manage a budget, and store the data in a Google Spreadsheet for persistence across sessions. It includes input validation for date format, income and expense amounts, and description fields to ensure data accuracy.
By storing financial records in the cloud, users can access and track their budget from anywhere. The program offers a user-friendly interface with options to add income, record expenses, view the current budget, and exit.
This tool is beneficial for organizing finances, promoting better money management, and simplifying expense tracking with real-time budget updates.
- As a new user, I want to add my income with a specific date, so I can keep track of when I received money.
- As a new user, I want to record my daily expenses with descriptions and amounts, so I can see how I’m spending my money.
- As a new user, I want to view my total income and expenses, so I can quickly understand how much I’m saving or overspending.
-
As a returning user, I want to view my previous income and expenses saved in Google Sheets, so I can continue tracking my budget from where I left off.
-
As a returning user, I want to add multiple expenses efficiently without needing to restart the program, so I can easily update my spending.
-
As a returning user, I want to check my current budget regularly to compare my income with my total expenses and stay financially organized.
-
When the program is loaded:
-
Welcome Message: When the program is loaded, it greets the user with a welcome message.
-
Menu Display: The user is presented with a menu offering four options: Add Income, Add Expenses, Show Current Budget, and Exit.
-
When User Chooses "Add Income":
-
The program prompts the user to enter their income amount.
-
The user is then asked to enter the date of the income (with validation to ensure the format is YYYY-MM-DD).
-
The program confirms the income has been added and saves the entry to Google Sheets.
The user can manipulate the terminal menu with the arrow keys to choose an option and the enter key to confirm the choice.
-
When User Chooses "Add Expenses":
-
The program enters a loop, prompting the user to input multiple expenses.
-
For each expense, the user enters a description, amount, and date (with validations).
-
The program asks for confirmation of the expense details before adding it.
-
This process repeats until the user types "exit" to stop adding expenses.
-
When User Chooses "Show Current Budget":
-
The program calculates and displays the total income, total expenses, and the remaining savings (income minus expenses).
-
It shows a table of all recorded expenses, including their descriptions, amounts, and dates.
-
When User Chooses "Exit":
-
The program saves the current income and expenses to the Google Spreadsheet.
-
It displays a goodbye message and exits the program gracefully.
-
Future Features:
-
User Login and Authentication.
-
Monthly Budget Goals.
-
Expense Categories and Reporting.
-
Recurring Income and Expenses.
-
Have ability to choose currency from multiple options.
The flowchart represents the logic of the application:
- Python 3.8.5: used to anchor the project and direct all application behavior
- JavaScript: used to provide the start script needed to run the Code Institute mock terminal in the browser
- HTML used to construct the elements involved in building the mock terminal in the browser
- DateTime - Part of the Python standard library for manipulating dates and times.
- colorama A third-party library that provides cross-platform colored terminal text.
- tabulate A third-party library for printing tabular data in a readable format.
- simple_term_menu A third-party library for creating interactive terminal menus.
- Git was used for the version control of the website.
- GitHub was used to host the code of the website.
- GIMP was used to make and resize images for the README file.
- gitpod was used as the main tool to write and edit code.
- miro was used to make a flowchart for the README file.
- formatter.org was used to align code indentation.
Solved bugs
- The code would break (UnboundLocalError) everytime when the program is first run and "Show Budget" or "Exit" are selected without income being selected.
Solution: I ensured income always has a value even at the beggining of the program (0), If no income is added, income_date should keep its previous value (if it exists).
- The income variable was getting assigned as a tuple rather than a float when returning both income and income_date from the add_income function,displaying the error, TypeError: unsupported operand type(s) for -: 'tuple' and 'float'"
Solution: When calling the add_income function, I assigned income separately from income_date ensuring that only income (a floating number) is used for calculations.
if choice == 0:
income, income_date = add_income() # Returning both income and date
Unsolved bugs
- All noticed bugs were fixed.
- Please report any bugs you might see to TafadzwaMangena
- The code was tested using CI Python Linter provided by Code Institute
- I also manually tested the code confirming all functions work as intended and the google spreadsheet is updated accordingly.
Note:
- This project requires you to have Python installed on your local PC:
sudo apt install python3
- You will also need pip installed to allow the installation of modules the application uses.
sudo apt install python3-pip
Create a local copy of the GitHub repository by following one of the two processes below:- Download ZIP file:
- Go to the GitHub Repo page.
- Click the Code button and download the ZIP file containing the project.
- Extract the ZIP file to a location on your PC.
- Clone the repository:
- Open a folder on your computer with the terminal.
- Run the following command
git clone https://github.com/TafadzwaMangena/my-finance-tracker.git
- Alternatively, if using Gitpod, you can click below to create your own workspace using this repository.
- Install Python module dependencies:
- Navigate to the folder madlib_with_python by executing the command:
cd my_finance_tracker
- Run the command pip install -r requirements.txt
pip3 install -r requirements.txt
- Clone the repository:
- Open a folder on your computer with the terminal.
- Run the following command
git clone https://github.com/TafadzwaMangena/my-finance-tracker.git
- Create your own GitHub repository to host the code.
- Run the command
git remote set-url origin <Your GitHub Repo Path>
to set the remote repository location to your repository. - Push the files to your repository with the following command:
git push
- Create a Heroku account if you don't already have one here Heroku.
- Create a new Heroku application on the following page here New HerokuApp:
- Go to the Deploy tab:
- Link your GitHub account and connect the application to the repository you created.
- Go to the Settings tab:
- Click "Add buildpack":
- Add the Python and Node.js buildpacks in the following order:
- Click "Reveal Config Vars."
- Add 1 new Config Vars:
- Go back to the Deploy tab:
- Click "Deploy Branch":
- Wait for the completion of the deployment.
- Click "Open app" to launch the application inside a web page.
-
Color formatting: Colorama.
-
Terminal menu: Simple Terminal Menu.
-
The add_expense function was inspired by Tiff from Tiff In Tech youtube channel.
-
Internet Made Coder: I used one of the ideas from this youtube channel to make the flowchat and structure of my code.
-
Syntax errors and other errors where solved using some of the articles and responses from stackoverflow
-
Code Institue: tutorials were used to wire up APIs an connect to google spread sheets.
-
Code Institue: tutorials were used to format code to maintain 79 charatcers or less on one line.
-
This project was ceated using a full template provided by Code Institute.
- My wife was supportive though out the building of the website and gave me ideas.
- My Mentor has been a great help giving insightful feedback.
- Tutor support at Code Institute.
- Slack community at Code Institute.