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.2.tar.gz (69.6 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.2-py3-none-any.whl (82.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hypernodes-0.4.2.tar.gz
Algorithm Hash digest
SHA256 5ca74df40536e9bb60a53a6a7fb5fc197b5d172c54ff102045cd3a1e82b5db73
MD5 a41dee7b4f65b45fe9b78351e7ac515b
BLAKE2b-256 db7c5515a21630e5c119eba5edb0d19f8ef5d03f6815d1a0c4b26dd82b0ae3a5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hypernodes-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 edcc437e5175de0e5bb4c1d55080d9039f73156a65a9af021db797db679e2310
MD5 dbfc9547cc5a03b956b38dba6a18ebfd
BLAKE2b-256 2a88ac9cdab401f5913e0f79f3c0db9cb00675b937da2699379d3670668bd69c

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