# pymc-labs/CausalPy

A Python package for causal inference in quasi-experimental settings

Repository: https://github.com/pymc-labs/CausalPy
Canonical: https://ross.abutalabs.com/products/causalpy
Homepage: https://causalpy.readthedocs.io
Language: Python
License: Apache-2.0
License Family: permissive
Topics: causal-inference, pymc, quasi-experimental, quasi-experiments
Last push: 2026-08-31T18:08:18+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 83, longevity 100
- inputs: {"age_days": 1442, "days_push": 2, "days_rel": 36, "gap_med": 59, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1185, forks 114 (observed 2026-09-01T02:14:06.106408+00:00)

## What it is
CausalPy is a Python package for causal inference in quasi-experimental settings, offering methods like difference-in-differences, synthetic control, regression discontinuity, and interrupted time series. It provides Bayesian estimation via PyMC with full uncertainty quantification, plus OLS via scikit-learn, with decision-ready effect summaries and plots.

## Use cases
- estimate causal effects of an intervention without a randomized experiment
- run a difference-in-differences analysis in Python
- build a synthetic control model to measure a policy impact
- analyze interrupted time series around a product launch
- perform regression discontinuity analysis
- get Bayesian credible intervals for treatment effects
- measure lift from a marketing campaign or A/B-like test

## When to choose
- you need quasi-experimental causal inference methods in Python
- you want Bayesian uncertainty quantification for causal effect estimates
- you want publication-quality plots and effect summaries with HDI and ROPE

## When to avoid
- you need fully randomized A/B experiment analysis tooling
- you need a non-Python or GUI-based statistics environment
- you only need simple descriptive statistics or dashboards

## Facets
- artifact type: library
- maturity: active
- function: data-science, machine-learning, math
- domain: data-science, analytics, machine-learning
- platform: python
- tags: causal-inference, quasi-experiments, bayesian, pymc, difference-in-differences, synthetic-control, statistics

## Member repositories
- pymc-labs/CausalPy (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-09-01T02:14:06.106408+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:25:19.849781+00:00, confidence not recorded.
  - readme: https://github.com/pymc-labs/CausalPy (fetched 2026-09-01T02:14:06.106408+00:00, sha ef1c31eccc31)
  - registry_pypi: https://pypi.org/pypi/causalpy/json (fetched 2026-08-29T12:33:00.456466+00:00, sha 3fa2c21480ef)
- Data as of 2026-08-30T08:39:29.467469+00:00.
