A command-line budget tracking application that helps users manage their expenses and monitor their budget.
This project implements a simple budget tracking system that allows users to add expenses, view their budget details, and track their remaining balance. It's an excellent example of basic financial management principles and data persistence using JSON files.
- Add expenses with descriptions and amounts
- Track total spending and remaining budget
- Persistent data storage using JSON
- Simple command-line interface
- Budget details display with expense breakdown
-
Clone the repository:
git clone https://github.com/fahadelahikhan/SmartBudget-Tracker.git cd SmartBudget-Tracker -
Run the application:
python main.py
# Initialize budget and expenses
initial_budget = 1000.0
expenses = []
# Add an expense
add_expense(expenses, "Groceries", 150.0)
# Calculate remaining budget
remaining = get_balance(initial_budget, expenses)
print(f"Remaining budget: {remaining}") # Output: Remaining budget: 850.0
# Display all budget details
show_budget_details(initial_budget, expenses)# Load existing budget data
initial_budget, expenses = load_budget_data('budget_data.json')
# Add multiple expenses
add_expense(expenses, "Rent", 500.0)
add_expense(expenses, "Utilities", 100.0)
add_expense(expenses, "Dining", 75.0)
# Calculate and display remaining budget
remaining = get_balance(initial_budget, expenses)
print(f"Remaining budget after expenses: {remaining}")
# Save updated budget data
save_budget_details('budget_data.json', initial_budget, expenses)The budget tracker works by:
- Loading existing budget data from a JSON file
- Allowing users to add expenses with descriptions and amounts
- Calculating total expenses and remaining budget
- Displaying budget details including all expenses
- Saving updated budget data back to the JSON file
The application uses simple arithmetic operations to track expenses and calculate remaining budget:
remaining_budget = initial_budget - sum_of_all_expenses
Distributed under the MIT License. See LICENSE for details.
Note: This implementation is for educational and personal finance management purposes. For more complex financial tracking needs, consider using established accounting software with robust security and backup features.