Skip to main content

pysyncon codecov

A python module for the synthetic control method that provides implementations of:

  • Synthetic Control Method (Abadie & Gardeazabal 2003)
  • Robust Synthetic Control Method (Amjad, Shah & Shen 2018)
  • Augmented Synthetic Control Method (Ben-Michael, Feller & Rothstein 2021)
  • Penalized Synthetic Control Method (Abadie & L'Hour 2021)

The package also provides methods for performing placebo tests and generating confidence intervals.

The implementation of the synthetic control method aims to be reconcilable with the R package Synth and similarly the implementation of the Augmented synthetic control method and the R package augsynth.

Installation

Install it from PyPI using pip:

python -m pip install pysyncon

Usage

Documentation is available on github-pages. In the examples folder are notebooks reproducing the weights/ATT from:

  • The Economic Costs of Conflict: A Case Study of the Basque Country, Alberto Abadie and Javier Gardeazabal; The American Economic Review Vol. 93, No. 1 (Mar., 2003), pp. 113-132. (notebook here)
  • The Kansas income-tax cuts example from The Augmented Synthetic Control Method, Eli Ben-Michael, Avi Feller & Jesse Rothstein; Journal of the American Statistical Association Vol. 116, No. 536 (2021), pp. 1789-1803. (notebook here)
  • The worked example 'Prison construction and Black male incarceration' from the last chapter of the first edition of 'Causal Inference: The Mixtape' by Scott Cunningham. (notebook here)
  • Comparative Politics and the Synthetic Control Method, Alberto Abadie, Alexis Diamond and Jens Hainmueller; American Journal of Political Science Vol. 59, No. 2 (April 2015), pp. 495-510. (notebook here)

Reproducing the results from the papers

The optimisers used (scipy's Nelder-Mead and SLSQP) are sensitive to the BLAS backend and to the installed numpy/scipy versions, so computed weights and estimates can vary slightly across environments — typically in the third decimal place of the weights and a few percent of point estimates. Reproducing the published values to full precision requires the reference environment that the notebook-parity tests (parity_tests/) are verified against on CI:

  • Python 3.11
  • numpy 2.0.2
  • scipy 1.13.1
  • pandas 2.3.3
  • matplotlib 3.9.4
  • ubuntu-22.04

These are pinned in the parity job (.github/workflows/parity.yml). Even with these versions, results on other hardware may still differ slightly, as the underlying BLAS libraries dispatch on the CPU.

Citation

If you use this package in your research, you can cite it as below.

@software{pysyncon,
  author = {Fordham, Stiofán},
  month = dec,
  title = {{pysyncon: a Python package for the Synthetic Control Method}},
  url = {https://github.com/sdfordham/pysyncon},
  year = {2022}
}

Metadata

Release files for pysyncon 1.7.0

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

Source distribution (sdist)

Source distribution for pysyncon 1.7.0
File Size Uploaded
pysyncon-1.7.0.tar.gz 38.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysyncon 1.7.0
File Interpreter ABI Platform
pysyncon-1.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 69.5 kB

Release files / pysyncon-1.7.0.tar.gz

Download URL pysyncon-1.7.0.tar.gz
Size 38.0 kB
Tags Source
SHA-256 checksum
How to use checksums
af34155ac4a8f13099e6992885b6fc2b9364e589ef172c045811673d36bd9d58
BLAKE2b-256 checksum
How to use checksums
9e2f2b259cb2c1c9775b5e8e3fb295035d8e01e5795f18008dff4e6578cce947
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.

Transparency log

Release files / pysyncon-1.7.0-py3-none-any.whl

Download URL pysyncon-1.7.0-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7aef61d84f434cc96bcb78bad122ae4b7871a3fd2045e584b9c5cb064fdc17a
BLAKE2b-256 checksum
How to use checksums
bed73aab1dd38e7bb67895eb5d9ee1a72aa0b8daf95ad47cc1eda0a5f0a9204b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.7.0 This release

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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