adrian-em / lifestyle-cost-designer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lifestyle Cost Calculator

The Lifestyle Cost Calculator is a financial tool designed to help users understand the gross total income needed to afford their desired lifestyle, taking into account their current financial situation and goals. It factors in various expenses, tax rates, and savings rates to provide a comprehensive view of the required income.

Financial Principle

The core financial principle behind this calculator is aimed at empowering users to bridge the gap between their current financial status and their lifestyle goals. This involves:

  1. Calculating Total Monthly Expenses: Aggregating all individual lifestyle expenses to understand monthly outgoings.
  2. Determining Required Gross Income: Estimating the amount one needs to earn before taxes and savings to maintain the desired lifestyle.
  3. Assessing Additional Income Needed: Identifying the shortfall between current income and the lifestyle-affordable income.
  4. Evaluating Percentage Increase Needed: Calculating how much the current income should increase to meet lifestyle expectations.

These calculations assist in setting realistic financial goals and planning effectively for the future.

Current Functionality

API Endpoints

  • GET /expenses/: Retrieve a list of all recorded expenses.
  • POST /expenses/: Add a new expense record.
  • DELETE /expenses/{expense_id}: Delete an expense based on its ID.
  • GET /settings/: Fetch current user settings like tax rate, savings rate, and more.
  • POST /settings/: Update user settings.
  • GET /required_income/: Calculate and fetch the required monthly income based on current expenses and settings.

CLI Commands

  • list_expenses: Lists all expenses.
  • add_expense [category] [amount] [frequency]: Adds a new expense entry.
  • delete_expense [expense_id]: Removes an expense entry by ID.
  • get_settings: Displays the current user settings.
  • update_settings [tax_rate] [savings_rate] [current_income] [current_expenses]: Modifies user settings.
  • calculate_required_monthly_income: Calculates the necessary monthly income to afford the desired lifestyle.

Installation

pip install -r requirements.txt

Usage

First, initialize the database.

python init_db.py You can either use it via API or with CLI.

python cli.py --help

Examples

Listing expenses

list-expenses

Updating settings

update-settings

Calculating required income

calculate-required-income

Plotting required income by expense

plot-required-income

About

License:Apache License 2.0


Languages

Language:Python 100.0%