Skip to main content

Flexible mortgage amortization and analytics tools in Python

Project description

Mortgage Tools

Python Build Status Code Style: Black License: MIT Binder

A professional-grade Python toolkit and CLI for simulating, analyzing, and comparing mortgage loans. Supports fixed-rate, ARM, FHA, VA, USDA, and HELOC loans with rich features like recasting, refinancing, extra payment plans, and effective APR and breakeven analysis.


Features

  • Amortization schedule generation (monthly, biweekly support)
  • Extra payments and frequency modeling
  • Recast support with lump-sum payment logic
  • Refinance modeling with closing costs and term reset
  • Breakeven point analysis for refinance decisions
  • Effective APR comparison with points and fees
  • Visualization of amortization curves and scenario comparisons
  • Compatible with advanced loan types (FHA, VA, USDA, HELOC, ARM)

Quick Start

Installation

git clone https://github.com/yourusername/mortgagemodeler.git
cd mortgagemodeler
pip install -r requirements.txt

CLI Usage

Amortization

    python cli.py amortize \
    --balance 400000 \
    --rate 6.25 \
    --term 360 \
    --type fixed \
    --extra-payment 200 \
    --extra-frequency monthly \
    --output amortization.csv

Recast

    python cli.py amortize \
    --balance 400000 \
    --rate 6.25 \
    --term 360 \
    --recast-date 2026-06-01 \
    --lump-sum 10000

Recast

    python cli.py amortize \
    --balance 400000 \
    --rate 6.25 \
    --term 360 \
    --recast-date 2026-06-01 \
    --lump-sum 10000

Refinance

    python cli.py amortize \
    --balance 400000 \
    --rate 6.25 \
    --term 360 \
    --refinance-date 2026-06-01 \
    --new-rate 5.75 \
    --refi-fees 4500

Compare Scenarios

    python cli.py plot \
    --scenarios 400000 6.25 360 \
    --scenarios 400000 5.75 240

Effective APR

    python cli.py compare-apr \
    --principal 400000 \
    --rate 6.25 \
    --term 360 \
    --points 1.0 \
    --fees 4500

Refinance Breakeven

    python cli.py breakeven \
    --monthly-savings 150 \
    --closing-costs 4500

Library Usage

    from mortgage_tools.loan import Loan
    from mortgage_tools.amortizer import LoanAmortizer

    loan = Loan(
        principal=400000,
        rate=6.25,
        term_months=360,
        origination_date=date.today(),
        loan_type='fixed',
        extra_payment_amount=200,
        extra_payment_frequency='monthly'
    )

    amortizer = LoanAmortizer(loan)
    df = amortizer.to_dataframe()
    df.head()

Supported Loan Types

Loan Type Description
fixed Standard fixed-rate mortgage
arm Adjustable-Rate Mortgage (hybrid types like 5/6)
fha FHA-backed with upfront & monthly MIP
va VA loan with guarantee fee
usda USDA loan with annual fee and upfront guarantee
heloc Home Equity Line with draw/repayment period

Requirements

Python 3.10+ click pandas matplotlib seaborn numpy_financial tabulate python-dotenv

Install

pip install -r requirements.txt

License

This project is licensed under the MIT License.

Author

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.1.1.tar.gz (9.3 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.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mortgagemodeler-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0b30e546f21437fb5bec16a9d8c04200feb2996f0abe5758e4ce438306f2b01e
MD5 279f53a584d6ad4f26cb667e3a65e9f3
BLAKE2b-256 66574748e8df62dff86196d05bdd96f420fc5491db1d049fba0b5aa8725a4a33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mortgagemodeler-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81f022d0ab99b8aa1f99d0e30ed919ab8fcd028ac703fcad7ee2679eb8195960
MD5 94792969904be5ebdf07acbc10178317
BLAKE2b-256 e8c68f0b184869c961fa4c878207389d03dd4576929cea570b5512d42a2a2a18

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