Skip to main content

pypegraph

Pypegraph is a python library to create directed acyclic graphs (DAG) that represent data processing pipelines. In a pypegraph graph, each node contains a function wich output is sendend to the connected nodes and are used as input of those nodes's functions.

Installation

pip install pypegraph

Common usage

node1 = Node(lambda: print("Node1 is executing"), name="Node1")
node2 = Node(lambda: print("Node2 is executing"), name="Node2")

node1 |= node2  # connect both nodes node1 -> node2

outputs = node1()  # dictionary with each node outputs
node1_output = outputs[node1]  # None in this case because it does not return anything
node2_output = outputs[node2]  # None also

You can connect one node's output to a named parameter of another node's function input

def foo(n):
  return n
def square(number):
  return number * number
node1 = Node(foo, name="Node1")
node2 = Node(square, name="Node2")

node1 |= (node2, "number")  # connect both nodes with a connection name
outputs = node1(2)
node2_output = outputs[node2]  # should be 4

Connections

You can connect nodes in several ways

node1 = Node(lambda: print("Node1 is executing"), name="Node1")
node2 = Node(lambda: print("Node2 is executing"), name="Node2")

# you can do
n1 = n1 | n2
# or
n1 |= n2
# or
n1.connect(n2)

# nodes can be disconnected with
n1.disconnect(n2)

Metadata

Release files for pypegraph 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypegraph 0.1.7
File Size Uploaded
pypegraph-0.1.7.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypegraph 0.1.7
File Interpreter ABI Platform
pypegraph-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / pypegraph-0.1.7.tar.gz

Download URL pypegraph-0.1.7.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b468ae888374c43d479c9a929cedbdbcd4e0cf4848e6e6384b217d0722e5c8f6
BLAKE2b-256 checksum
How to use checksums
5e0941d199057bba49f2d38ba8a4b6e7e7acc13e96163f778d8303eef78fd616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / pypegraph-0.1.7-py3-none-any.whl

Download URL pypegraph-0.1.7-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d7cb95ccd102c981617f33dbea0c9e1a7482ae9794fdd82486b7031addf710f
BLAKE2b-256 checksum
How to use checksums
71e98d2c2b1f600e7e3c494d394c48c5b1dc71a355c0c16bf91e6713b8cdc900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page