hansken_extraction_plugin.api.transformer

This module contains the Transformer class that holds the function reference of the transformer.

Instances of this class are constructed by BaseExtractionPlugin when retrieving transformers dynamically. It also validates whether the method to which @transformer is applied adheres to the requirements of a transformer.

Classes

Transformer(function)

A transformer is an exposed method of a plugin that can be executed remotely outside extraction-time.

class Transformer(function)[source]

Bases: object

A transformer is an exposed method of a plugin that can be executed remotely outside extraction-time.

This allows for on-demand analysis during an investigation.

supported_primitives = {<class 'bool'>: 'boolean', <class 'bytes'>: 'binary', <class 'datetime.datetime'>: 'date', <class 'float'>: 'double', <class 'hansken.util.GeographicLocation'>: 'latLong', <class 'hansken.util.Vector'>: 'vector', <class 'int'>: 'long', <class 'str'>: 'string', typing.Mapping: 'map', typing.Sequence: 'list'}
generate_label() TransformerLabel[source]

Generate a TransformerLabel given the transformer method. TransformerLabels are used in PluginInfo objects.

Unlike Transformers TransformerLabels can be serialized and sent to a client that wishes to call a transformer. The specific Python types are converted to the generic types that are used in the Hansken trace model.