Install for Python
cfdl_sdk embeds the compiler and engine in-process (a Rust extension
module) — no separate binary or server.
pip
pip install cfdl-sdkPrebuilt wheels ship for every supported platform, so no Rust toolchain is
needed. pip install "cfdl-sdk[viz]" adds matplotlib for the plotting
helpers.
Supported platforms
CPython ≥ 3.10 (abi3 wheels): Linux x86_64/aarch64 (manylinux), macOS
universal2, Windows x64. pandas>=2.0 is a hard dependency; the optional
viz extra adds matplotlib.
Verify
import pathlib, cfdl_sdk
model_dir = pathlib.Path("my-model")
model_dir.mkdir(exist_ok=True)
(model_dir / "model.cfdl").write_text('''
version 0.1
model "first-model"
time calendar monthly from 2026-01 for 12
entity asset borrower : Asset.Financial
stream lease.rent on entity asset.borrower inflow currency USD {
schedule every month from 2026-01 to 2026-12
amount = 1000
}
''')
results = cfdl_sdk.run(model_dir, rate=0.08)
print(results.metrics()["model.total"]) # 12000.0The four domain packs are built into the Python package, as they are into
the CLI, so a model that says use pack "cre" compiles and runs with no
packs directory. packs_dir="packs" names a directory to read the packs from
instead, such as an extracted cfdl-packs-<version>.tar.gz or your own fork
of a pack.
Next: Python SDK usage · executed example notebooks