# py-why/causal-learn

Causal Discovery in Python. Learning causality from data.

Repository: https://github.com/py-why/causal-learn
Canonical: https://ross.abutalabs.com/products/causal-learn
Homepage: https://causal-learn.readthedocs.io/en/latest/
Language: Python
License: MIT
License Family: permissive
Topics: causal, causal-discovery, causal-inference, causality, python, graph, structure, tetrad, time-series, hidden-causal, confounder, causal-representation-learning, independence-tests, statistics, causal-learning
Last push: 2026-07-11T02:45:31+00:00

## Health v2 (maintenance only)
Score: 89/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 92, release rhythm 80, longevity 100
- inputs: {"age_days": 2152, "days_push": 53, "days_rel": 53, "gap_med": 52.5, "n_releases_24m": 9}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1677, forks 270 (observed 2026-08-28T04:05:20.643328+00:00)

## What it is
causal-learn is a Python library for causal discovery, implementing classical and state-of-the-art algorithms to recover causal structure from observational data. It includes constraint-based, score-based, and functional causal model methods, plus utilities like independence tests and graph operations.

## Use cases
- learn causal structure from observational data
- run PC or GES causal discovery algorithms in Python
- test conditional independence between variables
- perform Granger causality analysis on time series
- discover latent hidden causal representations
- build custom causal discovery methods with score functions and graph utilities

## When to choose
- you need a well-maintained Python port of the Java Tetrad causal discovery algorithms
- you want provable correctness guarantees for structure recovery from observational data
- you need a broad toolkit of causal discovery methods plus building blocks like independence tests in one package

## When to avoid
- you need causal effect estimation or treatment effect inference rather than structure discovery
- you require interventional/experimental data analysis or a GUI workflow
- you need a production system with real-time inference rather than offline statistical analysis

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, data-science, math
- domain: machine-learning, data-science
- platform: python, cross-platform
- tags: causal-discovery, causal-inference, causality, graph-structure-learning, independence-tests, granger-causality, tetrad, algorithms

## Member repositories
- py-why/causal-learn (main) score 89

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:20.643328+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-30T03:41:37.756383+00:00, confidence not recorded.
  - readme: https://github.com/py-why/causal-learn (fetched 2026-08-28T04:05:20.643328+00:00, sha 7937de9237ce)
  - registry_pypi: https://pypi.org/pypi/causal-learn/json (fetched 2026-08-29T11:15:31.544558+00:00, sha a0803ea90587)
- Data as of 2026-08-30T08:39:29.467469+00:00.
