Bases: piped.processors.base.Processor
Calls a method on a dependency.
This processor may be useful if you want to call a method on a provided dependency.
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Callbacks a deferred.
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Filters the baton by removing unwanted attributes.
Expects at least one of the two keyword arguments:
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Appends batons that pass through it to the list its instantiated with. Useful to e.g. inspect how a baton appears at various stages of the processing, or as a sink.
| Parameters: | deepcopy – Whether to deepcopy the batons as they pass through. If enabled, this will show the batons as they were when they passed through — if not, subsequent processors may have modified it. |
|---|
Bases: piped.processors.base.InputOutputProcessor
Formats a string.
See the format string syntax in the Python documentation.
| Parameters: |
|
|---|
Bases: piped.processors.base.InputOutputProcessor
Given a path to a value in the baton, apply the provided lambda function.
| Parameters: |
|
|---|
Bases: piped.processors.base.InputOutputProcessor
Given a path to a value in the baton, execute the provided code.
| Parameters: |
|
|---|
Bases: piped.processors.base.InputOutputProcessor
Reduce a list of dictionaries to a list of values, given a key which occurs in the dictionaries.
Bases: piped.processors.base.Processor
Flatten nested lists into a single list.
For example:
>>> baton = dict(data=['One', ['Two', 'Three'], ['Four']])
>>> NestedListFlattener(paths=['data']).process(baton)
{'data': ['One', 'Two', 'Three', 'Four']}
Bases: piped.processors.base.Processor
Increases the counter found at counter_path with increment.
Bases: piped.processors.base.Processor
Logs a message with the configured log-level.
The message is either configured at message, or looked up in the baton at message_path.
The message is logged with the configured level.
See also
piped.log
Bases: piped.processors.base.Processor
Processor that merges the baton with the provided dictionary.
Expects a kw-argument “dict”, which is the dictionary to merge.
Bases: piped.processors.util_processors.StringFormatter
Prefixes the string at input_path with the prefix.
Bases: piped.processors.base.Processor
Prettyprints the baton before passing it on.
No changes are made to the baton.
Bases: piped.processors.base.Processor
Prints the currently active exception traceback. Useful for debugging.
No changes are made to the baton.
Bases: piped.processors.base.Processor
Raise an exception of the specified type.
The exception is instantiated with the optional args and kwargs.
Bases: piped.processors.base.MappingProcessor
Remaps a dictionary.
Expects to be instantiated with a dictionary that copies values at one path to another one.
For example, giving the mapping {‘b.c’: ‘a’} and the baton dict(b=dict(c=’d’)), the output will be dict(a=’d’, b=dict(c=’d’)).
Bases: piped.processors.base.Processor
Sets the value at path.
Bases: piped.processors.base.Processor
Takes a path-to-value-mapping and sets values at the specified paths.
A path_prefix can be specified, if all the paths in the mapping share a common prefix.
..autoclass:: Shutdown
Bases: piped.processors.base.Processor
Stops processing when the configured lambda returns true.
An optional input_path can be specified, as well as a namespace. These are explained in detail in TODO: Some refererence.
Bases: piped.processors.base.Processor
Traps failures of the specified types.
If the encountered exception is not one of the expected exception types, this processor will raise the original exception, preserving the traceback.
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Passes batons to the wrapped coroutine.
See also
Bases: piped.processors.base.Processor
Fetches a shared context.
If output_path is None, it defaults to the same as the context name.
Bases: piped.processors.base.InputOutputProcessor
Formats a date according to a format.
Bases: piped.processors.base.InputOutputProcessor
Parses a timestamp according to format_string.
If as_date is true, then a date-object is returned, instead of a datetime.
Bases: piped.processors.base.Processor
Append something to a file.
The file defined by file_path is opened in append-mode.
For every baton processed, the input found at input_path is passed through a formatter, which is defined by a lambda, in the same way eval-lambda is. The default formatter simply passes the input through to the format-string.
The output of the formatter is then combined with format, which is a format string.
Note that the output of the formatter need not be a string. It can e.g. be a dictionary, which is then converted to a string via the format-string.
The result of combining the format with the output from the formatter is assumed to be a unicode-string, which is then encoded to a UTF8-bytestring before appending to the file.
Note: The processor does not deal with flushing the buffers to disk.
Bases: piped.processors.file_processors.FileAppender
Append something to a log.
Bases: piped.processors.base.InputOutputProcessor
Decodes JSON.
The input may either be a string or a file-like object.
| Parameters: | decoder – A fully qualified name of the json.JSONDecoder. |
|---|
Bases: piped.processors.base.InputOutputProcessor
Encodes JSON.
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Calls a remote function using PB.
Bases: piped.processors.base.Processor
Makes a dot-representation of the dependency graph.
Bases: piped.processors.base.Processor
Makes a dot-representation of the pipelines of every processor graph-evaluator.
Bases: piped.processors.base.InputOutputProcessor
ForEach is an In/Out-processor that invokes a pipeline for every item in its input.
If the input is a dict, the processor will iterate over the values and the output will also be a dict where the values are the results from the processing.
| Parameters: |
|
|---|
Bases: piped.processors.base.InputOutputProcessor
” Processes a baton in another pipeline.
If a pipeline_path is specified, the processor creates a temporary dependency during processing and takes care of removing this dependency afterwards. If this processor is the first consumer of the pipeline, exceptions that would otherwise be raised during startup may be raised during this processors processing.
Note that the pipeline is only requested as a dependency, and not deconstructed after use. This means that unused resources may remain in process afterwards.
| Parameters: |
|
|---|
Bases: piped.processors.base.InputOutputProcessor
Parses output from iostat.
Format is a list of 2-tuples where the first element is the name of the device and the second element is a list of measurement names that are be used to parse the input into a dict.
Example format:
format:
- - disk0
- - KB/t
- tps
- MB/s
# alternative yaml layouts with equivalent structure:
- [cpu, [user, system, idle]]
- - load
- [1m, 5m, 15m]
The above format can be used to parse the following output:
' 24.00 2 0.05 3 3 94 0.61 0.69 0.79'
into:
{'cpu': {'idle': 94.0, 'system': 3.0, 'user': 3.0},
'disk0': {'KB/t': 24.00, 'MB/s': 0.05, 'tps': 2.0},
'load': {'15m': 0.79, '1m': 0.61, '5m': 0.69}}
Bases: piped.processors.base.InputOutputProcessor
Renders a dot graph.
Bases: piped.processors.base.Processor
Creates an instance of email.message.Message.
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Set or replace message headers of an email.message.Message.
If the header already exists in the message, it will be replaced, otherwise it will be added.
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Send an email.
| Parameters: |
|
|---|
Processors that deal with tick intervals.
Bases: piped.processors.tick_processors.IntervalProcessor
Starts a tick interval.
| Parameters: | interval – The name of the interval. See TickProvider. |
|---|
Bases: piped.processors.tick_processors.IntervalProcessor
Stops a tick interval.
| Parameters: | interval – The name of the interval. See TickProvider. |
|---|
Bases: piped.processors.base.InputOutputProcessor
Create a dot-graph of trace results.
| Parameters: |
|
|---|
Bases: piped.processors.base.InputOutputProcessor
Creates a HTML-page containing the results of a rendered trace.
| Parameters: |
|
|---|
Bases: piped.processors.web_processors.HttpRequestProcessor
Determine the IP of the HTTP-client.
If proxied is true, then the proxy_header, which defaults to “x-forwarded-for”, is used to get the IP.
If an IP is not found at the proxy header, the client-IP is returned — unless fail_if_not_proxied is true, in which case a PipedError is raised.
Bases: piped.processors.base.MappingProcessor
Extract arguments from a twisted.web.server.Request-like object.
The input paths in the mapping is lookup up in the request arguments and copied to the specified output paths.
The mapping support the following additional keywords:
- only_first
- Only returns the first request argument by that name. Defaults to True.
- load_json
- Causes the value to be loaded as json before being copied into the baton. Defaults to False.
Consider the following example configuration:
mapping:
- foo
- bar:
only_first: false
- baz:
load_json: true
- zip:
output_path: zap
Using the above configuration to extract the request arguments of a request to http://.../?foo=1&foo=2&bar=3&bar=4&baz={"test":[5,6,7]}&zip=8 results in the following baton:
request: <Request object>
foo: '1'
bar: ['1', '2']
baz:
test: [5, 6, 7]
zap: '8'
Note that the integers in the request are not parsed. For more advanced input validation, see the validate-with-formencode processor.
| Parameters: |
|
|---|
Bases: piped.processors.web_processors.HttpRequestProcessor
Set cache headers to indicate that the response should be cached for timedelta seconds.
| Parameters: | timedelta – a dictionary with the keys days, hours, minutes and seconds. The resulting timedelta is the sum of these. |
|---|
Bases: piped.processors.web_processors.HttpRequestProcessor
Adds headers as response headers.
Bases: piped.processors.base.Processor
A simple web client agent for simple HTTP requests.
If any of the following arguments resolve to a callable, it is called without any arguments and the return value is used.
| Parameters: |
|
|---|---|
| Returns: |
Bases: piped.processors.web_processors.HttpRequestProcessor
A processor that writes the response to a twisted.web.server.Request
| Parameters: | response_code (int or str) – Either an integer response code or a string. If a string is supplied, it is converted to an integer by looking up the response codes defined in twisted.web.http during initialization. |
|---|
Bases: piped.processors.base.MappingProcessor
Removes all markup from the text at the provided paths.
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Create a reporter for statustests.
A reporter is responsible for handling the results of test runs. The default reporter supports passing test results to a separate processor, gathering the test results for inspection after the test suites have been run and optionally printing the results to the console.
| Parameters: |
|
|---|
Bases: piped.processors.base.Processor
Wait for the processor that processes reporter results to finish processing.
Since the reporter processing may be asynchronous, this processor may be used to wait until all the currently queued reporter processing is completed.
| Parameters: |
|
|---|
Bases: piped_zookeeper.processors.ZooKeeperProcessor
Create a ZooKeeper node.
| Parameters: |
|
|---|
Bases: piped_zookeeper.processors.ZooKeeperProcessor
Get a list of children for a ZooKeeper node.
| Parameters: |
|
|---|
Bases: piped_zookeeper.processors.ZooKeeperProcessor
Get the data of a ZooKeeper node.
| Parameters: |
|
|---|
Bases: piped_zookeeper.processors.ZooKeeperProcessor
Set the contents of a ZooKeeper node.
| Parameters: |
|
|---|
Bases: piped_zookeeper.processors.ZooKeeperProcessor
Check whether a given ZooKeeper node exists.
| Parameters: |
|
|---|