exporters.transform package

Submodules

exporters.transform.base_transform module

class exporters.transform.base_transform.BaseTransform(options, metadata=None)[source]

Bases: exporters.pipeline.base_pipeline_item.BasePipelineItem

This module receives a batch and writes it where needed. It can implement the following methods:

get_all_metadata(module='transform')[source]
get_metadata(key, module='transform')[source]
set_metadata(key, value, module='transform')[source]
supported_options = {}
transform_batch(batch)[source]

Receives the batch, transforms it, and returns it.

update_metadata(data, module='transform')[source]

exporters.transform.jq_transform module

class exporters.transform.jq_transform.JQTransform(*args, **kwargs)[source]

Bases: exporters.transform.base_transform.BaseTransform

It applies jq transformations to items. To see documentation about possible jq transformations please refer to its official documentation.

  • jq_filter (str)
    Valid jq filter
supported_options = {'jq_filter': {'type': (<type 'basestring'>,)}}
transform_batch(batch)[source]

exporters.transform.no_transform module

class exporters.transform.no_transform.NoTransform(*args, **kwargs)[source]

Bases: exporters.transform.base_transform.BaseTransform

It leaves the batch as is. This is provided for the cases where no transformations are needed on the original items.

supported_options = {}
transform_batch(batch)[source]

exporters.transform.pythonexp_transform module

class exporters.transform.pythonexp_transform.PythonexpTransform(*args, **kwargs)[source]

Bases: exporters.transform.base_transform.BaseTransform

It applies python expressions to items.

  • python_expression (str)
    Valid python expression
is_valid_python_expression(python_expressions)[source]
supported_options = {'python_expressions': {'type': <class 'exporters.utils.list[unicode]'>}}
transform_batch(batch)[source]

Module contents

class exporters.transform.JQTransform(*args, **kwargs)[source]

Bases: exporters.transform.base_transform.BaseTransform

It applies jq transformations to items. To see documentation about possible jq transformations please refer to its official documentation.

  • jq_filter (str)
    Valid jq filter
supported_options = {'jq_filter': {'type': (<type 'basestring'>,)}}
transform_batch(batch)[source]
class exporters.transform.NoTransform(*args, **kwargs)[source]

Bases: exporters.transform.base_transform.BaseTransform

It leaves the batch as is. This is provided for the cases where no transformations are needed on the original items.

supported_options = {}
transform_batch(batch)[source]
class exporters.transform.PythonexpTransform(*args, **kwargs)[source]

Bases: exporters.transform.base_transform.BaseTransform

It applies python expressions to items.

  • python_expression (str)
    Valid python expression
is_valid_python_expression(python_expressions)[source]
supported_options = {'python_expressions': {'type': <class 'exporters.utils.list[unicode]'>}}
transform_batch(batch)[source]