Skip to main content

Modular, benchmarkable pipeline framework

Project description

Pipetree Logo

Pipetree

A modular, benchmarkable pipeline framework for large document processing.

CI Python 3.14 License: O'Saasy


Pipetree gives you capability-based contracts, streaming execution, async support, checkpointing, pluggable implementations via a registry, and built-in A/B benchmarking — all wired together with a clean DSL.

Monitor your pipelines and benchmark results in real-time at pipetree.io.

Quick Start

cd pipetree
pipenv install --dev
pipenv run pip install -e .
import asyncio
from pipetree import step, pipeline, Step, Context

@step(requires={"input"}, provides={"words"})
class Split(Step):
    def run(self, ctx: Context) -> Context:
        ctx["words"] = ctx["input"].split()
        return ctx

@step(requires={"words"}, provides={"output"})
class Shout(Step):
    def run(self, ctx: Context) -> Context:
        ctx["output"] = "_".join(w.upper() for w in ctx["words"])
        return ctx

result = asyncio.run(pipeline("demo", [Split, Shout]).run({"input": "hello world"}))
# result["output"] == "HELLO_WORLD"

Benchmarking

Register multiple implementations of the same capability, then A/B test them:

from pipetree import step, Step, Context, Capability, Registry, BenchRunner

@step(requires={"items"}, provides={"sorted"})
class BubbleSort(Step):
    def run(self, ctx: Context) -> Context:
        arr = list(ctx["items"])
        for i in range(len(arr)):
            for j in range(len(arr) - i - 1):
                if arr[j] > arr[j + 1]:
                    arr[j], arr[j + 1] = arr[j + 1], arr[j]
        ctx["sorted"] = arr
        return ctx

@step(requires={"items"}, provides={"sorted"})
class BuiltinSort(Step):
    def run(self, ctx: Context) -> Context:
        ctx["sorted"] = sorted(ctx["items"])
        return ctx

# Register both under the same capability
sorting = Capability(name="sorting", requires={"items"}, provides={"sorted"})

registry = Registry()
registry.register("sorting", "bubble", lambda: BubbleSort(sorting, "bubble"))
registry.register("sorting", "builtin", lambda: BuiltinSort(sorting, "builtin"))

# Run the benchmark
runner = BenchRunner(registry=registry)

results = runner.run_step_ab(
    cap_name="sorting",
    impls=["bubble", "builtin"],
    fixtures=[
        {"id": "small", "items": list(range(100, 0, -1))},
        {"id": "large", "items": list(range(10000, 0, -1))},
    ],
    judge=lambda fixture, ctx: {"correctness": float(ctx["sorted"] == sorted(fixture["items"]))},
    setup_ctx=lambda fixture: {"items": fixture["items"]},
)

Cloud

Send pipeline progress and benchmark results to pipetree.io by setting two env vars:

export PIPETREE_HOST=https://pipetree.io
export PIPETREE_API_KEY=your-api-key
from pipetree import HTTPProgressNotifier, HTTPBenchmarkStore, BenchRunner, pipeline

# Progress tracking
notifier = HTTPProgressNotifier(base_url=..., api_key=..., pipeline="my-pipeline")
my_pipeline = pipeline("my-pipeline", [Split, Shout], progress_notifier=notifier)

# Remote benchmark results
store = HTTPBenchmarkStore(base_url=..., api_key=...)
runner = BenchRunner(registry=my_registry, store=store)

Development

cd pipetree
bin/check  # lint, types, tests (100% coverage)

License

O'Saasy License - Free to use, modify, and self-host. SaaS rights reserved.

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

pipetree_io-0.1.2.tar.gz (61.4 kB view details)

Uploaded Source

Built Distribution

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

pipetree_io-0.1.2-py3-none-any.whl (90.1 kB view details)

Uploaded Python 3

File details

Details for the file pipetree_io-0.1.2.tar.gz.

File metadata

  • Download URL: pipetree_io-0.1.2.tar.gz
  • Upload date:
  • Size: 61.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pipetree_io-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f0213c245194a90a0fee67dcace589250d4d849cdfe9ac4fef69a1ac691b543d
MD5 3fbc01adc1233639fbc688dcdbc1fdf6
BLAKE2b-256 e69e6aeaa4be024bef8145f04d5be5da894119310ebdb9e0253d441773683eaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipetree_io-0.1.2.tar.gz:

Publisher: publish.yml on silver-river-us/pipetree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipetree_io-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pipetree_io-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 90.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pipetree_io-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a5041570e1f9f7bdb47201a77d8ad3fac2ef14c5132add5b8e1f7fe6c35ebd7
MD5 fc06abd04b04c72750e041c7a47eefd4
BLAKE2b-256 4a611ed281ba1544acb5217990e14dbd9500a275cf34b3eda9f909bea43f6398

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipetree_io-0.1.2-py3-none-any.whl:

Publisher: publish.yml on silver-river-us/pipetree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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