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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mortgagemodeler-0.4.3.tar.gz
  • Upload date:
  • Size: 24.7 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.3.tar.gz
Algorithm Hash digest
SHA256 61bac340d22ac93446ae5bb7f9e9644edc791f6fd5e4e9d9435252e0d42eecb0
MD5 676d02ce60ac7eb669aa19bf61b016e7
BLAKE2b-256 4635158cc70d82454b07a93a39e8de73565824a6474658b12d041a18ca8d6730

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mortgagemodeler-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0d16b753e1bfde1f5072965837bcd5900a8ae7394288c2e25fbf00791bbe5c5b
MD5 ed2a760c72542afa96c8e4e5fd9035c7
BLAKE2b-256 74f5a650d5e47b258ba8de4998934a297728466bf713eaa2f7f3a919aff88366

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