Skip to main content

CI PyPI Python Licence DOI

TabDGP

A data-generating process (DGP) for grouped and flat tables.

TabDGP simulates tabular datasets from a random structural causal model (SCM) and aims to reproduce the quirks of real data. Each table comes with the graph and the settings that generated it.

Alpha. Release 0.2 draws grouped and flat tables from defaults that are round guesses; the rest is planned below. Before 1.0, a release may change the dataset a key draws.

Highlights

  • Grouped or flat. One to three grouping factors by default, nested or crossed, with 2 to 400 groups each. A covariate varies by row or is constant within the groups of one factor. Hyperprior.flat() draws none.
  • White-box. Each dataset carries its graph, latent nodes, column metadata and hyperparameters.
  • Reproducible. A dataset is a pure function of its key (a seed and an index) and the hyperprior, whatever batch or worker draws it.
  • Overridable. Replace any default distribution by a point value or another distribution.

Install

pip install tabdgp

Quickstart

from tabdgp import Hyperprior, draw

hyperprior = Hyperprior.grouped(rows=100, design_columns=5)  # two overrides on the grouped preset
dataset = draw(seed=0, index=0, hyperprior=hyperprior)  # the key: a seed and an index
unit = dict(zip(dataset.graph.names, dataset.graph.unit))  # per row, or per group of a factor
for name, column in dataset.metadata.items():
    print(name, column.type, unit[name], dataset.columns[name][:3].round(2))
print(len(dataset.latent), 'latent nodes,', dataset.graph.parents.sum(), 'edges')
g0 categorical g0 [4 5 2]
g1 categorical g1 [ 6 22 29]
g2 categorical g2 [7 7 5]
x0 binary g0 [1 1 1]
x1 binary row [1 1 1]
x2 continuous row [0.36 0.69 0.15]
x3 binary row [0 0 0]
x4 binary row [0 1 0]
7 latent nodes, 16 edges

Planned

  • Quirk axes: group confounding, rare levels, ties, bounds, near dependence and more.
  • Matched defaults, fitted to and checked against mixedbench's real grouped tables, then widened.
  • An outcome node, optional, for white-box misspecified datasets, with within-group time and a binary treatment.

Learn more

CONTEXT.md defines the vocabulary.

Contributing

Issues and pull requests are welcome; see CONTRIBUTING.md.

Citing

Please cite the release you used, from CITATION.cff or GitHub's "Cite this repository".

Licence

MIT.

Metadata

Release files for tabdgp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tabdgp 0.2.0
File Size Uploaded Provenance Actions
tabdgp-0.2.0.tar.gz 122.8 kB With provenance Details for tabdgp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tabdgp 0.2.0
File Interpreter ABI Platform Actions
tabdgp-0.2.0-py3-none-any.whl Python 3 none any Details for tabdgp-0.2.0-py3-none-any.whl

Total release size: 144.2 kB

Release files / tabdgp-0.2.0.tar.gz

Download URL tabdgp-0.2.0.tar.gz
Size 122.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e127e75008d531ae91448bd07965e80cacbb0e281be7b4d697df57b21d1005da
BLAKE2b-256 checksum
How to use checksums
1f1f154b4c55d7f835bf71100569a429a4d6345b709f168d51cf6ccbd8fed200
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / tabdgp-0.2.0-py3-none-any.whl

Download URL tabdgp-0.2.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a19393866dfcce36f02e4bc7505dab2e391b2abaa4010bc70f0d6d884ae50b1
BLAKE2b-256 checksum
How to use checksums
f3a4e4e4067e2eb398f854239ac580b86d1532f7c3fff747f3375fc9cd34c0c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Security for tabdgp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tabdgp-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page