Skip to main content

A hierarchical, modular pipeline system for ML/AI workflows

Project description

hypernodes

[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:


🚀 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hypernodes-0.4.6.tar.gz (97.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hypernodes-0.4.6-py3-none-any.whl (114.3 kB view details)

Uploaded Python 3

File details

Details for the file hypernodes-0.4.6.tar.gz.

File metadata

  • Download URL: hypernodes-0.4.6.tar.gz
  • Upload date:
  • Size: 97.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for hypernodes-0.4.6.tar.gz
Algorithm Hash digest
SHA256 e3ce590a886474e47bc8e17439c07e9cd5088177ef25ac1f04254e02c544f31d
MD5 5d361dc94a56e4eb41c1252c76fae5e2
BLAKE2b-256 10c63f479e5c60b666afd3735ceba8b10e386cacde38ef5be9c7f1c7da1bf263

See more details on using hashes here.

File details

Details for the file hypernodes-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: hypernodes-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 114.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for hypernodes-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 748a28108a650a48394866a94332a357ed0de67f0c832858cda86cf19bf0fe2a
MD5 487a89af64fe644f86eb94875d4884a4
BLAKE2b-256 9a77e885bb529aa52eccf8237cbd43823aeb86cbbba1922113323e4127b6ebec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page