Profile
Back to NewsBack
GitHub Trending 2 min
Reader Mode
trungdong/prov: A Python library for W3C Provenance Data Model (PROV)

trungdong/prov: A Python library for W3C Provenance Data Model (PROV)

9 hours ago

prov

Latest Release</a> License</a> CI Status</a> Coverage Status</a> Codacy Badge</a> DOI</a> Supported Python version</a>

A Python implementation of the W3C PROV Data Model, with import and export in PROV-N, PROV-JSON, PROV-JSONLD, PROV-XML and PROV-O (RDF). It is MIT-licensed, needs Python 3.11 or later, and is documented at .

Install

pip install prov

PROV-JSON, PROV-N and PROV-JSONLD need nothing else; PROV-XML, PROV-O and the graph tools each need an extra, listed on the installation page.

Quick start

import prov.model as pm

doc = pm.ProvDocument() doc.set_default_namespace("https://example.org/") doc.entity("report") doc.activity("analysis") doc.wasGeneratedBy("report", "analysis") print(doc.get_provn()) doc.serialize("report.json")

document
  default <https://example.org/>

entity(report) activity(analysis, -, -) wasGeneratedBy(report, analysis, -) endDocument

The tutorial continues from here.

Features

  • In-memory classes for every PROV-DM record type, readable from and printable as
PROV-N.
  • Serialization to and from PROV-N,
PROV-JSON, PROV-JSONLD, PROV-XML and PROV-O (RDF).
  • Export to graphical formats such as PDF, PNG and SVG through Graphviz.
  • Conversion to and from a NetworkX MultiDiGraph.
  • PROV-N syntax highlighting through a Pygments lexer, with the pygments extra.
  • Command-line tools, prov-convert and prov-compare.
GitHub lists the public repositories that depend on this package. What's new in 3 summarises the 3.x line, and the announcement post explains the move. ROADMAP.md lists the planned releases, SECURITY.md the supported versions, and the issue tracker takes feedback.
Chat with me