Amazing-Python-Scripts
Personal Finance Manager
The Personal Finance Manager is a Python script that helps users manage their personal finances by tracking expenses, setting budgets, and generating spending reports. The script utilizes the Pandas library for data handling and Matplotlib for data visualization.
Features
-
Track Expenses: Allows users to add expenses with details such as date, description, amount, and category.
-
View Expenses: Displays a table of all tracked expenses.
-
Generate Spending Report: Presents a pie chart visualization of spending based on expense descriptions.
-
Set Budget: Enables users to set their monthly budget.
-
Reset Monthly Budget and Expenses: Resets the budget and expenses at the beginning of each month.
-
Check Remaining Budget: Displays the remaining budget after deducting total expenses from the set budget.
-
Visualize Expense Distribution: Shows a bar chart of the total expenses per expense category.
How to Use
-
Ensure you have Python installed on your machine.
-
Install required libraries using pip:
pip install pandas matplotlib
- Run the personal_finance_manager.py script:
python personal_finance_manager.py
- The script will display the main menu. Here's an example of how you can use the different features of the Personal Finance Manager:
Personal Finance Manager Menu:1. Track Expenses2. View Expenses3. Generate Spending Report4. Set Budget5. Reset Monthly Budget and Expenses6. Check Remaining Budget7. Visualize Expense Distribution8. Exit
Enter your choice (1-8):
- Choose option 4 to set your monthly budget:
Enter your choice (1-8): 4Enter your budget amount: 1000Budget set successfully!
- Choose option 1 to track expenses:
Enter your choice (1-8): 1Enter the date (YYYY-MM-DD): 2023-07-15Enter the expense description: GroceriesEnter the expense amount: 50.00Enter the expense category: FoodExpense added successfully!
Enter your choice (1-8): 1Enter the date (YYYY-MM-DD): 2023-07-16Enter the expense description: Movie ticketEnter the expense amount: 20.00Enter the expense category: EntertainmentExpense added successfully!
Enter your choice (1-8): 1Enter the date (YYYY-MM-DD): 2023-07-18Enter the expense description: GasolineEnter the expense amount: 40.00Enter the expense category: TransportationExpense added successfully!
- View the recorded expenses:
Enter your choice (1-8): 2 Date Description Amount Category0 2023-07-15 Groceries 50.0 Food1 2023-07-16 Movie ticket 20.0 Entertainment2 2023-07-18 Gasoline 40.0 Transportation
- Generate a spending report:
Enter your choice (1-8): 3Total Spending: $ 110.0
A pie chart will be displayed showing the spending distribution across different expense descriptions.
- Check the remaining budget:
Enter your choice (1-8): 6Remaining Budget: $ 890.0
- Visualize expense distribution by category:
Enter your choice (1-8): 7
A bar chart will be displayed showing the total expenses for each expense category.
- You can continue using other options or choose option 8 to exit the Personal Finance Manager.
- The script stores expenses in the expenses.csv file and the budget in budget.txt file in the same directory as the script.
Contributing
Contributions to the Personal Finance Manager script are welcome! If you have any suggestions, bug reports, or feature requests, please feel free to open an issue or submit a pull request.