Skip to main content

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.

PyPI GitHub Binder

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

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.3.1.tar.gz (17.9 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.3.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mortgagemodeler-0.3.1.tar.gz
Algorithm Hash digest
SHA256 79267834377a87861f1a4034f956e4faf9f0f6e543adf21862513a6a7c867416
MD5 89293efec8e745b63e8566913bbbe7c8
BLAKE2b-256 6be756f6bea830112eccd3a7cf2c27b5a3b59c190aea59964389d94a8ec1478c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mortgagemodeler-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ac542dc074a03363db269555369e097a2fb5142bf00e419c9a2d4655be34d6c
MD5 e9b7838aec9811c974253c144420d65f
BLAKE2b-256 89e3c9a903dc319099f313d58f8b9d266b4b73a005f8281da7edcace61f8ada9

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