Skip to main content

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

output_graph

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

y2graph-0.0.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

y2graph-0.0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file y2graph-0.0.1.tar.gz.

File metadata

  • Download URL: y2graph-0.0.1.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

Hashes for y2graph-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c5e933907e78e7a9360a074502770c4271a84e261f07beabaa3c83f069704141
MD5 acbe9bbf0a0878f5107f6bd9b23e8755
BLAKE2b-256 4e89d98357dc251ba2f95b5cf169e904101c34cfe5b94505786f308d005416e7

See more details on using hashes here.

File details

Details for the file y2graph-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: y2graph-0.0.1-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

Hashes for y2graph-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe254951f2723945af34cf66c30983315012322e2e8165ae86a1e0a341ee04c1
MD5 5239e286d843b42564358b247ce7133c
BLAKE2b-256 6aad81d4305ce963e909b3c0d7fbb76808c11f091a3f9e833f046f6e2ad4fc19

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page