Skip to main content

PDSSP Prov Toolkit

image

image

Shared W3C PROV-DM vocabulary, document helpers, and Graphviz/HTML rendering for FAIR-transformation provenance across PDSSP services.

Why this exists

Two PDSSP services (ode_stac_proxy, a live STAC proxy, and geocoding-api, an offline GeoPackage/OpenSearch pipeline) each expose a GET /prov endpoint describing how their own FAIR-transformed data is produced, as a W3C PROV-DM document. Both were built independently, before this package existed — and by the time it was extracted, each had grown its own, already-drifted copy of the same vocabulary and rendering code:

  • geocoding-api had added Subresource Integrity hashes pinning its Viz.js CDN scripts (a real security hardening) and wasInformedBy/ license/crs support — none of which had made it back into ode_stac_proxy.
  • ode_stac_proxy had added hadMember/hadPlan support — which had never made it into geocoding-api.

Neither service noticed the other's fixes, because there was nothing to notice — it was two copies, not one dependency. This package is that one dependency: the union of both, so a fix or an addition made once benefits every PDSSP service producing FAIR-transformation provenance, present or future.

What deliberately did not move here: each service's own document-assembly logic — which activities and entities its own pipeline has, and how they connect — stays in that service. A STAC proxy harvesting one live upstream and a batch pipeline harvesting several static sources into per-body GeoPackages don't share a pipeline shape, so forcing one here would fit neither well. What both actually needed identically is the vocabulary they build records with and the code that turns the finished document into a graph — that's the whole scope of this package.

Relationship to prov's own prov.dot

This package depends on prov, and prov already ships its own optional Graphviz export (prov.dot.prov_to_dot, via the prov[dot] extra) — doing, on paper, the same job as pdssp_prov_toolkit.dot. They even use the same node colours (#FFFC87/#9FB1FC/#FED37F), because both independently follow the same W3C PROV Primer / ProvToolbox convention. So why not just use it?

prov[dot] pdssp_prov_toolkit.dot
Extra dependency pydot + pyparsing none (plain string templating)
Long label/URL wrapping no — a long value renders as one unbroken line yes — this is why this module exists: an unwrapped long location once made a real graph too wide to read
Relation vocabulary every PROV-DM relation, n-ary relations, nested bundles, attribute-annotation nodes exactly the relations PDSSP's own document builders emit (Generation, Usage, Derivation, Association + hadPlan, Attribution, Delegation, Membership, Communication) — nothing else, because nothing else is ever produced
Output a pydot.Dot object a plain DOT string, ready for client-side rendering
HTML/Viz.js page not provided pdssp_prov_toolkit.html.render_prov_html — a full standalone page, SRI-pinned Viz.js, no server-side graphviz binary needed

In short: prov[dot] is the right choice for a general-purpose PROV-DM visualiser. This package is narrower on purpose — it only ever has to render what PDSSP's own toolkit-built documents contain — and adds the one thing that mattered enough in practice to justify not just calling prov[dot] directly: readable graphs when a label or URL is long.

Usage

from pdssp_prov_toolkit import (
    ProvAttr,
    ProvType,
    new_document,
    prov_to_dot,
    render_prov_html,
    resolve_agent,
    slug,
)

doc = new_document("https://example.org/api")
source = doc.entity(
    "source-data",
    {ProvAttr.TYPE: ProvType.COLLECTION, ProvAttr.LABEL: "Upstream source"},
)
mapping = doc.activity(
    "mapping", other_attributes={ProvAttr.TYPE: ProvType.ACTIVITY, ProvAttr.LABEL: "Mapping"}
)
doc.used(mapping, source)

# A Graphviz DOT string, ready to render client-side (see render_prov_html)
# or with any Graphviz-compatible tool.
dot = prov_to_dot(doc)

# A full standalone HTML page rendering that graph via Viz.js.
page = render_prov_html(dot=dot, base="https://example.org/api", subtitle_html="Whole catalog.")

See each module's own docstring (pdssp_prov_toolkit.vocab, .document, .dot, .html) for the full API.

Installing UV

To manage the dependencies of PDSSP Prov Toolkit, we use UV. If you don't have UV installed, follow these steps:

  1. Install UV:

    $ curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Verify the installation:

    $ uv --version
    

Please note that this project has been tested with UV version 0.9.15.

From sources

$ git clone https://gitlab.cnes.fr/pdssp/pdssp_prov_toolkit.git
$ cd pdssp_prov_toolkit
$ uv sync

Development

$ git clone https://gitlab.cnes.fr/pdssp/pdssp_prov_toolkit.git
$ cd pdssp_prov_toolkit
$ make prepare-dev
$ source .venv/bin/activate
$ make install-dev

To get more information about the preconfigured tasks:

$ make help

Run tests

$ make tests

Documentation

The documentation is automatically deployed on https://pdssp.io.cnes.fr/pdssp_prov_toolkit based on main branch

Author

👤 Jean-Christophe Malapert

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel free to check issues page. You can also take a look at the contributing guide

📝 License

This project is Apache V2.0 licensed.

Metadata

Release files for pdssp-prov-toolkit 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdssp-prov-toolkit 1.1.1
File Size Uploaded
pdssp_prov_toolkit-1.1.1.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pdssp-prov-toolkit 1.1.1
File Interpreter ABI Platform
pdssp_prov_toolkit-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.5 kB

Release files / pdssp_prov_toolkit-1.1.1.tar.gz

Download URL pdssp_prov_toolkit-1.1.1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
284f3f30c5ddef1c95f59218c162ff5ad7a268b798f2a48f436919a9af0ac929
BLAKE2b-256 checksum
How to use checksums
aa6b0ed157e0065e427c3de048f0ef70b4bffd6d6aba5d2018e5485cd573db21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release files / pdssp_prov_toolkit-1.1.1-py3-none-any.whl

Download URL pdssp_prov_toolkit-1.1.1-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40ccfd40d11a048f68a9c3bd4dc251da8841d0494de02b0dc43631333ed0f938
BLAKE2b-256 checksum
How to use checksums
9018ebaedd6d9264145ff09ff244f2c92d35a227963af9ef2e7e8bbdcf959d60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.1

2 release 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