Overview · Gallery · From Stata & Dynare · Run it anywhere
The same code on a laptop, in a browser and on an iPad
The estimator core imports only NumPy, SciPy, pandas and Matplotlib, so the same code runs on a workstation, in a browser tab and on an iPad. A local install is the supported target; the browser and tablet paths are best-effort.
ON YOUR COMPUTER
One pip install
The base install pulls seven dependencies and covers the estimators, the data fetchers and the parquet code paths. The first check runs offline, with no data and no API key.
pip install puremacro
python -m puremacro.examples.sign_restrictions_uhlig
Optional extras: [backend] (numba, Apple-Silicon mlx), [cuda], [data], [narrative], [local-llm], [notebooks].
IN YOUR BROWSER
A playground with nothing to install
The JupyterLite playground runs puremacro on a Pyodide kernel inside the browser tab, with 33 notebooks and their Spanish twins.
ON AN IPAD
Pyodide and juno.sh
Install the estimator core without dependency resolution, then ask the runtime what the device can actually do.
import micropip
await micropip.install("puremacro", deps=False)
await micropip.install(["numpy", "scipy", "pandas", "matplotlib", "requests"])
from puremacro import runtime
print(runtime.report())
# host : pyodide 3.12.7 (wasm32)
# device : tablet
# network : js-fetch (call runtime.enable_browser_network())
# parquet : unavailable -> use puremacro.runtime.store / pocket
WHEN THE TABLET IS NOT ENOUGH
Offload to Google Colab
Package a heavy job, such as a 10,000-draw MCMC or a large bootstrap, as a self-contained notebook, run it on Colab and load the result back as a portable cartridge.
from puremacro.runtime.colab import generate_colab_notebook, load_colab_result
generate_colab_notebook(
"""
import puremacro as pm
result = pm.dsge.estimate_sw07(n_draws=10000, n_chains=4)
""",
mount_drive=True,
save_path="sw07_offload.ipynb",
output_filename="sw07_posterior.pmz",
)
# posterior = load_colab_result("sw07_posterior.pmz")
DATA THAT TRAVELS
Pocket cartridges
Pack a panel where the network is, open it where it is not: one self-verifying file that carries its own provenance.
from puremacro import pocket
pocket.pack(panel, "g7.pmz",
source="OECD QNA", vintage="2026-08-19")
cart = pocket.load("g7.pmz") # sha256-checked on read
panel = cart.frame()
JOBS THAT SURVIVE
Resumable long runs
iPadOS suspends background apps. Long jobs compute in chunks, save after each and resume later with bit-identical results.
from puremacro import longrun
job = longrun.bootstrap(one_draw, 2000,
checkpoint="irf.ckpt")
job.run(seconds=30) # 240/2000 · 12%
job.run(seconds=30) # ...after the app resumes
