This is a python application that allows you to create an expense tracker for your personal or professional expenses! You can convert from one currency to another and generate a report with a pie chart.
Optionally fork or close this remote repository to create a copy under your own control. Then "clone" or download the remove repository (or your forked copy) onto your local computer. Then navigate to wherever you downloaded the repo using the Terminal. For example:
cd ~/Desktop/expense-tracker
Create a virtual environment:
conda create -n expense-env python=3.8
Activate the virtual environment:
conda activate expense-env
Install package dependencies within the virtual environment:
pip install -r requirements.txt
Once you have completed the setup described, above, you can now start running the program.
Run your expense report:
python app/expense.py
Run tests:
pytest
The application should prompt the user to input details of the expenses via command-line interface (CLI). For example:
- base report currency code [e.g. USD]
note: This will serve as the currency that all your inputs are converted to
- item description
- select category option
- cost amount
- cost currency code [e.g. EUR]
note: this is the currency of your expense
- date [e.g. MMDDYYYY format]
User will be able to add or delete rows in the DataFrame within the program.
The application should compare the user's selections against the list of valid options for the various inputs to determine whether the user has selected a valid option to be included in the final expense report.
It should be able to handle various capitalizations and iterations of the valid options - especially with currency inputs (e.g., "usd", "USD" or "Usd").
If the selection is invalid, the program should display a friendly message to the user and prompt the user to try again. The program should not try to further process an invalid input as it may lead to runtime errors.
As expenses are input into the program, the details are stored in a DataFrame and a preliminary report will be generated at the end.
A pie chart will always be generated when you end the report, the chart will be displayed on your web browser.
If you prefer, you can export the report into a .csv file and it will be saved in the "data" folder within the repository folder that was initially saved on your computer. For example:
../Desktop/expense-tracker/data
You will be able to delete an existing .csv and start a new report, or continue editing the existing report when you run the program again.
Enter <BASE> currency code [e.g. USD]: USD
Enter item: Coffee
------------------------------------------------------------
Categories:
0 auto/gas
1 bill/utility
2 education
3 entertainment
4 food/drink
5 misc
6 shopping
7 travel
------------------------------------------------------------
Enter <Coffee> category no.: 4
Enter <Coffee> amount: 5.50
Enter <5.50> currency code: USD
Enter date [MMDDYYYY]: 08082022
------------------------------------------------------------
Item Cost Currency USD Category Date
0 Coffee 5.5 USD 5.5 food/drink 2022-08-08
------------------------------------------------------------
Enter [A] to add expense, [D] to delete expense, or any 'key' to end:
Item Cost Currency USD Category Date
0 Coffee 5.5 USD 5.50 food/drink 2022-08-08
1 Flight Tickets 1000.0 EUR 1020.64 travel 2022-08-09
2 Sandwich 7.8 USD 7.80 food/drink 2022-08-08
3 Amazon 250.0 USD 250.00 shopping 2022-08-10
Total NaN NaN NaN 1283.94 NaN NaT