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.2.0.tar.gz (125.7 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.2.0-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claimkit-0.2.0.tar.gz
  • Upload date:
  • Size: 125.7 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.2.0.tar.gz
Algorithm Hash digest
SHA256 e20a19348c6e11a608674a5a40810715bb6798e0bfa4124f10b1b1903cc4e03a
MD5 f15cb9454f38ae9234d8301132e79848
BLAKE2b-256 684ac413d7d0faf40e5d46900881b9618a5bb74b0d6ee21096162a975f02815c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: claimkit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 43.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05b7c1a7b8980d0ec40f6c8f90ba9feaacb6b439146cc319c566df57445cc825
MD5 80b7b88624c8b6126fad28d3de344009
BLAKE2b-256 b6848a214a8365264e132f044fd533d8a236dc353f75f06080914bdb9663ab36

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