Skip to main content

Rivlet

English | 简体中文

Rivlet is a Python library for composing and running task graphs, with a Rust execution core. Write your tasks as Python functions, connect them explicitly, and reuse whole workflows as subgraphs.

Use it for build pipelines, automation, data processing, or validation workflows that need clear dependencies and controlled concurrency. It runs inside your application; it is not a distributed workflow service.

What you can do

  • Compose steps and subgraphs: use >> for ordering and | for independent branches, without flattening reusable subgraphs.
  • Connect readiness ports: let a consumer prepare early and wait only where it actually needs a provider's output, not for the provider's entire workflow.
  • Make data flow explicit: bind step results to action and condition arguments through result edges; order-only dependencies need no result passing.
  • Control execution: run synchronous or asynchronous Python tasks with explicit concurrency limits. Runtime-created subgraphs share the same action budget.
  • Inspect what happened: render graphs, query results, and subscribe to typed execution events. A failed step blocks dependent work while independent branches continue; the overall run still reports failure.

Install

Requires Python 3.13 or later:

pip install rivlet

Prebuilt wheels are available for CPython 3.13–3.15 on Linux x86_64 (glibc 2.28+) and macOS arm64 (macOS 11+). These installations need no Rust toolchain. Other platforms require a source build; see distribution support.

Compose steps and reusable subgraphs

from rivlet import Graph, GraphExecution, Step, ThreadGraphRunOptions


def checks() -> Graph:
    validate = Step(lambda: print("validate"), label="validate")
    test = Step(lambda: print("test"), label="test")
    return (validate | test).graph(label="checks")


prepare = Step(lambda: print("prepare"), label="prepare")
finish = Step(lambda: print("finish"), label="finish")

graph = (prepare >> checks() >> finish).graph(label="example")
GraphExecution(graph=graph).run(ThreadGraphRunOptions(workers=2))

After prepare, the checks subgraph can run validate and test concurrently. finish waits for both to succeed; their print order is not guaranteed.

checks() returns an ordinary Graph, ready to place in other workflows. Nesting it preserves its boundary and internal dependencies. >> waits for the whole left-hand step or subgraph; | adds no dependency between its branches. Actual concurrency comes from the run options, not from | alone.

Declarations and runs are separate: Graph describes the workflow; GraphExecution(graph) owns one run. Create a new execution to run the declaration again. You can also declare the same wiring without the DSL; see the core model.

Connect subgraphs through input and output ports

Sometimes a downstream workflow needs only one intermediate result, not the completion of an entire upstream subgraph. A capability names that readiness contract. Its output identifies the step that makes it ready; its input identifies where the consumer starts needing it.

This complete example connects two otherwise independent subgraphs:

from rivlet import (
    Capability,
    CapabilityBinding,
    CapabilityInterface,
    Graph,
    GraphExecution,
    Step,
    ThreadGraphRunOptions,
)

data_ready = Capability("validated-data")

fetch = Step(lambda: print("fetch data"), label="fetch")
validate = Step(lambda: print("validate data"), label="validate")
archive = Step(lambda: print("archive data"), label="archive")
producer_graph = (fetch >> validate >> archive).graph(
    label="producer",
    capabilities=CapabilityInterface(outputs={data_ready: validate}),
)

prepare = Step(lambda: print("prepare consumer"), label="prepare")
process = Step(lambda: print("process data"), label="process")
report = Step(lambda: print("report results"), label="report")
consumer_graph = (prepare >> process >> report).graph(
    label="consumer",
    capabilities=CapabilityInterface(inputs={data_ready: process}),
)

producer = producer_graph.step()
consumer = consumer_graph.step()
graph = Graph(
    label="pipeline",
    steps=(producer, consumer),
    edges=(
        CapabilityBinding(source=producer, target=consumer, capability=data_ready),
    ),
)
GraphExecution(graph).run(ThreadGraphRunOptions(workers=3))
producer: fetch → validate [output] → archive
                     │ validated-data
                     ▼
consumer: prepare → process [input] → report

The consumer can prepare immediately. Once validation succeeds, process can run without waiting for archive, provided its own preparation has also completed. The overall execution still waits for both subgraphs to finish.

Matching port names do not create dependencies: CapabilityBinding explicitly connects this producer and consumer. Ports synchronize readiness; they do not transfer Python return values or inspect external data. Use result edges for argument passing, and publish an output only when later steps will no longer invalidate what the consumer reads.

This is different from producer_graph >> consumer_graph, which waits for the entire producer before starting any consumer step. For selecting among providers, multiple inputs, and failure behavior, see capability ports.

Forward an interface when wrapping a subgraph

Using producer_graph from the previous example:

setup = Step(lambda: print("set up producer"), label="setup")
wrapped = (setup >> producer_graph).graph(
    label="wrapped producer",
    capabilities=producer_graph,
)

