Skip to main content

Python toolkit for loan amortization, DSCR tracking, covenant monitoring, and loan sizing

Project description

dscr-tools 📊

Python toolkit for loan amortization, DSCR tracking, covenant monitoring, and loan sizing.

Supports multiple interest calculation methods, interest-only periods, ARM loans, max loan sizing, and stress testing — replacing bespoke Excel models with auditable, version-controlled Python code.


Why dscr-tools?

Every commercial real estate and private credit analyst builds the same loan model from scratch in Excel. dscr-tools standardizes the engine so you can focus on the deal, not the spreadsheet.


Installation

pip install dscr-tools

Quickstart

from dscrtools import LoanParams, NOISchedule
from dscrtools.models import amortization, dscr, sizing, stress

loan = LoanParams(
    loan_amount=8_000_000,
    interest_rate=0.065,
    amortization_years=30,
    loan_term_years=10,
    interest_method="partial_io",
    io_periods=24,
    payments_per_year=12,
    property_name="Midtown Office Building",
)

noi = NOISchedule(
    base_noi=750_000,
    growth_rate=0.03,
    vacancy_rate=0.05,
    capex_reserve=10_000,
)

amortization.summary(loan)
dscr.summary_table(dscr.analyze(loan, noi, min_dscr=1.25))
sizing.size_loan(loan, noi=750_000, property_value=12_000_000)
stress.rate_shock(loan, noi, rate_shocks=[0.01, 0.02, 0.03])
stress.noi_stress(loan, noi, noi_haircuts=[0.10, 0.20, 0.30])

Interest Methods

  • fixed_30_360 - Fixed rate, 30/360 day count (most CRE loans)
  • fixed_actual_360 - Fixed rate, Actual/360 (agency multifamily)
  • fixed_actual_365 - Fixed rate, Actual/365 (some bank loans)
  • interest_only - Full interest-only, no principal payments
  • partial_io - Interest-only period followed by full amortization
  • arm - Adjustable rate with floor and cap

Modules

  • amortization - Full period-by-period schedule with I/O and ARM support
  • dscr - Annual DSCR calculation, covenant tracking, breach detection
  • sizing - Max loan sizing via DSCR, LTV, and Debt Yield tests
  • stress - Rate shock and NOI stress sensitivity tables
  • loan - Interest calculation primitives for all day-count conventions

DSCR Covenant Logic

  • DSCR above min_dscr - OK
  • DSCR below min_dscr - BREACH
  • DSCR below 1.0 - DEFAULT

Loan Sizing

Solves for the maximum loan amount that satisfies all three constraints simultaneously, identifying the binding constraint:

sizing.size_loan(loan, noi=750_000, property_value=12_000_000,
                 min_dscr=1.25, max_ltv=0.75, min_debt_yield=0.08)

Running Tests

PYTHONPATH=. pytest tests/ -v

32 tests across all modules.


Who This Is For

  • CRE analysts underwriting commercial mortgage loans
  • Private credit teams modeling leveraged deals
  • Real estate finance practitioners replacing Excel waterfalls
  • Anyone who needs reproducible, auditable loan math in Python

License

MIT 2026 Jaypatel1511

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

dscr_tools-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dscr_tools-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file dscr_tools-0.1.0.tar.gz.

File metadata

  • Download URL: dscr_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for dscr_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1483467bbb95c2d20ba39258a992fe3b38af7806f20df2ba6bc249da43da2aa0
MD5 b12f81e2e14226eedd46e5ec01c87dc9
BLAKE2b-256 21d05ab3c030eb85cd4cc5c61bf788ff7014e22b3c269d298a8ed25a3c63c960

See more details on using hashes here.

File details

Details for the file dscr_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dscr_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for dscr_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fac45c789fb9674684a48fe18fa399b5db61b77117fb612ad80a38a63ffd39c
MD5 849742b6f0440a29a35d3a6bdd2d9c52
BLAKE2b-256 2b102d7624123c50eec9ed1696ce9864d5d17438282dfe1e5d2aaf6c095436ad

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