Skip to content

AlejandroBaron/downpyment

Repository files navigation

Downpyment

Just a tiny lib to help with mortgage analysis and visualization in Python.

Installation

You can install the package via pip:

pip install downpyment

Usage

The central class is the mortgage one

from downpyment.mortgage import Mortgage, Interest, YEARLY_INTEREST_SCALE, Investment
from downpyment.reporting import MortgageReport


mortgage = Mortgage(
    property_price=300_000,
    interest=Interest(rate=1.85, scale=YEARLY_INTEREST_SCALE, perc=True),
    n_steps=30,
    downpayment=30_000,
    tax_perc=8,
)
mortgage.simulate()

The main goal is to generate a report as follows:

ep_params = {
    "amount": 5_000,
    "pay_each": 12,
}
investment = Investment(
    initial_amount=120_000,
    step_contribution=ep_params["amount"] / ep_params["pay_each"],
    interest=Interest(rate=5.0, scale=YEARLY_INTEREST_SCALE, perc=True),
    tax_perc=20,
)


MortgageReport(mortgage).report(ep_params=ep_params, inflation_p=2.0, investment=investment)

This will generate a report like this one:

Mortgage simulation with early payments

Mortgage simulation Mortgage simulation with inflation

Mortgage vs investment curves

Mortgage vs investment Mortgage vs investment with inflation

Check the scripts/simulate.py file for a complete example.

About

Utilities for mortgage analysis and visualization

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages