converter.mapping.base

Module Contents

Classes

TransformationEntry

ColumnConversion

DirectionalMapping

MappingSpec

Class holding information about a given mapping

BaseMapping

Class describing the mapping from the input to the

Functions

get_logger()

Attributes

TransformationSet

ColumnConversions

converter.mapping.base.get_logger()
class converter.mapping.base.TransformationEntry(transformation: str, transformation_tree: Union[lark.Tree, None] = None, when: str = 'True', when_tree: Union[lark.Tree, None] = None)
__eq__(self, other)

Return self==value.

parse(self)
converter.mapping.base.TransformationSet
class converter.mapping.base.ColumnConversion

Bases: NamedTuple

type :str
nullable :bool = True
null_values :Set
converter.mapping.base.ColumnConversions
class converter.mapping.base.DirectionalMapping

Bases: NamedTuple

input_format :str
output_format :str
transformation_set :TransformationSet
types :Dict[str, ColumnConversion]
null_values :Set
class converter.mapping.base.MappingSpec(input_format, output_format, forward: DirectionalMapping = None, reverse: DirectionalMapping = None)

Class holding information about a given mapping

property can_run_forwards(self)

Flag whether the mapping file can be applied forwards.

Returns

True is the mapping can be applied forwards, False otherwise

property can_run_in_reverse(self)

Flag whether the mapping file can be applied in reverse.

Returns

True is the mapping can be applied in reverse, False otherwise

class converter.mapping.base.BaseMapping(config: converter.config.Config, input_format: str = None, output_format: str = None, **options)

Class describing the mapping from the input to the output formats.

Parameters
  • config – The global config for the system

  • input_format – The start of the conversion path

  • output_format – The end of the conversion path

property mapping_specs(self) Reversible[MappingSpec]

Returns a list of MappingSpec objects described by the mapping

property mapping_graph(self) networkx.DiGraph

Creates the graph to represent the relationships between formats in the system. It it has not already been generated it is generated here.

get_transformations(self) List[DirectionalMapping]

Gets a column transformations and full transformation set for the provided input and output paths.

Returns

The mappings along the conversion path.