Skip to main content

Workflow orchestration primitives for illumo demo

Project description

illumo-flow

Workflow orchestration primitives featuring declarative DSL wiring, routing control, and fail-fast execution.

Installation

pip install illumo-flow

Quick Example

from illumo_flow import Flow, FunctionNode

# Define lightweight callables (each works on a shared context dict)
def extract(ctx, _):
    return {"customer_id": 42, "source": "demo"}

def transform(ctx, payload):
    return {**payload, "normalized": True}

def load(ctx, payload):
    return f"stored:{payload['customer_id']}"

nodes = {
    "extract": FunctionNode(extract, outputs="data.raw"),
    "transform": FunctionNode(transform, inputs="data.raw", outputs="data.normalized"),
    "load": FunctionNode(load, inputs="data.normalized", outputs="data.persisted"),
}

flow = Flow.from_dsl(
    nodes=nodes,
    entry="extract",
    edges=["extract >> transform", "transform >> load"],
)

context = {}
result = flow.run(context)
print(result)                 # stored:42
print(context["data"]["persisted"])  # stored:42

Examples & CLI

The GitHub repository ships reference examples and a CLI (e.g. python -m examples linear_etl). Clone the repo if you want to explore them locally:

git clone https://github.com/kitfactory/illumo-flow.git
cd illumo-flow
python -m examples linear_etl

YAML Configuration

Flows can also be defined in configuration files:

flow:
  entry: extract
  nodes:
    extract:
      type: illumo_flow.core.FunctionNode
      callable: examples.ops.extract
      context:
        outputs: data.raw
    transform:
      type: illumo_flow.core.FunctionNode
      callable: examples.ops.transform
      context:
        inputs: data.raw
        outputs: data.normalized
    load:
      type: illumo_flow.core.FunctionNode
      callable: examples.ops.load
      context:
        inputs: data.normalized
        outputs: data.persisted
  edges:
    - extract >> transform
    - transform >> load
from illumo_flow import Flow

flow = Flow.from_config("./flow.yaml")
context = {}
flow.run(context)
print(context["data"]["persisted"])

Testing (repository clone)

pytest

The suite in tests/test_flow_examples.py validates the sample DSL flows using the src layout configured in pyproject.toml.

Documentation

Highlights

  • DSL edges such as A >> B, (A & B) >> C
  • (context, payload) callable interface with configurable context paths
  • Routing metadata via Routing(next, confidence, reason)
  • Built-in join handling (nodes with multiple parents automatically wait for all inputs)
  • Examples covering ETL, dynamic routing, fan-out/fan-in, timeout handling, and early stop

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

illumo_flow-0.1.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

illumo_flow-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file illumo_flow-0.1.1.tar.gz.

File metadata

  • Download URL: illumo_flow-0.1.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for illumo_flow-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e6323f99757ab85ed1f9d587c52704deb7db08ade2fbcbd3a3650600f54d3a80
MD5 55ae48bc6b58e533b43003910266e46a
BLAKE2b-256 53bda9b3952700971f310662230dac80ee28583ddce6981fec8ad9f95a88e2d2

See more details on using hashes here.

File details

Details for the file illumo_flow-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: illumo_flow-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for illumo_flow-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6edbf56ab32eae05abd4f9889d4369c22aa10a5090337e0e4c14f6409728f937
MD5 11f0a4c96d7b07a30739e07692f2ff61
BLAKE2b-256 51523d0e30aacc01fcb9f69f7f85bf7cc0e8fe67721b66fc050b8185daff09f0

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