dowhy
DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions
Decision gist · record as of 2026-08-14
Yes. DoWhy is actively maintained, well-documented, has no known vulnerabilities, and is backed by a strong community. Install it if you work with observational data and need to move beyond correlation to causal reasoning—whether for effect estimation, root cause analysis, or counterfactual reasoning. The permissive MIT license removes legal friction. The main consideration is the substantial dependency footprint (13 runtime packages), which is typical for scientific Python but worth checking if you're in a constrained environment.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; graphviz and pygraphviz are optional but recommended for visualization of causal graphs.
- Installation is straightforward with low friction; the package is actively maintained with recent releases and a large community (8265 GitHub stars).
- It requires 13 runtime dependencies including scientific computing staples like numpy, pandas, and scikit-learn, which are typically already present in data science environments.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing commercial and private use without restriction, making this suitable for most professional and academic projects.
last release 2025-11-08 (279 days) · last repo commit 2026-08-14 · 8,265 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 264,450 downloads/mo, #8,339 on PyPI
Alternatives
Verify before relying
pip install dowhy
from dowhy import CausalModel
import pandas as pd
# Define causal graph and data
model = CausalModel(
data=df,
treatment='treatment_var',
outcome='outcome_var',
common_causes=['confounder1', 'confounder2'],
instruments=['instrument_var']
)
# Identify and estimate causal effect
identified_estimand = model.identify_effect()
estimate = model.estimate_effect(identified_estimand)- Whether the package's 13 runtime dependencies can be installed without compilation issues on all target platforms.
- Performance characteristics when working with large datasets or complex causal graphs.
- Maturity level of specific estimation methods (library is marked Beta in classifiers).
What it is and what it does
DoWhy is a causal inference library that helps you move beyond predictive modeling to understand cause-and-effect relationships in your data. It combines two major frameworks—graphical causal models and potential outcomes—to provide a unified interface for answering causal questions: identifying whether a causal effect is estimable from your data, computing average or conditional treatment effects, performing mediation analysis, and attributing observed outcomes to their causes.
The library supports effect estimation (using instrumental variables, propensity score methods, and other techniques), root cause analysis (finding what caused an anomaly or change in distribution), what-if simulation (generating counterfactual samples), and refutation testing (validating whether your causal assumptions hold). It's designed for practitioners who need to move beyond correlation and make decisions based on causal reasoning, with built-in diagnostics to test assumptions and make inference more robust.
Use it for
- Estimate the causal effect of a business intervention (e.g., loyalty program, pricing change) on customer behavior or revenue.
- Diagnose root causes of system failures or performance degradation in production environments.
- Quantify the direct vs. indirect effects of a treatment using mediation analysis.
- Generate counterfactual predictions to answer 'what would have happened if' scenarios for decision support.
- Validate causal assumptions and refute alternative explanations for observed effects in observational data.
- Attribute anomalies or changes in metrics to specific variables in complex systems.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
DoWhy is actively maintained, well-documented, has no known vulnerabilities, and is backed by a strong community. Install it if you work with observational data and need to move beyond correlation to causal reasoning—whether for effect estimation, root cause analysis, or counterfactual reasoning. The permissive MIT license removes legal friction. The main consideration is the substantial dependency footprint (13 runtime packages), which is typical for scientific Python but worth checking if you're in a constrained environment.
Install
dowhy on PyPI
Before you install
Installation is straightforward with low friction; the package is actively maintained with recent releases and a large community (8265 GitHub stars). It requires 13 runtime dependencies including scientific computing staples like numpy, pandas, and scikit-learn, which are typically already present in data science environments.
Requires Python 3.9 or later; graphviz and pygraphviz are optional but recommended for visualization of causal graphs.
License in practice
MIT license is permissive, allowing commercial and private use without restriction, making this suitable for most professional and academic projects.
Quickstart
pip install dowhy
from dowhy import CausalModel
import pandas as pd
# Define causal graph and data
model = CausalModel(
data=df,
treatment='treatment_var',
outcome='outcome_var',
common_causes=['confounder1', 'confounder2'],
instruments=['instrument_var']
)
# Identify and estimate causal effect
identified_estimand = model.identify_effect()
estimate = model.estimate_effect(identified_estimand)
Verify before relying
- Whether the package's 13 runtime dependencies can be installed without compilation issues on all target platforms.
- Performance characteristics when working with large datasets or complex causal graphs.
- Maturity level of specific estimation methods (library is marked Beta in classifiers).
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <3.14,>=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 13 packagescausal-learncvxpycythonjoblibnetworkxnumbanumpypandasscikit-learnscipystatsmodelssympytqdm |
| Maintenance | Actively maintained 279 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 264,450 / month, #8,339 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9 |
Evidence: dowhy-0.14-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “effect estimation library”
- dowhyDoWhy is a Python library for causal inference that identifies and…
- causallibCausallib estimates causal effects from observational data using a…
- econmlEconML estimates heterogeneous treatment effects from observational…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also causallib · causalml · pgmpy · cem · econml · rdrobust · pyfixest · psmpy