Metadata-Version: 2.4
Name: prov
Version: 3.3.0
Summary: A library for W3C Provenance Data Model supporting PROV-N, PROV-JSON, PROV-XML, PROV-O (RDF) and PROV-JSONLD
Author-email: Trung Dong Huynh <trungdong@donggiang.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/trungdong/prov
Project-URL: Documentation, https://prov.readthedocs.io
Project-URL: Repository, https://github.com/trungdong/prov
Project-URL: Issues, https://github.com/trungdong/prov/issues
Project-URL: Changelog, https://prov.readthedocs.io/en/latest/history.html
Project-URL: Discussions, https://github.com/trungdong/prov/discussions
Keywords: provenance,graph,model,PROV,PROV-DM,PROV-JSON,W3C,PROV-XML,PROV-N,PROV-O,RDF,PROV-JSONLD,JSON-LD
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Security
Classifier: Topic :: System :: Logging
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: rdf
Requires-Dist: rdflib<8,>=7.0.0; extra == "rdf"
Provides-Extra: xml
Requires-Dist: lxml>=3.3.5; extra == "xml"
Provides-Extra: dot
Requires-Dist: pydot>=1.2.0; extra == "dot"
Requires-Dist: networkx>=2.0; extra == "dot"
Provides-Extra: graph
Requires-Dist: networkx>=2.0; extra == "graph"
Provides-Extra: plot
Requires-Dist: matplotlib>=3.6; extra == "plot"
Requires-Dist: pydot>=1.2.0; extra == "plot"
Requires-Dist: networkx>=2.0; extra == "plot"
Provides-Extra: pygments
Requires-Dist: pygments>=2.13; extra == "pygments"
Dynamic: license-file

# prov

[![Latest Release](https://badge.fury.io/py/prov.svg)](https://badge.fury.io/py/prov)
[![License](https://img.shields.io/pypi/l/prov.svg)](https://pypi.org/project/prov/)
[![CI Status](https://github.com/trungdong/prov/workflows/CI/badge.svg)](https://github.com/trungdong/prov/actions?workflow=CI)
[![Coverage Status](https://img.shields.io/coveralls/trungdong/prov.svg)](https://coveralls.io/r/trungdong/prov?branch=main)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/73bdf6dda3884abf9f5e79352c07e66c)](https://app.codacy.com/gh/trungdong/prov/dashboard)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22696001.svg)](https://doi.org/10.5281/zenodo.22696001)
[![Supported Python version](https://img.shields.io/pypi/pyversions/prov.svg)](https://pypi.org/project/prov/)

A Python implementation of the [W3C PROV Data Model](https://www.w3.org/TR/prov-dm/), 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

```bash
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](https://prov.readthedocs.io/en/latest/installation.html).

## Quick start

```python
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")
```

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

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

The [tutorial](https://prov.readthedocs.io/en/latest/tutorial/getting-started.html) continues from here.

## Features

- In-memory classes for every PROV-DM record type, readable from and printable as
  [PROV-N](https://www.w3.org/TR/prov-n/).
- Serialization to and from [PROV-N](https://www.w3.org/TR/prov-n/),
  [PROV-JSON](https://www.w3.org/submissions/prov-json/),
  [PROV-JSONLD](https://www.w3.org/submissions/prov-jsonld/),
  [PROV-XML](https://www.w3.org/TR/prov-xml/) and [PROV-O](https://www.w3.org/TR/prov-o/) (RDF).
- Export to graphical formats such as PDF, PNG and SVG through Graphviz.
- Conversion to and from a [NetworkX](https://networkx.org/) `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](https://github.com/trungdong/prov/network/dependents).
[What's new in 3](https://prov.readthedocs.io/en/latest/whats-new-3.html) summarises the 3.x
line, and the [announcement post](https://trungdong.github.io/provpy-3.html) explains the move.
[ROADMAP.md](https://github.com/trungdong/prov/blob/main/ROADMAP.md) lists the planned releases,
[SECURITY.md](https://github.com/trungdong/prov/blob/main/SECURITY.md) the supported versions,
and the [issue tracker](https://github.com/trungdong/prov/issues) takes feedback.
