## Pipeline


An ordered sequence of analysis stages.


Usage

``` python
Pipeline(name)
```


Construct a pipeline from callables, then run data through each stage in sequence.


## Parameters


`name: str`  
Human-readable pipeline identifier.


## Attributes


`name`  
Pipeline name.

`stages: list`  
Ordered list of stage callables.


## Examples

``` python
>>> p = Pipeline("demo")
>>> p.add_stage(lambda x: [v * 2 for v in x])
>>> p.run([1, 2, 3])
[2, 4, 6]
```


## Methods

| Name | Description |
|----|----|
| [add_stage()](#add_stage) | Append a processing stage. |
| [clear()](#clear) | Remove all stages from the pipeline. |
| [run()](#run) | Execute all stages sequentially. |

------------------------------------------------------------------------


#### add_stage()


Append a processing stage.


Usage

``` python
add_stage(fn)
```


##### Parameters


`fn`  
A callable that accepts and returns a list.


------------------------------------------------------------------------


#### clear()


Remove all stages from the pipeline.


Usage

``` python
clear()
```


------------------------------------------------------------------------


#### run()


Execute all stages sequentially.


Usage

``` python
run(data)
```


##### Parameters


`data: list`  
Input data list.


##### Returns


`list`  
The data after passing through every stage.
