Flexible mortgage amortization and analytics tools in Python
Project description
MortgageModeler
MortgageModeler is a modular Python toolkit for modeling mortgage amortization, refinancing, FHA loans, and HELOCs — complete with CLI support and plotting.
MortgageModeler lets you simulate mortgage payments over time, compare fixed vs ARM loans, evaluate refinance and recast scenarios, and export visualizations or CSVs — all from Python or the command line.
Installation
Install from PyPI:
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
mortgagemodeler amortize --help
Use --help to see all available options.
Features
- Fixed-rate, ARM, FHA, and HELOC support
- Recast and refinance simulation logic
- Cost comparison based on exit year or refinance timing
- Compare APRs including discount points and fees
- Monthly and annual amortization tables with CSV export
- CSV export, JSON output, and matplotlib visualizations
- Matplotlib-based amortization plots
- Python API and CLI tool for scripting and terminal workflows (
mortgagemodeler) - Easily extendable for other loan types and policies
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.3.0.tar.gz.
File metadata
- Download URL: mortgagemodeler-0.3.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c197c08ab86c96628591573f7a1b5cb9251427824c2fda14b4e3e5db030482a
|
|
| MD5 |
3c5f0f626c7d73fa723d245cfd78f366
|
|
| BLAKE2b-256 |
6d1790d5626759ec6b2308bb8435d6c66f19bfe81c55252049473bbe73599f70
|
File details
Details for the file mortgagemodeler-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mortgagemodeler-0.3.0-py3-none-any.whl
- Upload date:
- Size: 11.5 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 |
4c99b8e82211687146c76d4449da5dbf5d23bbb2a1a9eb85e589f6f6925646f6
|
|
| MD5 |
7ad137bd192355837e1f07cdfd0cbcfa
|
|
| BLAKE2b-256 |
ce7082be80359d58717f5b0c88f70b0aec225d837a12a08a44b20000af97bd88
|