Socket
Book a DemoInstallSign in
Socket

node-graph

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-graph

Create node-based workflow

Source
pipPyPI
Version
0.5.2
Maintainers
1
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

Keywords

graph

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts