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

HPCI Lab Logo

y2Graph

A simple Python tool to build W3C-PROV provenance graphs from workflow descriptions written in YAML.
Explore the docs »

Report Bug · Request Feature


Contributors Forks Stars Issues GPLv3 License

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:

pip install y2graph

Or:

git clone https://github.com/HPCI-Lab/y2Graph.git
cd y2Graph
pip install -r requirements.txt

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):

y2graph tmp.yaml

To create an example graph:

cd example_images
y2graph 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.3.tar.gz (10.5 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.3-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: y2graph-0.0.3.tar.gz
  • Upload date:
  • Size: 10.5 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.3.tar.gz
Algorithm Hash digest
SHA256 207f77e83468b60cf468220a3cde54ca2f88abd60f93558f1345d3abc03e1e21
MD5 7aa35a2eaa920ced5b2876537134e945
BLAKE2b-256 ae0361d3f9a62e74de9170f8a18ec092c9f7a5ad373e6660c97b69963df6c3f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: y2graph-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2d770c73982516fb644a356a986032e7d9eb08ee5c31d911c200872b092840c7
MD5 413d49225c86644ffeaa58f331c1c981
BLAKE2b-256 7fd8d916e3c6d506e2ce706cfc2e8985104d15c9b34a96f2ea10b56f7afb1ffd

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