Skip to main content

A claim-level provenance framework for scientific research

Project description

ClaimKit

Python CI pre-commit.ci status Documentation Status codecov PyPI Version Python Versions License Ruff DOI SPEC 0 — Minimum Supported Dependencies

ClaimKit is a claim-level provenance framework for scientific research.

It makes every scientific claim, numerical result, figure, and table traceable to the evidence that supports it. A claim registered in ClaimKit has a well-defined provenance, can be validated against its current evidence, and is flagged as stale when that evidence changes. ClaimKit is designed to be both human- and agent-friendly, with stable machine-readable interfaces throughout.

ClaimKit does not replace workflow managers, experiment trackers, version control, or manuscript tools — it links to and builds on them.

Core concepts

  • Claim — a scientific assertion with a stable id and a validation status.
  • Evidence — a link from a claim to an artefact (code, data, a run, literature, …) that supports, refutes, or contextualises it.
  • Activity — a process (computation, measurement, analysis, review) that consumed and produced artefacts.
  • ProvenanceRelation — a typed, directed edge connecting claims, evidence, activities, artefacts, and agents into a graph.
  • ProvenanceGraph — the container of nodes and edges; supports traversal, validation, staleness detection, and reporting.

A claim's status is one of unresolved, valid, invalid, stale, or needs_review.

Installation

pip install claimkit

Requires Python 3.12+.

Command-line quickstart

Build a graph, link evidence, and check it — all from the terminal:

claimkit init graph.json
CLAIM=$(claimkit add-claim graph.json "Half-life measured at 5.2 days." --tag decay)
claimkit add-evidence graph.json "$CLAIM" \
    --kind workflow --reference run-42 --digest sha256:abc123

claimkit validate graph.json            # resolve status from evidence
claimkit stale graph.json               # flag claims whose artefacts changed
claimkit report graph.json              # human-readable Markdown report
claimkit export graph.json -o prov.json # export to W3C PROV-JSON
claimkit import prov.json restored.json # import PROV-JSON back into a graph

validate and stale accept --json for machine-readable output; report and export accept -o to write to a file. Run claimkit --help for the full command list.

Python quickstart

from claimkit import (
    Claim, Evidence, EvidenceKind, NodeType,
    ProvenanceGraph, ProvenancePredicate, ProvenanceRelation,
    validate_claim, render_report,
)

graph = ProvenanceGraph()
graph.add_claim(Claim(statement="Half-life measured at 5.2 days.", id="c1"))
graph.add_evidence(
    Evidence(claim_id="c1", kind=EvidenceKind.WORKFLOW, reference="run-42", id="e1")
)
graph.add_relation(
    ProvenanceRelation(
        subject_type=NodeType.CLAIM, subject_id="c1",
        predicate=ProvenancePredicate.SUPPORTED_BY,
        object_type=NodeType.EVIDENCE, object_id="e1",
    )
)

result = validate_claim(graph, "c1")
print(result.status, "—", result.reason)   # valid — supported by 1 piece(s) of evidence
print(render_report(graph))

Interoperability

ClaimKit graphs serialise to a versioned JSON format for storage (save_graph / load_graph) and export to / import from W3C PROV-JSON (to_prov / from_prov) for interchange with the wider provenance ecosystem.

License

BSD 3-Clause. See LICENSE.

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

claimkit-0.4.0.tar.gz (286.9 kB view details)

Uploaded Source

Built Distribution

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

claimkit-0.4.0-py3-none-any.whl (202.1 kB view details)

Uploaded Python 3

File details

Details for the file claimkit-0.4.0.tar.gz.

File metadata

  • Download URL: claimkit-0.4.0.tar.gz
  • Upload date:
  • Size: 286.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for claimkit-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c209a7e4a9d27fbcc6f47afce2b63d582c32c6c6a6d8c07ec5a97133c9ca92c3
MD5 d7843b7f1923e71c1a65ed4738fb652a
BLAKE2b-256 82c659444d68318c7988907fd18e2a1f67dd95b454815c5fb770fc84c80c09f2

See more details on using hashes here.

File details

Details for the file claimkit-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: claimkit-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 202.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for claimkit-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 375b60e5324d648da8302b741fd6a4a968f9d6cecdcd54bf77f218ffa04a24f7
MD5 806d0052ad4fa05d02175b68eaa266bf
BLAKE2b-256 8b8b2f056583aa2fa91a28e43bc859cf157ce7b665d0c92c677f6216297221df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page