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.
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:
fixedarmfhavausdaheloc
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
License
MIT License © 2025 Arun Kumar
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mortgagemodeler-0.4.1.tar.gz.
File metadata
- Download URL: mortgagemodeler-0.4.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab2935669c807c6b1da98e09c36f5c977989c318edf83584c707b9a650862d41
|
|
| MD5 |
7fec4da2d2038d8606ad8ff292d1ccb9
|
|
| BLAKE2b-256 |
27d8541282d693c164d3c42b845d3f4dece7f72a9715d0a81d654853ffd9baa2
|
File details
Details for the file mortgagemodeler-0.4.1-py3-none-any.whl.
File metadata
- Download URL: mortgagemodeler-0.4.1-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d70c87bde243179d7b95ffb85f792597b0f248f55dc064c8447f7b5ede0dc3c
|
|
| MD5 |
39f9feb6b7859040b89362e9b0ba5541
|
|
| BLAKE2b-256 |
b0ee613a2fe939d2c4525885750eb3f46e00e2f707f32666fc2144ca05a2cd74
|