This release is a pre-release and may not be stable for production use.
Causalis
Robust causal inference for experiments and observational studies in Python, organized around scenarios (e.g., Classic RCT, CUPED, Unconfoundedness) with a consistent fit() → estimate() workflow.
- 📚 Documentation & notebooks: https://causalis.causalcraft.com/
- 🔎 API reference: https://causalis.causalcraft.com/api-reference
Why Causalis?
Causalis focuses on:
- Scenario-first workflows (you pick the study design; Causalis provides best-practice defaults).
- Guardrails and diagnostics (e.g., SRM checks, balance checks).
- Typed data contracts (
CausalData) to fail fast on schema issues.
Installation
Recommended
pip install causalis
Quickstart: Classic RCT (difference in means + inference)
from causalis.dgp import generate_classic_rct_26
from causalis.scenarios.classic_rct import DiffInMeans, check_srm
# Synthetic RCT data as a validated CausalData object
data = generate_classic_rct_26(seed=42, return_causal_data=True)
# Optional: Sample Ratio Mismatch check
srm = check_srm(data, target_allocation={0: 0.5, 1: 0.5}, alpha=1e-3)
print("SRM detected?", srm.is_srm, "p=", srm.p_value, "chi2=", srm.chi2)
# Estimate treatment effect with t-test inference (or bootstrap / conversion_ztest)
result = DiffInMeans().fit(data).estimate(method="ttest", alpha=0.05)
result.summary()
Quickstart: Observational study (Unconfoundedness / DML IRM)
from causalis.scenarios.unconfoundedness.dgp import generate_obs_hte_26
from causalis.scenarios.unconfoundedness import IRM
from causalis.data_contracts import CausalData
causaldata = generate_obs_hte_26(return_causal_data=True, include_oracle=False)
from causalis.scenarios.unconfoundedness import IRM
model = IRM().fit(causaldata)
result = model.estimate(score='ATTE')
result.summary()
Pick your scenario
Classic RCT: randomized assignment (no pre-period metric).
CUPED: randomized assignment with pre-period metric for variance reduction.
Unconfoundedness: observational study adjusting for measured confounders (DML IRM).
See scenario notebooks: https://causalis.causalcraft.com/explore-scenarios
Responsible use / limitations
Causal estimates require identification assumptions (e.g., randomization or unconfoundedness + overlap). Causalis can help with diagnostics, but it cannot guarantee assumptions hold in your data.
Contributing
Contributions are welcome—bug reports, docs fixes, notebooks, and new estimators. Please read CONTRIBUTING.md and follow the Code of Conduct.
Getting help
Questions: GitHub Discussions
Bugs: GitHub Issues (include minimal repro + versions)
License
MIT (see LICENSE).
Acknowledgements
Release files for causalis 0.2.9.dev347
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| causalis-0.2.9.dev347.tar.gz | 10.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| causalis-0.2.9.dev347-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 MB
Release files / causalis-0.2.9.dev347.tar.gz
| Download URL | causalis-0.2.9.dev347.tar.gz |
|---|---|
| Size | 10.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2055a706415f2c0a9b577acc60d5a85ddc3db8e36a1e24d1ccb70d3ba49ee5b
|
|
BLAKE2b-256 checksum How to use checksums |
48633e86ec299f617d53e24080ec2ad1e710bb311c7cf034b2f399ae9d9d58df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / causalis-0.2.9.dev347-py3-none-any.whl
| Download URL | causalis-0.2.9.dev347-py3-none-any.whl |
|---|---|
| Size | 321.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bb591efaeea0104868caf76c047173ab7d12b2d0042c7a31241329074452215
|
|
BLAKE2b-256 checksum How to use checksums |
23a24525d6626981801cfed883855d01c62d6bf3e06887d6c4d4460207c3fe10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|