XMM Pipelines¶
-
class
Pipeline(config=None, name=None)[source]¶ A task pipeline.
A pipeline will construct and transform data as defined in a pipeline configuration.
The XMM project contains an easily configurable
Pipeline runner. It can do almost any task you can
think of, given the steps necessary are implemented
and compatible.
Pipeline format¶
Pipelines can be configured using JSON:
[
["FirstStep", {
"options": "go here",
}],
["SecondStep", {
"can": [
"have",
"different",
"options"
]
}],
["NoOptionStep", {}]
]
Steps¶
Every pipeline consists of one or more steps. A step is defined as follows:
A function that accepts a
stateand acontextvariable. This function must return a tuple with the modifiedstateandcontext.A class that may have its
__init__options configured by the JSON pipeline configuration. Such Step classes should inherit from the basePipelineStep.
The state variable should always be in a form of a Python iterable.
This way each step can walk over datasets in the state lazily without using up too many system resources.
At the start of every pipeline, the context will be populated with a
datetime instance with the current date and time in the start key.
There are currently a number of steps available. See the table below for requirements and configuration options.
A single step in a pipeline. |
|
|
Read a raw data source from somewhere. |
|
Load raw data as a known format. |
|
Map values in datasets of an import pipeline to correct attributes in our model. |
|
Write instances to the database or update existing ones. |
|
Fetch the requested data from the database. |
|
Prepare a list of raw attribute values for all documents. |
|
Convert nested dicts to flat dicts. |
|
Format data in a flat or nested hierarchical structure. |
|
Writes the data acquired so far to a file. |
|
Rename an exported file according to some formatting options. |
|
XSLT step that gets xslt as string for XML transformation. |
|
XSLT step that gets xslt as string for XML transformation. |
Zip the exported file. |
|
|
Transfer the file via e-mail, ftp etc. |
|
Send a notification. |
|
Progress step. |