Skip to content

API Reference

types

Library's public types

CallableCollection module-attribute

CallableCollection = tuple[CallableType, ...]

Collection of objects or functions used as stages in the pipeline

StageDefinition module-attribute

StageDefinition = CallableType | type[CallableType]

A Stage class, object or function

StageDefinitionCollection module-attribute

StageDefinitionCollection = tuple[StageDefinition, ...]

Collection of Stage classes, objects or functions used to define stages in the pipeline

T_in module-attribute

T_in = TypeVar('T_in', default=Any, infer_variance=True)

Input data type for pipeline flow (payload's value type)

T_out module-attribute

T_out = TypeVar('T_out', default=T_in, infer_variance=True)

Output data type for pipeline flow (result's value type)

CallableType

Protocol for callable stages.

Format

(payload: T_in, /, args: Any, *kwds: Any) -> T_out | Awaitable[T_out]

Example (method): async def process_data(payload: str) -> int: return len(payload)

Example (class): class DataProcessor: def call(self, payload: str) -> int: return len(payload)

Example (lambda): process_data = lambda payload: len(payload)