PyFutureDAG
A simple, lightweight Python DAG implementation using asyncio futures, in the style of C++ folly FutureDAG.
Installation
pip install pyfuturedag
Demo
"""
1 - 3
/ \
0 4
\ /
2
"""
from pyfuturedag import FutureDAG, Node
# example of a function
def print_func(num):
print("printing", num)
# initialize dag
dag = FutureDAG()
# create nodes - Node(func, args)
node_0 = Node(print_func, "0")
node_0_idx = dag.add(node_0)
node_1 = Node(print_func, "1")
node_1_idx = dag.add(node_1)
node_2 = Node(print_func, "2")
node_2_idx = dag.add(node_2)
node_3 = Node(print_func, "3")
node_3_idx = dag.add(node_3)
node_4 = Node(print_func, "4")
node_4_idx = dag.add(node_4)
# specify dependency
dag.dependency(node_0_idx, node_1_idx)
dag.dependency(node_0_idx, node_2_idx)
dag.dependency(node_1_idx, node_3_idx)
dag.dependency(node_2_idx, node_4_idx)
dag.dependency(node_3_idx, node_4_idx)
# run dag
dag.loop.run_until_complete(dag.go())
Test
Simply run pytest to run tests.
Metadata
Release files for pyfuturedag 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyfuturedag-0.0.1.tar.gz | 4.9 kB | Without provenance | Details for pyfuturedag-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyfuturedag-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for pyfuturedag-0.0.1-py3-none-any.whl |
Total release size: 9.9 kB
Release files / pyfuturedag-0.0.1.tar.gz
| Download URL | pyfuturedag-0.0.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
483a2d143d4b3b501e1ea57f5bedf03c1545e0b7a59edf554b48dca49788372d
|
|
BLAKE2b-256 checksum How to use checksums |
ac5a5481794c04dbe86e971c826be1679892fba7d65c10e4302d895481eb0763
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.10
|
Release files / pyfuturedag-0.0.1-py3-none-any.whl
| Download URL | pyfuturedag-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbd4c2230c6cef5d8c3933665298d33bdc0fb90a728dc0e78a2e325e8802fcc0
|
|
BLAKE2b-256 checksum How to use checksums |
d6767a7f4a5f809ae41d19b2091a46df4550091a4f5c214d85ce4abd6c82d772
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.10
|
Security for pyfuturedag 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.