PipeLayer Framework
v0.6.0
pipelayer.Pipeline(Filter)
Constructor:
__init__(steps, name)
steps: List[Union[Step, PipelineCallableT]]
- Classes and Instances that derive from
pipelayer.Filter
and implement therun
method - Classes that implement the
pipelayer.Step
protocol - Functions (instance/class/static/module) that have the following signature
def func(data: Any, context: Any)
- Anonymous functions (lambda) with two arguments that follow this pattern:
my_func = lambda data, context: data
- Classes and Instances that derive from
name: Optional[str]
If not specified, the class name will be used.
Properties:
- steps: List[Union[Step, PipelineCallableT]]
- The list of filters to be executed
manifest: Manifest
An instance ofpipelayer.Manifest
that is created when the run method is called.
Events:
- See Filter Events
Methods:
run(data, context) -> Any
The pipeline runner that iterates through thesteps
and pipes filter output to the next step.data: Optional[Any
]context: Optional[pipelayer.Context
]
pipelayer.Switch(Filter)
An implementation of a Switch statement as a pipeline filter
Constructor
__init__(expression, cases, name)
expression: Union[Step, PipelineCallableT]
cases: Dict[Any, Union[Step, PipelineCallableT]]
name: Optional[str]
If not specified, the class name will be used.
Properties:
expression: Union[Step, PipelineCallableT]
cases: Dict[Any, Union[Step, PipelineCallableT]]
name: Optional[str]
manifest: Manifest
Events:
- See Filter Events
Methods:
run(data, context) -> Any
The runner that evaluates the specified expression and executes the matching case.
pipelayer.Filter
The filter abstract class that raises events.
Constructor
__init__(name)
name: Optional[str]
If not specified, the derived class name will be used.
Properties:
name: str
The name used by the manifest.
Events:
Events are lists of callables assigned after instantiation and are raised if the pipelayer.filter.raise_events
decorator is applied to the implementation of the run
method.
start: List[PipelineCallableT]
Raised before therun
method is invoked.exit: List[
PipelineCallableT
]
Raised ifaction
is set toAction.SKIP
orAction.EXIT
in either astart
orstop
event handler.end: List[PipelineCallableT]
Raised after therun
method is invoked.
pipelayer.FilterEventArgs
__init__(data, context, state)
data: Any
context: Context
state: State
pipelayer.Context
A abstract base class for runtime app data.
pipelayer.Manifest
The Manifest keeps a record of Pipeline and Filter activity.
pipelayer.util
render_manifest(manifest, indent) -> str
Static function that renders formatted JSON datamanifest: Manifest
indent: Optional[int]
Default value is 2.