Skip to main content

Flexible mortgage amortization and analytics tools in Python

Project description

MortgageModeler

Mortgage Modeler is a professional-grade mortgage modeling toolkit and CLI for simulating, analyzing, and comparing U.S. home loans — built for analysts, fintech engineers, and power users.

PyPI GitHub Binder License: MIT Python

Overview

MortgageModeler provides in-depth mortgage analytics in Python, including:

  • Amortization, payment, and payoff schedules
  • Fixed, ARM, FHA, VA, USDA, and HELOC loan structures
  • Recast and refinance logic with closing cost modeling
  • Forward rate curve simulation and ARM caps/floors
  • Effective APR and refinance breakeven point calculation
  • CLI and API for scripting, exploration, or integration
  • Composable modeling: combine ARM resets, forward rate paths, recast, refinance, and extra payments in one simulation

Supported Features

  • Flexible amortization modeling for fixed, ARM, FHA, VA, USDA, and HELOC loans
  • Support for extra payments, lump sums, recasts, and refinance scenarios
  • Forward rate simulation for ARMs with full cap/floor/margin logic
  • Recast support based on lump-sum triggers or scheduled month
  • Refinance modeling with rate/term changes and closing costs
  • Effective APR calculation including points and fees
  • Breakeven analysis to evaluate refinance timing
  • CSV and JSON export of full amortization schedules
  • Matplotlib-based amortization plotting
  • Command-line interface (mortgagemodeler) and Python API

Why MortgageModeler?

MortgageModeler was built for modern housing finance analysis — blending precision, flexibility, and transparency. Whether you're a fintech developer modeling loans, a homeowner exploring refinance timing, or a credit analyst stress-testing ARM resets, this library gives you full control and reproducibility — via Python or CLI.


Supported loan types:

  • fixed
  • arm
  • fha
  • va
  • usda
  • heloc

Installation

pip install mortgagemodeler

Quickstart

Using the Python API:

from mortgagemodeler import Loan, LoanAmortizer

loan = Loan(principal=400000, rate=0.0625, term_months=360, origination_date="2023-01-01")
amortizer = LoanAmortizer(loan)
amortizer.plot()

CLI Usage

Run amortization calculations and models via CLI:

mortgagemodeler amortize --balance 400000 --rate 6.25 --term 360 --type arm \
--index SOFR --margin 2.75 --arm-structure 5 6 --caps 2 1 5 --floors 0 0 0 \
--start-date 2023-01-01 --extra-payment 100 --show-apr --plot

Run complex scenarios including custom index, model curtailments and recast

mortgagemodeler amortize   --type arm   --balance 800000   --rate 5.25 \ 
--term 360   --margin 2.5   --arm-structure 3/1   --index-curve '{"2027-07-01": 4.0}' \
--index SOFR   --months 60   --curtailments 300000@42   --recast-month 45

Explore rich command line

Use --help to see all available options.

mortgagemodeler amortize --help

Example Notebooks

Check github repowhich includes ready-to-run Jupyter examples in the examples/ folder:

  • Fixed_vs_ARM.ipynb: Compare fixed vs adjustable-rate loan paths
  • FHA_vs_Conventional.ipynb: Analyze MIP vs PMI cost impact
  • Refinance_Breakeven.ipynb: Estimate the optimal time to refinance

Launch directly in Binder: Binder


License

MIT License © 2025 Arun Kumar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mortgagemodeler-0.4.0.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mortgagemodeler-0.4.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file mortgagemodeler-0.4.0.tar.gz.

File metadata

  • Download URL: mortgagemodeler-0.4.0.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for mortgagemodeler-0.4.0.tar.gz
Algorithm Hash digest
SHA256 50aa08128ac6b6fdbce0063596ff9faa08823829e1a9541ecd2838f42822a1fa
MD5 5bbce7305f64e65e03c8377d943a1d77
BLAKE2b-256 19911300f6f2c5ede96a3463c6ab41bfca855155edbd49918d72a95fa5399f82

See more details on using hashes here.

File details

Details for the file mortgagemodeler-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mortgagemodeler-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62153c85d2989dfc8f4638fcffbb16694f22b97006b544cd916124d9ef1bd806
MD5 aeed7dd2200ad85577ba209155657e07
BLAKE2b-256 a60335742bd1f7b5d1deb6134846997551afc33b4a6677b9db9ef5064762b329

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page