Skip to main content

Sanction Simulator — interactive GUI and model based on the paper 'Political Power in International Trade' by Ashwin Bhattathiripad and Vipin P. Veetil, with the OECD ICIO 2022 benchmark network included

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sanction_simulator-0.1.1.tar.gz (76.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sanction_simulator-0.1.1-py3-none-any.whl (76.8 MB view details)

Uploaded Python 3

File details

Details for the file sanction_simulator-0.1.1.tar.gz.

File metadata

  • Download URL: sanction_simulator-0.1.1.tar.gz
  • Upload date:
  • Size: 76.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for sanction_simulator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6026144aaeb35a70aaeab8524e74dc5df00d9fd8f5b635c3e4e330478e69fd35
MD5 2a0c4624733f40a0592ed01bfacbba7e
BLAKE2b-256 202b03b93e44a0f3e1e50103ddce6e0da7b6149ed19808d6360fbe441c5ce26b

See more details on using hashes here.

File details

Details for the file sanction_simulator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sanction_simulator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e49976bcd3b67c2b988ed4380f2310a56aeda3e6488097ee1870b47445086fee
MD5 5485d9995511be3439bbce55700fa3c6
BLAKE2b-256 67f0d21062f3e7f114d3a52029692f7b5519fbb6e17854818ffd4a321ea16b45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page