A lightweight, type-hint driven engine for executing Directed Acyclic Graphs (DAGs) and lockstep pipelines in Python.
Project description
SynaFlow 🌊🧠
📖 Full documentation: humansoftware.github.io/synaflow
Write plain Python functions. SynaFlow builds the pipeline for you.
SynaFlow is a lightweight, pure-Python pipeline engine that uses Type Hints to automatically wire and execute Directed Acyclic Graphs (DAGs) with lockstep streaming.
Why the name? Synapse + Flow. Just like synapses automatically wire neurons together, SynaFlow automatically wires your functions together based on their types. "Flow" represents the lazy, streaming nature of how data moves through those connections.
Quickstart
from collections.abc import Generator, Iterator
from typing import NamedTuple
from synaflow import pipeline, step, run
class Params(NamedTuple):
count: int
def producer(count: int) -> Generator[int, None, None]:
yield from range(count)
def transformer(producer: Iterator[int]) -> Generator[int, None, None]:
for val in producer:
yield val * 10
def consumer(transformer: Iterator[int]) -> None:
for x in transformer:
print(f"Consumed: {x}")
p = pipeline(
name="example",
params=Params,
steps=[
step("producer", fn=producer),
step("transformer", fn=transformer),
step("consumer", fn=consumer),
],
)
run(p, Params(count=5))
Three functions, three step() calls, zero manual wiring. SynaFlow reads the
type hints and wires the DAG automatically.
What makes it different
Type-hint wiring
Parameter names match producer names — SynaFlow connects them automatically.
Singular/plural/suffix synonyms work too (item → items, user_list → users).
Lazy streaming with zero boilerplate
Multiple consumers of the same producer? SynaFlow forks the stream with
itertools.tee and advances them in lockstep. One consumer can stream lazily
while another materializes — no manual tee, no memory spikes.
Static validation at build time
Type errors, missing dependencies, circular graphs, mode conflicts — all caught
when pipeline(...) is called. If it compiles, it's valid. No runtime surprises.
Build your own runner
The DAG compiles to a deterministic JSON contract. Write custom runners or auto-generate native DAGs for Airflow, Prefect, or Dagster.
How it compares
| SynaFlow | Hamilton | Airflow / Prefect / Dagster | |
|---|---|---|---|
| Auto wiring | ✅ type hints + smart binding | ✅ type hints (exact names) | ❌ explicit A >> B |
| Lazy streaming | ✅ lockstep tee | ❌ DataFrame-centric | ❌ task-based |
| Smart binding | ✅ singular/plural/suffix | ❌ | ❌ |
| Scope | In-process micro | Feature engineering | Cluster orchestration |
| DAG export | ✅ JSON | ✅ | ✅ |
| Sync/async parity | ✅ identical | ❌ | ✅ |
Detailed comparisons: Hamilton · Java Streams · LINQ
Installation
pip install synaflow
Documentation
Start here: humansoftware.github.io/synaflow
| Section | Description |
|---|---|
| Tutorial | 5-level step-by-step guide building a pipeline from scratch |
| Core Concepts | How the DAG is wired, lockstep flow, build vs run, event-based processing |
| Examples | Every corpus pipeline with auto-generated diagrams and source code |
| Comparisons | Detailed comparisons with Hamilton, Java Streams, and LINQ |
| Design Philosophy | Architectural decisions, contracts, and design rationale |
License
MIT License
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
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 synaflow-0.15.0.tar.gz.
File metadata
- Download URL: synaflow-0.15.0.tar.gz
- Upload date:
- Size: 179.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b18165b6ed702c61a41ab2ee48d4d5302bb4e8df501d68a02220b238a454cee
|
|
| MD5 |
6406c8c91ba2c5b4d0fc3bd50af9cf6a
|
|
| BLAKE2b-256 |
b68d9e01c374efab40403770218240b0e746bb7b0ae204a3de694fb2775940c7
|
Provenance
The following attestation bundles were made for synaflow-0.15.0.tar.gz:
Publisher:
release.yml on humansoftware/synaflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synaflow-0.15.0.tar.gz -
Subject digest:
8b18165b6ed702c61a41ab2ee48d4d5302bb4e8df501d68a02220b238a454cee - Sigstore transparency entry: 1826334981
- Sigstore integration time:
-
Permalink:
humansoftware/synaflow@50825eb4ff89f5fcf4acbc4d5c1cf5d38c2e85de -
Branch / Tag:
refs/heads/main - Owner: https://github.com/humansoftware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@50825eb4ff89f5fcf4acbc4d5c1cf5d38c2e85de -
Trigger Event:
push
-
Statement type:
File details
Details for the file synaflow-0.15.0-py3-none-any.whl.
File metadata
- Download URL: synaflow-0.15.0-py3-none-any.whl
- Upload date:
- Size: 37.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66c0f3b23601687f253c00c76807a68d4185687ecd8d9a0f13b5f7d6af6965a2
|
|
| MD5 |
35a6340f3b1f7f602a9e52d0a3d76326
|
|
| BLAKE2b-256 |
69f042bbcf5419eda122fa4f1f4958d98fc6ce1dab72703ab7c5784d4ca28527
|
Provenance
The following attestation bundles were made for synaflow-0.15.0-py3-none-any.whl:
Publisher:
release.yml on humansoftware/synaflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synaflow-0.15.0-py3-none-any.whl -
Subject digest:
66c0f3b23601687f253c00c76807a68d4185687ecd8d9a0f13b5f7d6af6965a2 - Sigstore transparency entry: 1826334998
- Sigstore integration time:
-
Permalink:
humansoftware/synaflow@50825eb4ff89f5fcf4acbc4d5c1cf5d38c2e85de -
Branch / Tag:
refs/heads/main - Owner: https://github.com/humansoftware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@50825eb4ff89f5fcf4acbc4d5c1cf5d38c2e85de -
Trigger Event:
push
-
Statement type: