ketl.transformer package

Submodules

ketl.transformer.Transformer module

exception ketl.transformer.Transformer.AdapterError[source]

Bases: Exception

class ketl.transformer.Transformer.BaseTransformer(transpose: bool = False, concat_on_axis: Optional[Union[int, str]] = None, columns: Optional[List[Union[str, int]]] = None, skip_errors: bool = False, rename: Optional[Union[Callable, Dict[str, str]]] = None, **kwargs)[source]

Bases: object

The base transformer class. Should not be instantiated directly.

abstract transform(source_files: List[pathlib.Path]) pandas.core.frame.DataFrame[source]

Run the actual transformation.

Parameters

source_files – the source files containing the data.

Returns

a data frame.

class ketl.transformer.Transformer.DelimitedTableTransformer(transpose: bool = False, concat_on_axis: Optional[Union[int, str]] = None, columns: Optional[List[Union[str, int]]] = None, skip_errors: bool = False, rename: Optional[Union[Callable, Dict[str, str]]] = None, **kwargs)[source]

Bases: ketl.transformer.Transformer.BaseTransformer

A transformer that changes the input data into a delimited table.

transform(source_files: List[pathlib.Path]) pandas.core.frame.DataFrame[source]

Transform the data contained in the list of source files to something else. By default simply returns the data frame consisting of the raw data.

Parameters

source_files – a list of source files.

Returns

a Pandas data frame.

class ketl.transformer.Transformer.JsonTableTransformer(record_path: Optional[Union[List[str], str]] = None, transpose: bool = False, concat_on_axis: Optional[Union[int, str]] = None, columns: Optional[List[Union[str, int]]] = None, skip_errors: bool = False, rename: Optional[Union[Callable, Dict[str, str]]] = None, **kwargs)[source]

Bases: ketl.transformer.Transformer.BaseTransformer

transform(source_files: List[pathlib.Path]) pandas.core.frame.DataFrame[source]

Run the actual transformation.

Parameters

source_files – the source files containing the data.

Returns

a data frame.

exception ketl.transformer.Transformer.NoValidSourcesError[source]

Bases: ketl.transformer.Transformer.AdapterError

Module contents