Skip to main content

Consist

CI License BSD 3-Clause

Consist is a caching and provenance layer for scientific simulation workflows. It records the code, configuration, input data, and output artifacts behind each run so expensive steps can be skipped safely and results remain queryable after the fact.

Consist is useful when a workflow has:

  • long-running model steps that should cache-hit when inputs are unchanged;
  • scenario variants that need explicit lineage and comparison;
  • file-based tools that need stable local paths but still need canonical provenance;
  • post-run questions like "which config produced this output?"

Installation

pip install consist

Optional integrations are installed as extras:

pip install "consist[git]"
pip install "consist[ingest]"
pip install "consist[docker]"
pip install "consist[ibis]"

Quick Example

from pathlib import Path

import pandas as pd

import consist
from consist import ExecutionOptions, Tracker

tracker = Tracker(run_dir="./runs", db_path="./provenance.duckdb")


def clean_data(raw: Path, threshold: float = 0.5) -> dict[str, Path]:
    df = pd.read_parquet(raw)
    out = Path("./cleaned.parquet")
    df[df["value"] > threshold].to_parquet(out)
    return {"cleaned": out}


first = tracker.run(
    fn=clean_data,
    inputs={"raw": Path("raw.parquet")},
    config={"threshold": 0.5},
    outputs=["cleaned"],
    execution_options=ExecutionOptions(input_binding="paths"),
)

second = tracker.run(
    fn=clean_data,
    inputs={"raw": Path("raw.parquet")},
    config={"threshold": 0.5},
    outputs=["cleaned"],
    execution_options=ExecutionOptions(input_binding="paths"),
)

print(first.cache_hit, second.cache_hit)  # False, True
cleaned = consist.load_df(second.outputs["cleaned"])

In this example, input_binding="paths" tells Consist to pass local Path objects into the callable instead of loading input files. Those same paths are still hashed and recorded for cache identity and lineage. For tools that need inputs copied to specific local filenames, see Usage Guide.

Tracking CLI Commands

For workflows that run from the shell, such as compiled binaries, R or Julia scripts, or legacy pipelines, initialize a workspace with consist init and prefix commands with consist exec. Consist records input and output hashes, sidecar logs, and run-over-run diffs without modifying the underlying tool:

consist init

consist exec \
  --name traffic_assignment \
  --input network=inputs/network.xml \
  --input config=configs/calibration.yaml \
  --output link_flows=outputs/link_flows.parquet \
  -- ./bin/run_traffic_sim --config configs/calibration.yaml --threads 8

Documentation

Start here Use it for
Quickstart First tracked run and cache hit
First Workflow Two-step pipeline with explicit artifact links
Usage Guide Choosing between run, trace, and scenario
Caching & Hydration Cache identity, hit behavior, and output recovery concepts
Historical Recovery Restoring archived outputs and staging inputs
CLI Reference Inspecting runs, artifacts, lineage, and schemas
API Reference Public Python API and generated signatures

Etymology

In railroad terminology, a consist is the lineup of locomotives and cars that make up a train. In this library, a consist is the immutable record of the code, config, inputs, and outputs coupled together to produce a result.

Metadata

Release files for consist 0.4.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 consist 0.4.0
File Size Uploaded Provenance Actions
consist-0.4.0.tar.gz 596.7 kB Without provenance Details for consist-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.2 MB

Release files / consist-0.4.0.tar.gz

Download URL consist-0.4.0.tar.gz
Size 596.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cf24b5e1b76afb0be2a8d6a5a69abc2e95d4d8c933d0f58f70a05b60a9bfd059
BLAKE2b-256 checksum
How to use checksums
920455e2ed5ca200943558bf9404f8a667ca464e089d825028630152dc696f95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / consist-0.4.0-py3-none-any.whl

Download URL consist-0.4.0-py3-none-any.whl
Size 652.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b663df7996eb22c0e30f94e3e4b3c0313e2deae455ccb1c486e930b0624763b
BLAKE2b-256 checksum
How to use checksums
08c62fb489f0e9f49d5cae34ba046eb8cfe7795210c5b986e2f02c0e7dd248ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Security for consist 0.4.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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