A hierarchical, modular pipeline system for ML/AI workflows
Project description
[Installation] | [Documentation] | [License]
HyperNodes
Hierarchical, Modular Data Pipelines for AI/ML
HyperNodes is designed to make building complex data pipelines intuitive and scalable. It starts with a simple premise: define your logic on single items, then compose and scale.
✨ Key Features
Simplicity First: Think Singular
Define your functions and pipelines as if they are processing a single item (e.g., one PDF, one audio file, one text string). This makes your code:
- Easy to grasp: No complex loops or batch logic cluttering your business logic.
- Testable: Write standard unit tests for individual functions.
- Debuggable: Step through your code easily.
🪆 Hierarchical Composition
Once you have your building blocks, compose them into progressively more complex pipelines.
- Nesting: Pipelines are nodes. You can use a pipeline as a node inside another pipeline.
- Mapping: Seamlessly apply a pipeline over a list of inputs using
.map(). - Visual: Always keep one level of understanding. Look at the high-level flow, then dive deeper into specific sub-pipelines as needed.
Structured Data & Protocols
HyperNodes integrates deeply with Pydantic and dataclasses. Define reusable protocols and data structures to ensure type safety and clarity throughout your pipeline. This leads to a codebase that is easy to maintain and extend.
🚀 Powered by Daft: Performance & Caching
When you're ready to scale, HyperNodes leverages Daft as its computation engine.
- Distributed Execution: Run on your laptop or a cluster without changing code.
- Intelligent Caching: Caching is a first-class citizen. Daft handles distributed caching, ensuring you only recompute what's necessary.
💡 Inspiration
HyperNodes stands on the shoulders of giants. It was inspired by and grew from working with:
- Pipefunc: For its elegant approach to function composition.
- Apache Hamilton: For its paradigm of defining dataflows using standard Python functions.
HyperNodes aims to bring native support for hierarchical pipelines and advanced caching to this ecosystem.
📚 Documentation
The full documentation is available in the docs/ directory:
- Introduction & Quick Start
- Core Concepts
- Data Processing
- Scaling & Optimization
- Observability
🚀 Quick Start
Installation
pip install hypernodes
# or with uv
uv add hypernodes
Basic Example
from hypernodes import Pipeline, node
# 1. Define functions on a single item
@node(output_name="cleaned_text")
def clean_text(passage: str) -> str:
return passage.strip().lower()
@node(output_name="word_count")
def count_words(cleaned_text: str) -> int:
return len(cleaned_text.split())
# 2. Build pipeline
pipeline = Pipeline(nodes=[clean_text, count_words])
# 3. Test with single input
result = pipeline.run(inputs={"passage": "Hello World"})
print(result) # {'cleaned_text': 'hello world', 'word_count': 2}
# 4. Scale with .map()
results = pipeline.map(
inputs={"passage": ["Hello", "World", "Foo", "Bar"]},
map_over="passage",
)
High-Performance Execution with Daft
from hypernodes import Pipeline
from hypernodes.engines import DaftEngine
# Distributed execution using Daft
# Requires: pip install getdaft
engine = DaftEngine(use_batch_udf=True)
pipeline = Pipeline(nodes=[clean_text, count_words], engine=engine)
# Auto-batches and executes in parallel
# Each item is cached independently
results = pipeline.map(
inputs={"passage": ["Hello", "World"] * 1000},
map_over="passage"
)
📄 License
MIT License - see LICENSE file for details.
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 hypernodes-0.4.4.tar.gz.
File metadata
- Download URL: hypernodes-0.4.4.tar.gz
- Upload date:
- Size: 75.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
058d67a0d1960c1e94c78e148dc8fb1beaa4c0397d3f7a16834fdbfe144b9fd3
|
|
| MD5 |
cad1603187f318acaa8c6b29a1b3a709
|
|
| BLAKE2b-256 |
5b2f647ce0ef0aeb27a79fb602efe28a1db15503408275fded78f1325b9d96d1
|
File details
Details for the file hypernodes-0.4.4-py3-none-any.whl.
File metadata
- Download URL: hypernodes-0.4.4-py3-none-any.whl
- Upload date:
- Size: 86.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46276f8d54f7095e504ed1dff2add37ceb2020ffd2aff1be0872d5785b371cdf
|
|
| MD5 |
5ee6bb3abb010dbacadc61c57c8efd12
|
|
| BLAKE2b-256 |
051754572440e085426872e147b7ec80d14da35cf7740ea7396b55507e6e2075
|