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.2.0.tar.gz (11.1 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.2.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dscr_tools-0.2.0.tar.gz
  • Upload date:
  • Size: 11.1 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.2.0.tar.gz
Algorithm Hash digest
SHA256 21e5d12ca7fdd32c608d890c3ff8281f7780138ef54bc7dd8f9832784643846b
MD5 6e889cd0d1ca64dcbb5fe49ddf5da32e
BLAKE2b-256 79ea43401ec4fa67ef992f0d13669e4d9bc4c0c8614a15326ea4863e729b3ebd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dscr_tools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2deea6ec5548042d4dd98dce393bf088797300456c6bdadbd036138cbfbb10a
MD5 36df357ffbd7f488baccd8b8a1b317d9
BLAKE2b-256 06d96fdac6bf3d94f250d64d931ddf7f097b3be508906dc28484f4bfdd13ba56

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