capabilities=producer_graph explicitly exposes the child's input and output ports on the wrapper. Omit it and the wrapper exposes no ports. You can forward only one direction or declare a new interface with CapabilityInterface.

Explore more

For contributors: local development and checks, architecture, and releasing.

License

This project is licensed under the MIT License.

Metadata

Release files for rivlet 0.2.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rivlet 0.2.0.post1
File Size Uploaded Provenance Actions
rivlet-0.2.0.post1.tar.gz 125.9 kB With provenance Details for rivlet-0.2.0.post1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rivlet 0.2.0.post1
File Actions
rivlet-0.2.0.post1-cp315-cp315-manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64 Details for rivlet-0.2.0.post1-cp315-cp315-manylinux_2_28_x86_64.whl
rivlet-0.2.0.post1-cp315-cp315-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 macOS 11.0+ ARM64 Details for rivlet-0.2.0.post1-cp315-cp315-macosx_11_0_arm64.whl
rivlet-0.2.0.post1-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for rivlet-0.2.0.post1-cp314-cp314-manylinux_2_28_x86_64.whl
rivlet-0.2.0.post1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for rivlet-0.2.0.post1-cp314-cp314-macosx_11_0_arm64.whl
rivlet-0.2.0.post1-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for rivlet-0.2.0.post1-cp313-cp313-manylinux_2_28_x86_64.whl
rivlet-0.2.0.post1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for rivlet-0.2.0.post1-cp313-cp313-macosx_11_0_arm64.whl

Total release size: 4.1 MB

Release files / rivlet-0.2.0.post1.tar.gz

Download URL rivlet-0.2.0.post1.tar.gz
Size 125.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dbc7773fb62bfc890e9fb5243b47bf60d213991ab30323c4b50f6b998ee4805b
BLAKE2b-256 checksum
How to use checksums
817e60081b49899020553737e33abc93907f4617e1dbecc3d75003a84e314673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / rivlet-0.2.0.post1-cp315-cp315-manylinux_2_28_x86_64.whl

Download URL rivlet-0.2.0.post1-cp315-cp315-manylinux_2_28_x86_64.whl
Size 696.3 kB
Tags CPython 3.15 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b59a5cf0e53ad06e768850c6c6ff45b5586c14e0ff3fd38461327d2e278825b0
BLAKE2b-256 checksum
How to use checksums
1cf91ad159755edc5c3dc46494212867a6d2ad1634f98a4a51840a04713b4901
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / rivlet-0.2.0.post1-cp315-cp315-macosx_11_0_arm64.whl

Download URL rivlet-0.2.0.post1-cp315-cp315-macosx_11_0_arm64.whl
Size 628.9 kB
Tags CPython 3.15 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a2380349529778cb4da8129f3d32ec35989d30071fe71086648f5a864fa1ffca
BLAKE2b-256 checksum
How to use checksums
278209fd85190dc3c21aa90796b34b71b0e5f2e41db37b0986982ca1ee9dc3b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / rivlet-0.2.0.post1-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL rivlet-0.2.0.post1-cp314-cp314-manylinux_2_28_x86_64.whl
Size 695.3 kB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d330a5f8ebd92bb8577e92fa183d61862305a24f09c067f361e751a47762aa75
BLAKE2b-256 checksum
How to use checksums
32f6db648b03b079585a8e341b890052f74c5b1ce0e16ad8fe9febfe0dba4fcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / rivlet-0.2.0.post1-cp314-cp314-macosx_11_0_arm64.whl

Download URL rivlet-0.2.0.post1-cp314-cp314-macosx_11_0_arm64.whl
Size 628.5 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
14e2e1e029f58fd51beab434d5d8638ca66ac09bc59d9de0cb166b67a2e36299
BLAKE2b-256 checksum
How to use checksums
07cc557731c1ce1bb78cdacc6a6e304491d5d42dda29d9ac264f5916452a4f8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / rivlet-0.2.0.post1-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL rivlet-0.2.0.post1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 694.8 kB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e2b7b19cb7ebbcc5e9c32d5fe03db48bb855598d8aecd2800c1bf5015f927586
BLAKE2b-256 checksum
How to use checksums
ab0d0b361ae528439ed0851b4318174b54b128be8ccf347700630b7e2125d0c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / rivlet-0.2.0.post1-cp313-cp313-macosx_11_0_arm64.whl

Download URL rivlet-0.2.0.post1-cp313-cp313-macosx_11_0_arm64.whl
Size 627.6 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a57c67424d89f13cdc8ba83e74ca3f585fa5351e05fe866e9ac333ff797d4ecc
BLAKE2b-256 checksum
How to use checksums
9f4405153576590de70bf76c004e760a2821f7f93ae1af8b937fa15ee416c6a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for rivlet 0.2.0.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for rivlet-0.2.0.post1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page