iota  1.0.0
Flexible, pipeline-based input handling.
Public Member Functions | Public Attributes | List of all members
iota.Pipeline Class Reference

A simplistic but flexible pipeline implementation. More...

Public Member Functions

def __init__ (self, steps)
 Create a new pipeline. More...
 
def add (self, steps)
 Add steps to the pipline. More...
 
def run (self, value)
 Run this pipeline. More...
 

Public Attributes

 steps
 

Detailed Description

A simplistic but flexible pipeline implementation.

Definition at line 239 of file iota.py.

Constructor & Destructor Documentation

◆ __init__()

def iota.Pipeline.__init__ (   self,
  steps 
)

Create a new pipeline.

This initializes the steps[] list and adds in any steps that may have been passed through the constructor by calling the add function.

Parameters
stepsThe steps to be passed into the pipeline.

Definition at line 246 of file iota.py.

Member Function Documentation

◆ add()

def iota.Pipeline.add (   self,
  steps 
)

Add steps to the pipline.

This is a very flexible recursive function that adds steps to the pipeline. You can pass functions, built-in functions, lambda expressions, other pipelines, or tuples/lists containing any of those to the add function and they will all be appended to the pipeline beautifully.

This allows for chaining together frequently used pipeline segments and other steps in a very easy syntax, among other things.

Parameters
stepsThe steps to be added to the pipeline.
Returns
the pipeline after adding the steps, for optional chaining.

Definition at line 262 of file iota.py.

◆ run()

def iota.Pipeline.run (   self,
  value 
)

Run this pipeline.

This is where Python's dynamic typing gives it the edge over Java.

Parameters
valuethe starting value to be passed into the pipeline.
Returns
the value after it has been passed through all of the steps in the pipeline.

Definition at line 297 of file iota.py.


The documentation for this class was generated from the following file: