A Python library for causal effect estimation.
Project description
formative
Python library for causal effect estimation. You declare your causal assumptions as a DAG before choosing an estimation method, making identification explicit rather than implicit.
Requirements
- Python 3.10+
Installation
pip install formative-ds
Docs
Comprehensive documentation is available at docs.getformative.dev.
Usage
from formative import DAG, OLSObservational
dag = DAG()
dag.assume("ability").causes("education", "income")
dag.assume("education").causes("income")
result = OLSObservational(
dag,
treatment="education",
outcome="income"
).fit(df)
print(result.summary())
Confounders declared in the DAG are controlled for automatically. If a confounder is absent from the dataframe, an IdentificationError is raised before any estimation runs. See online documentation at docs.getformative.dev for more examples and details.
Local development
Requires uv.
git clone https://github.com/maxpagels/formative
cd formative
uv sync --dev
This creates a .venv, installs all dependencies, and installs the package in editable mode.
Releasing a new version
uvx bump-my-version bump patch # 0.1.0 → 0.1.1 (bug fixes)
uvx bump-my-version bump minor # 0.1.0 → 0.2.0 (new features)
uvx bump-my-version bump major # 0.1.0 → 1.0.0 (breaking changes)
git push --follow-tags # triggers publish to PyPI
Running tests
uv run pytest
Importing without installing
To use formative from a script outside this repo without installing it, either prepend the path at runtime:
import sys
sys.path.insert(0, "/path/to/formative")
from formative import DAG, OLSObservational
Or set PYTHONPATH before running:
PYTHONPATH=/path/to/formative python your_script.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file formative_ds-0.1.3.tar.gz.
File metadata
- Download URL: formative_ds-0.1.3.tar.gz
- Upload date:
- Size: 129.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a020f3ecdc5bd6add72c3c34a442383562cfa627e42b836ea0fb42fcf04cafe8
|
|
| MD5 |
a58f3983137078e4b68a5be35e791259
|
|
| BLAKE2b-256 |
3d559039232459e5ee1ca4999096b340f6cf4a1b7fa1bdecaca43ddad4594dd0
|
Provenance
The following attestation bundles were made for formative_ds-0.1.3.tar.gz:
Publisher:
publish.yml on maxpagels/formative
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
formative_ds-0.1.3.tar.gz -
Subject digest:
a020f3ecdc5bd6add72c3c34a442383562cfa627e42b836ea0fb42fcf04cafe8 - Sigstore transparency entry: 1029735710
- Sigstore integration time:
-
Permalink:
maxpagels/formative@633c8032b37b1de07dc8d44a865c4f5a4cec0b64 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/maxpagels
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@633c8032b37b1de07dc8d44a865c4f5a4cec0b64 -
Trigger Event:
push
-
Statement type:
File details
Details for the file formative_ds-0.1.3-py3-none-any.whl.
File metadata
- Download URL: formative_ds-0.1.3-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c634916971642ce5bab7452b4b1475aa768e85688401c4a877b7d76549fb28f
|
|
| MD5 |
f85936d2d6c9a99b3f790a128132c33b
|
|
| BLAKE2b-256 |
286e51e8ecf803cfeca436d5bbc76f097882b9d35ae92807ac206633fd0999a6
|
Provenance
The following attestation bundles were made for formative_ds-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on maxpagels/formative
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
formative_ds-0.1.3-py3-none-any.whl -
Subject digest:
0c634916971642ce5bab7452b4b1475aa768e85688401c4a877b7d76549fb28f - Sigstore transparency entry: 1029735719
- Sigstore integration time:
-
Permalink:
maxpagels/formative@633c8032b37b1de07dc8d44a865c4f5a4cec0b64 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/maxpagels
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@633c8032b37b1de07dc8d44a865c4f5a4cec0b64 -
Trigger Event:
push
-
Statement type: