Mimimal DAG implementation with Python
Project description
Tiny DAG
Bare bones implementation of computation (directed, acyclic) graph for Python.
Requirements
- Python >= 3.6
- graphviz
Usage example
from tinydag.graph import Graph
from tinydag.node import Node
add = lambda a, b: a + b
mul = lambda a, b: a * b
div = lambda a, b: a / b
nodes = [
Node(["add1", "x"], add, "add2"),
Node(["add1", "add2"], mul, "mul"),
Node(["x", "y"], add, "add1"),
Node(["mul", "z"], div, "div"),
]
graph = Graph(nodes)
graph.render()
data = {"x": 5, "y": 3, "z": 3}
results = graph.calculate(data)
render method produces following figure:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tiny-dag-0.0.1.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tiny-dag-0.0.1.tar.gz.
File metadata
- Download URL: tiny-dag-0.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5045b44b91aef541fd5ef720413a200ae49ea5cc1d38c985827b271d4cef4737
|
|
| MD5 |
0b1b6aabaf1d172bcee6dc15e7cec600
|
|
| BLAKE2b-256 |
b3d4de8a8dd47656ea956bcbda3b075be5080b9a7dcbacf076fe45ae987208bc
|
File details
Details for the file tiny_dag-0.0.1-py3-none-any.whl.
File metadata
- Download URL: tiny_dag-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff2af700654f31bf3290d72f6e6a7d414bc5b8513871fd5bedd11e2782b0a562
|
|
| MD5 |
ca35a999c0a40bbc7fb27aabcb90880a
|
|
| BLAKE2b-256 |
64718cd134dcd7f0dbb99a256726d9df4fa0d2209f8479c589ad4d2abf2a7d36
|