Skip to main content

Sanction Simulator

Interactive sanction simulator based on the paper “Political Power in International Trade” by Ashwin Bhattathiripad and Vipin P. Veetil. The package bundles

  • the estimation model (power_trade_estimation.py: two-sided RAS rerouting + CES capacity-rationing equilibrium on the world input–output network),
  • the pre-built benchmark network from the OECD ICIO 2025 release (year 2022), and
  • a point-and-click GUI for composing and solving arbitrary sanction scenarios.

Install (macOS / Linux / Windows)

python3 -m pip install sanction-simulator

Python ≥ 3.10. Dependencies (numpy, pandas, streamlit, plotly) are installed automatically.

Run the GUI

sanction-simulator

This opens the simulator in your browser (default port 8601; override with SANCTION_SIM_PORT). Pick the sanctioning coalition, the targeted countries, the instrument (full embargo / export ban / import ban), an optional sector scope, and the structural parameters (τ, δ, ρ, ϱ), then press Solve scenario. A typical scenario solves in one or two seconds and reports output losses by country and sector, a world map, and solver diagnostics.

Programmatic use

import sys
import sanction_simulator as ss
sys.path.insert(0, ss._PKG_DIR)
import power_trade_estimation as pte

bench = pte.Benchmark(ss.data_dir(), cache=ss.bench_cache())
iu, ic = bench.cidx["USA"], bench.cidx["CHN"]
sb = pte.ScenarioBatch(bench, [pte.bilateral_legs(iu, ic)],
                       tau=0.30, delta=0.10)
sb.balance()
res = sb.solve(rho=-1.0)
loss = bench.s - res["s_omega"][0]          # gross-output loss, USD mn

Full pipeline

sanction-simulator-estimate exposes the paper's estimation stages (--stage validate|baseline|sensitivity|all). The packaged data contains the pre-built benchmark cache only; a from-scratch rebuild additionally needs the raw OECD ICIO file 2022_SML.csv placed in the --datadir directory.

Data note

The benchmark cache (bench_cache.npz) is a lossless, compressed copy of the network constructed from the OECD Inter-Country Input–Output tables, 2025 release, reference year 2022 (80 countries × 50 sectors). Source: OECD Inter-Country Input–Output Database, https://www.oecd.org/en/data/datasets/inter-country-input-output-tables.html. The OECD is the source of the underlying data; use of the derived benchmark network is subject to the OECD's terms and conditions.

License

The code is released under the MIT License (see LICENSE). Copyright (c) 2026 Ashwin Bhattathiripad and Vipin P. Veetil. If you use this package in academic work, please cite the paper Political Power in International Trade.

Metadata

Release files for sanction-simulator 0.1.4

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

Source distribution (sdist)

Source distribution for sanction-simulator 0.1.4
File Size Uploaded Provenance Actions
sanction_simulator-0.1.4.tar.gz 76.8 MB Without provenance Details for sanction_simulator-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sanction-simulator 0.1.4
File Interpreter ABI Platform Actions
sanction_simulator-0.1.4-py3-none-any.whl Python 3 none any Details for sanction_simulator-0.1.4-py3-none-any.whl

Total release size: 153.6 MB

Release files / sanction_simulator-0.1.4.tar.gz

Download URL sanction_simulator-0.1.4.tar.gz
Size 76.8 MB
Tags Source
SHA-256 checksum
How to use checksums
7a5e3fec60d97d8863eab017f88a6b799a5ee6b1830d614981881446e2a0c96f
BLAKE2b-256 checksum
How to use checksums
adaa85ac5ca77c095febf53957fcf02e1ba99492c37c57a3b0e20ec76143c7e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / sanction_simulator-0.1.4-py3-none-any.whl

Download URL sanction_simulator-0.1.4-py3-none-any.whl
Size 76.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1c29bce64dd5e15d14b956556fc544cae21ac504f0cea07558019c4b9eae4909
BLAKE2b-256 checksum
How to use checksums
012ebac0fde07b027517f4c0af30f8be10a4d93f09ed379ca46fbec933b3c63c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for sanction-simulator 0.1.4

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.

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