y2Graph (yaml to graph) is a simple Python tool to build W3C-PROV provenance graphs from workflow descriptions written in YAML. It uses the prov library to create entities, activities, and their relationships, and can export the results to PROV-JSON and a graph visualization (PNG).
Project description
y2Graph
y2Graph (yaml to graph) is a simple Python tool to build W3C-PROV provenance graphs from workflow descriptions written in YAML. It uses the prov library to create entities, activities, and their relationships, and can export the results to PROV-JSON and a graph visualization (PNG).
This is useful when having to create large provenance graphs without needing to re-run the entire workflow.
Features
- Define workflows in a simple YAML file
- Each task specifies:
- inputs (UUIDs representing files or data items)
- outputs (UUIDs for generated results)
- Automatically constructs a PROV document linking tasks and data
- Export to:
- prov.json (standard W3C PROV format)
- PNG graph (requires Graphviz)
Installation
Check out the yProv4ML documentation page to install graphviz.
Then:
git clone https://github.com/HPCI-Lab/y2Graph.git
cd y2Graph
pip install -r requirements.txt
Or:
pip install y2graph
Example YAML Workflow
tasks:
- id: task1
label: "Load Data"
attributes:
- timestamp: 12345
- context: "training"
inputs: []
outputs:
- "uuid-1234"
- id: task2
label: "Process Data"
attributes:
- timestamp: 456677
inputs:
- "uuid-1234"
outputs:
- "uuid-5678"
- id: task3
label: "Analyze Results"
inputs:
- "uuid-5678"
outputs:
- "uuid-9999"
To create the graph corresponding to the previous code (file named tmp.yaml):
python run.py tmp.yaml
To create an example graph:
cd example_images
python ../run.py example.yaml
📂 Output
- output_prov.json: PROV-JSON representation of the workflow
- output_graph.pdf: Graph visualization of tasks and data flow
Documentation
For detailed information, please refer to the Documentation
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file y2graph-0.0.2.tar.gz.
File metadata
- Download URL: y2graph-0.0.2.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afb27f6e5878f5bef8e22c5684da2c6479856640e81c495b24fe3baa8548c897
|
|
| MD5 |
2b3fa2a4ec324bda9adc15df13350857
|
|
| BLAKE2b-256 |
a4bc56beef0e73cf93d77251a4287d64a787c3e5b0183825cca40e044a6eba9a
|
File details
Details for the file y2graph-0.0.2-py3-none-any.whl.
File metadata
- Download URL: y2graph-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae216bd2ce07a0921556cf8dd10d4026da19d72451bf2747df8d09ff1e3e6902
|
|
| MD5 |
8df9f1da314c65d69115f008375f88cb
|
|
| BLAKE2b-256 |
104edc1e241d0e3acbde43e4946680e99ee434124c2e3bf64d460d10f9ea8443
|