Skip to main content

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

Metadata

Release files for dscr-tools 0.2.0

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

Source distribution (sdist)

Source distribution for dscr-tools 0.2.0
File Size Uploaded Provenance Actions
dscr_tools-0.2.0.tar.gz 11.1 kB Without provenance Details for dscr_tools-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dscr-tools 0.2.0
File Interpreter ABI Platform Actions
dscr_tools-0.2.0-py3-none-any.whl Python 3 none any Details for dscr_tools-0.2.0-py3-none-any.whl

Total release size: 22.9 kB

Release files / dscr_tools-0.2.0.tar.gz

Download URL dscr_tools-0.2.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
21e5d12ca7fdd32c608d890c3ff8281f7780138ef54bc7dd8f9832784643846b
BLAKE2b-256 checksum
How to use checksums
79ea43401ec4fa67ef992f0d13669e4d9bc4c0c8614a15326ea4863e729b3ebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.12

Release files / dscr_tools-0.2.0-py3-none-any.whl

Download URL dscr_tools-0.2.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2deea6ec5548042d4dd98dce393bf088797300456c6bdadbd036138cbfbb10a
BLAKE2b-256 checksum
How to use checksums
06d96fdac6bf3d94f250d64d931ddf7f097b3be508906dc28484f4bfdd13ba56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.12

Security for dscr-tools 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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