Skip to main content

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=450_000,
    interest=Interest(rate=1.85, scale=YEARLY_INTEREST_SCALE, perc=True),
    n_steps=30,
    downpayment=0,
    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.

Metadata

Release files for downpyment 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for downpyment 0.1.1
File Size Uploaded
downpyment-0.1.1.tar.gz 336.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for downpyment 0.1.1
File Interpreter ABI Platform
downpyment-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 343.4 kB

Release files / downpyment-0.1.1.tar.gz

Download URL downpyment-0.1.1.tar.gz
Size 336.2 kB
Tags Source
SHA-256 checksum
How to use checksums
813174217938f16b78cac03481fe0e978338a70190bd717b35527000ee30095a
BLAKE2b-256 checksum
How to use checksums
b480607bac0bcddcd863e0ca5bc71da3b4e1739cef0e2e45013a16560d6a170e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.8

Release files / downpyment-0.1.1-py3-none-any.whl

Download URL downpyment-0.1.1-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
947fa5c7825a7bdd182d1e8c4f691ab8fe99e617fa6170c6d9d0df2561ffc390
BLAKE2b-256 checksum
How to use checksums
e9967e88a4c62af924245e3e8c5a81eae747bf8acc797cdd034dc8eda3023a6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.8

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page