Skip to content

scinode/node-graph

Repository files navigation

ndoe-graph logo

Build data-driven workflows with clean provenance and a friendly syntax.

PyPI version CI status codecov Docs status

Documentation

Please refer to online docs.

Examples

A simple math calculation

from node_graph import task

@task()
def add(x, y):
    return x + y

@task()
def multiply(x, y):
    return x * y

@task.graph()
def AddMultiply(x, y, z):
    the_sum = add(x=x, y=y).result
    return multiply(x=the_sum, y=z).result

Engines and provenance

Explore different execution engines in node-graph-engine.

Run the above graph locally with the LocalEngine and export the provenance graph:

from node_graph.engine.local import LocalEngine

graph = AddMultiply.build(x=1, y=2, z=3)

engine = LocalEngine()
results = engine.run(graph)
# export provenance for visualization
engine.recorder.save_graphviz_svg("add_multiply.svg")

Provenance graph example

License

MIT

About

Create node-based workflow with data provenance

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages