debt_optimizer.core.financial_calc module
- class debt_optimizer.core.financial_calc.PaymentFrequency(value)[source]
Bases:
EnumSupported payment frequencies.
- ONCE = 'once'
- DAILY = 'daily'
- WEEKLY = 'weekly'
- BI_WEEKLY = 'bi-weekly'
- SEMI_MONTHLY = 'semi-monthly'
- MONTHLY = 'monthly'
- QUARTERLY = 'quarterly'
- SEMI_ANNUALLY = 'semi-annually'
- ANNUALLY = 'annually'
- class debt_optimizer.core.financial_calc.RecurrencePattern(frequency, start_date, end_date=None)[source]
Bases:
objectHandles calculation and generation of recurring date patterns.
Supports all common recurrence frequencies including daily, weekly, bi-weekly, monthly, quarterly, semi-annually, and annually.
- get_dates(range_start, range_end)[source]
Generate all occurrence dates within the given date range.
- class debt_optimizer.core.financial_calc.Debt(name, balance, minimum_payment, interest_rate, due_date)[source]
Bases:
objectRepresents a debt with payment terms and current balance.
- calculate_principal_payment(total_payment, balance)[source]
Calculate principal portion of a payment.
- class debt_optimizer.core.financial_calc.Income(source, amount, frequency, start_date)[source]
Bases:
objectRepresents an income source with frequency and timing.
- class debt_optimizer.core.financial_calc.RecurringExpense(description, amount, frequency, due_date, start_date)[source]
Bases:
objectRepresents a recurring expense like subscriptions, fees, etc.
- class debt_optimizer.core.financial_calc.FutureIncome(description, amount, start_date, frequency=None, end_date=None, date=None)[source]
Bases:
objectRepresents future income events - both one-time and recurring.
Can handle both one-time income events (bonuses, tax refunds) and recurring income patterns (raises, new income streams).
- Parameters:
- get_occurrences(range_start, range_end)[source]
Get all income occurrences within the specified date range.
- get_total_amount_in_range(range_start, range_end)[source]
Calculate total income amount within the specified date range.
- class debt_optimizer.core.financial_calc.FutureExpense(description, amount, start_date, frequency=None, end_date=None, date=None)[source]
Bases:
objectRepresents future expense events - both one-time and recurring.
Can handle both one-time expense events (major purchases, repairs) and recurring expense patterns (new subscriptions, insurance increases).
- Parameters:
- get_occurrences(range_start, range_end)[source]
Get all expense occurrences within the specified date range.
- get_total_amount_in_range(range_start, range_end)[source]
Calculate total expense amount within the specified date range.
- debt_optimizer.core.financial_calc.calculate_monthly_payment(principal, annual_rate, months)[source]
Calculate monthly payment for a loan with fixed terms.
- debt_optimizer.core.financial_calc.calculate_total_monthly_income(income_sources)[source]
Calculate total monthly income from all sources.
- debt_optimizer.core.financial_calc.generate_amortization_schedule(debt, payment_amount, start_date)[source]
Generate detailed amortization schedule for a debt.
- class debt_optimizer.core.financial_calc.DebtAnalyzer[source]
Bases:
objectUtility class for analyzing debt scenarios.
- static calculate_total_minimum_payments(debts)[source]
Calculate total minimum payments across all debts.
- static calculate_weighted_average_rate(debts)[source]
Calculate weighted average interest rate across all debts.
- static rank_debts_by_avalanche(debts)[source]
Rank debts by interest rate (highest first) for avalanche method.