debt_optimizer.core package
- class debt_optimizer.core.Config(config_path=None)[source]
Bases:
objectConfiguration manager for debt optimizer.
- Parameters:
config_path (Path | None)
- DEFAULT_CONFIG_PATHS = [PosixPath('/home/docs/.debt_optimizer'), PosixPath('debt_optimizer.yaml'), PosixPath('debt_optimizer.yml')]
- DEFAULT_VALUES = {'auto_backup': True, 'bank_account_name': 'PECU Checking', 'compare_strategies': False, 'emergency_fund': 1000.0, 'extra_payment': 0.0, 'fuzzy_match_threshold': 80, 'input_file': 'default.xlsx', 'optimization_goal': 'minimize_interest', 'output_file': 'debt_analysis.xlsx', 'quicken_db_path': '/home/docs/Documents/Bryan.quicken/data', 'simple_report': False}
- classmethod create_default_config(path)[source]
Create a new configuration file with default values.
- load_from_file(path)[source]
Load configuration from YAML file.
- Parameters:
path (
Path) – Path to YAML config file- Raises:
ImportError – If PyYAML is not installed
ValueError – If file is not valid YAML
- Return type:
- save_to_file(path=None)[source]
Save current configuration to YAML file.
- Parameters:
path (
Optional[Path]) – Path to save config. If None, uses current config_path.- Raises:
ImportError – If PyYAML is not installed
ValueError – If no path specified and no config_path set
- Return type:
- class debt_optimizer.core.BalanceUpdater(db_path, fuzzy_threshold=80, bank_account_name='PECU Checking', auto_backup=True)[source]
Bases:
objectUpdates Excel workbook balances from Quicken database.
- __init__(db_path, fuzzy_threshold=80, bank_account_name='PECU Checking', auto_backup=True)[source]
Initialize balance updater.
- connect_db()[source]
Connect to Quicken database in read-only mode.
- Return type:
- Returns:
SQLite connection
- load_quicken_balances()[source]
Load account balances from Quicken database.
Calculates balance as Quicken register shows it: - Prefers ZONLINEBANKINGLEDGERBALANCEAMOUNT when available - Otherwise sums:
All reconciled transactions (ZRECONCILESTATUS = 2)
All unreconciled transactions (ZRECONCILESTATUS != 2) up to current date
This matches Quicken’s register balance which includes cleared/reconciled transactions plus any unreconciled transactions dated today or earlier. Uses Apple Cocoa timestamp format (seconds since 2001-01-01).
- Returns:
E501
- Return type:
Tuple of (accounts_by_name, credit_card_names, checking_names, savings_names) # noqa
- update_debts_sheet(ws, accounts_by_name, credit_card_names)[source]
Update debt balances in Debts sheet.
- update_settings_sheet(ws, accounts_by_name, checking_names)[source]
Update current bank balance in Settings sheet.
- update_workbook(xlsx_path, interactive=True)[source]
Update Excel workbook with balances from Quicken database.
- Parameters:
- Return type:
- Returns:
Dictionary with update summary
- Raises:
FileNotFoundError – If workbook doesn’t exist
BalanceUpdaterError – If update fails
- exception debt_optimizer.core.BalanceUpdaterError[source]
Bases:
ExceptionBase exception for balance updater errors.
Submodules
- debt_optimizer.core.balance_updater module
- debt_optimizer.core.config module
- debt_optimizer.core.debt_optimizer module
OptimizationGoalPaymentStrategyDecisionLogEntryMonthlyExtraFundsMonthlyExtraFunds.monthMonthlyExtraFunds.dateMonthlyExtraFunds.total_incomeMonthlyExtraFunds.required_minimumsMonthlyExtraFunds.recurring_expensesMonthlyExtraFunds.available_extraMonthlyExtraFunds.allocated_extraMonthlyExtraFunds.remaining_extraMonthlyExtraFunds.allocation_decisionsMonthlyExtraFunds.__init__()
OptimizationResultOptimizationResult.strategyOptimizationResult.goalOptimizationResult.total_interest_paidOptimizationResult.total_months_to_freedomOptimizationResult.monthly_cash_flow_improvementOptimizationResult.payment_scheduleOptimizationResult.monthly_summaryOptimizationResult.debt_progressionOptimizationResult.savings_vs_minimumOptimizationResult.decision_logOptimizationResult.monthly_extra_fundsOptimizationResult.__init__()
DebtPaymentPlanDebtOptimizer
- debt_optimizer.core.financial_calc module
PaymentFrequencyRecurrencePatternDebtIncomeRecurringExpenseFutureIncomeFutureIncome.descriptionFutureIncome.amountFutureIncome.start_dateFutureIncome.frequencyFutureIncome.end_dateFutureIncome.dateFutureIncome.__post_init__()FutureIncome.is_recurring()FutureIncome.get_occurrences()FutureIncome.get_total_amount_in_range()FutureIncome.get_monthly_average()FutureIncome.__str__()FutureIncome.__init__()
FutureExpenseFutureExpense.descriptionFutureExpense.amountFutureExpense.start_dateFutureExpense.frequencyFutureExpense.end_dateFutureExpense.dateFutureExpense.__post_init__()FutureExpense.is_recurring()FutureExpense.get_occurrences()FutureExpense.get_total_amount_in_range()FutureExpense.get_monthly_average()FutureExpense.__str__()FutureExpense.__init__()
calculate_monthly_payment()calculate_total_monthly_income()generate_amortization_schedule()DebtAnalyzer
- debt_optimizer.core.logging_config module
- debt_optimizer.core.validation module