Skip to main content

pypi python-version build-status license

pyungo is a lightweight library to link a set of dependent functions together, and execute them in an ordered manner.

pyungo is built around Graphs and Nodes used in a DAG (Directed Acyclic Graph). A Node represent a function being run with a defined set of inputs and returning one or several outputs. A Graph is a collection of Nodes where data can flow in an logical manner, the output of one node serving as input of another.

installation

>> pip install pyungo

simple example

graph = Graph()

@graph.register()
def f_my_function_2(d, a):
    e = d - a
    return e

@graph.register()
def f_my_function_1(c):
    d = c / 10
    return d

@graph.register()
def f_my_function_3(a, b):
    c = a + b
    return c

res = graph.calculate(data={'a': 2, 'b': 3})
print(res)

pyungo is registering the functions at import time. It then resolve the DAG and figure out the sequence at which the functions have to be run per their inputs / outputs. In this case, it will be function 3 then 1 and finally 2.

The ordered Graph is run with calculate, with the given data. It returns the output of the last function being run (e), but all intermediate results are also available in the graph instance.

The result will be (a + b) / 10 - a = -1.5

Release files for pyungo 0.9.0

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

Source distribution (sdist)

Source distribution for pyungo 0.9.0
File Size Uploaded
pyungo-0.9.0.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyungo 0.9.0
File Interpreter ABI Platform
pyungo-0.9.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 21.1 kB

Release files / pyungo-0.9.0.tar.gz

Download URL pyungo-0.9.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1a713df94dd8704bbe1c2587676568d6968fc55be06fb88e26fad7844ec58303
BLAKE2b-256 checksum
How to use checksums
874a71cb4fab712dbffe6c1335a28377d2021778a51f78c4ce8dfe4f9c705573
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release files / pyungo-0.9.0-py2.py3-none-any.whl

Download URL pyungo-0.9.0-py2.py3-none-any.whl
Size 11.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
773eddf38f7d703a510f0ca1b4d2a59ef3d8cfcdfa06e3d472d7ed48e8170645
BLAKE2b-256 checksum
How to use checksums
ff0eb6d69990a521e174ca95495db582df5a763c625f922743545b05fb8a2d6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.1

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

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