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.5.tar.gz (88.5 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.5-py3-none-any.whl (104.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hypernodes-0.4.5.tar.gz
Algorithm Hash digest
SHA256 e83842aa62abd3a688cc0c62261076b1bb7d8300970712e5721626a20acce0bd
MD5 74c388b9c839969bafde594e2e2267df
BLAKE2b-256 98444edbceba9eace0d516b10b02c11feeb7f6eb43882420a2cf8b308ffe29b1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hypernodes-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 56ab7c100e014282acf1801748de97eab234d13025b6aecdbc1131550aa507c8
MD5 c1f76eecbab9f31d1c8a4a9695108dc6
BLAKE2b-256 b9b1fb258291ea6b215e6e314372164a88479ae27cc64630cd0a48dbefebad72

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