Introduction

AI / Agents

Skills
llms.txt
llms-full.txt

Meta

Requires: Python >=3.13

Tiny DSA is a stylized debt-sustainability tool that projects a country’s general-government debt-to-GDP ratio over a five-year horizon under a baseline macroeconomic and fiscal path and one configurable shock.1 It is intentionally minimal. The model implements a single public-debt accounting identity, recursed annually for five periods. It does not reproduce the indicator-and-threshold structure of operational debt-sustainability frameworks.

Install the Python package directly from GitHub with:

uv add "tiny-dsa @ git+https://github.com/Teal-Insights/py-tiny-dsa"

This package is a Python reimplementation of the source Excel workbook. It was produced using programmatic extraction, machine translation, and AI-assisted documentation rewriting. The purpose of the package documentation is to make the workbook logic easier to inspect, run, and reproduce from Python while preserving the source model’s intent and limitations.

The intended reader is a domain economist familiar with the standard public-debt accounting identity, who needs to understand what the tool computes, what its inputs and outputs mean, and where its simplifications depart from operational practice. The debt ratio and the primary balance are expressed as percentages of GDP. Real GDP growth and the real interest rate are expressed in percent per annum. The tool projects in real terms throughout.

Tiny DSA deliberately omits several features that are important in operational frameworks: the contribution of inflation to the debt ratio; exchange-rate dynamics and the currency composition of debt; residual financing terms such as stock-flow adjustments, contingent-liability calls, and other below-the-line operations; and any endogenous response of the primary balance to the macroeconomic environment.2 The fiscal stance is taken as exogenous, the snowball factor is computed in real terms, and shocks are step changes to a single parameter from a configurable shock year onward. These omissions keep the model small enough to be traced end to end.

The rest of this documentation explains how to use the Python package and interpret its outputs. It covers the model interface, the baseline and shock inputs, illustrative scenarios using the fictional country Borvelia, and the methodology behind the debt-dynamics identity, shock specification, realism checks, and modeling limitations.

For correctness evidence, see Excel parity validation, which summarizes the exported-library differential test against the source workbook.

Footnotes

  1. Tiny DSA is a methodological artifact prepared by Teal Insights. It is not intended for policy use, is not validated against country-specific data, and is not endorsed by the IMF, the World Bank, or any other institution. The modeling choices follow the standard public-debt accounting literature; the documentation conventions follow the IMF/World Bank LIC-DSF and IMF FAD Q-CRAFT guidance documents.↩︎

  2. For the corresponding treatment in operational frameworks, see International Monetary Fund and World Bank (2018), Sections II.B–II.D and Appendix III, and the discussion in Escolano (2010).↩︎