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.3.0.tar.gz (129.3 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.3.0-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claimkit-0.3.0.tar.gz
  • Upload date:
  • Size: 129.3 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.3.0.tar.gz
Algorithm Hash digest
SHA256 8306e1457a2f23d603dcb1af06a6d61574ae4f88710b2400528e73e2d3cdd04e
MD5 a2d419490e3a3a6618fd287316c7ff0c
BLAKE2b-256 a062e3589c3bbe8cfc4c602bd55c1eee9d846603ec6c081ea8737f89fa457628

See more details on using hashes here.

File details

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

File metadata

  • Download URL: claimkit-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 46.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb11abe4911ad3b9682616207720312e5b79c25a710fc8390a9475e3b5aaa882
MD5 f447bb443dfc3aec8d55064ea02b5f1f
BLAKE2b-256 1058753648926ef2722dae6ea48ccd8fac78a721c033ee2e6b910af8ff43204f

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