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.1.0.tar.gz (122.2 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.1.0-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claimkit-0.1.0.tar.gz
  • Upload date:
  • Size: 122.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 bcc1d01b5311e28350e1efa500b8ba885720b75732e84515ac557588d607bf82
MD5 1caa22a2e76806a8e467eabcd5fc9d2e
BLAKE2b-256 767474d292444cc7f7da4ed83533920cc35e47ef1f15f7ca5feb0e348d28eef1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: claimkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2b831712c05237d5856314f487f62fab40426f1b411dcfd1680bea190e7a4a2
MD5 67df40e5ec8d7694044c2f46c162d5ee
BLAKE2b-256 59817c4c586385bdb727cd632860cc7c2ec34d9abf09380bb1a10e5254e12b8e

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