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.2.tar.gz (24.8 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.2-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mortgagemodeler-0.4.2.tar.gz
  • Upload date:
  • Size: 24.8 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.2.tar.gz
Algorithm Hash digest
SHA256 541080b86cd021e1d8cd5fea5bae06e17bbb4d3b5df6bc4a3b3091e561356ba6
MD5 af157a13a1f00ac49328f1854fc20fbd
BLAKE2b-256 014d3ed1059c798b17dca74fb9fef36af3def140bd7d9f9609083e13931069b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mortgagemodeler-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e616578f4cbe418922e858bded9e14784b30fc71270c34bc508ed089d5749fef
MD5 e59e7c7c97c3e693a3f85a3b730a7f26
BLAKE2b-256 9a116100174b87a32e3b657db42ccec92894982691f3a73ee30a2c90b406e909

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