Skip to content
trungdongPublic

About

A Python library for W3C Provenance Data Model (PROV)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

145 stars

Watchers

7 watching

Forks

Latest commit

 

History

1,946 Commits

Folders and files

Repository files navigation

prov

Latest Release License CI Status Coverage Status Codacy Badge DOI Supported Python version

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 https://prov.readthedocs.io/.

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.
  • Command-line tools, prov-convert and prov-compare.

Over 7,000 public repositories on GitHub 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.

About

A Python library for W3C Provenance Data Model (PROV)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

145 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages