Skip to main content

Consist

CI Python 3.11+ 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[ingest]"
pip install "consist[docker]"
pip install "consist[ibis]"

[!NOTE] Consist is pre-1.0. It is ready for real workflows, but minor releases may still include breaking changes while the API settles.

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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

consist-0.2.3.tar.gz (464.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

consist-0.2.3-py3-none-any.whl (514.8 kB view details)

Uploaded Python 3

File details

Details for the file consist-0.2.3.tar.gz.

File metadata

  • Download URL: consist-0.2.3.tar.gz
  • Upload date:
  • Size: 464.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for consist-0.2.3.tar.gz
Algorithm Hash digest
SHA256 971e506b09f8008d031c1d31d4d3fad305ccf84be39b82613a5489aae1e78eb2
MD5 8f15b9631d8f30c47f1d3d1d3b74317b
BLAKE2b-256 963a2fbfaf37c6dab6f5ac0a95d0957eb87b4d9541df68f1cb5d73e95c3a43bf

See more details on using hashes here.

File details

Details for the file consist-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: consist-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 514.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for consist-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2f2ea88c88ab8e5b6c5fd07eb6acbdb66682e3520a6137b6d878799f1ca9af66
MD5 82be552d443e83e3e73ba1fe1e25a61d
BLAKE2b-256 0e8d5a1b19507d59c0c77cdcf80c41b24e9ada022b07ace012812fa2cff7227c

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

This release

0.2.3 This release

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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