leaf_engine.etl.map

Classes

Mapper

Functions

_normalize_address_details(df, **kwargs)

Normalizes address columns to uppercase alphanumeric characters only. Also

_normalize_string_value(value)

_normalize_zip_value(value)

map_pipeline(df, dataset_params[, lane_level])

Module Contents

class leaf_engine.etl.map.Mapper(company_name, custom_name, run_type)
static _get_custom_mapping_module(company_name, custom_name, run_type)
static _get_default_mapping_module(company_name, run_type)
static _get_module(company_name, run_type, module_name)
get_function(function_name)
custom_module
default_module
leaf_engine.etl.map._normalize_address_details(df, **kwargs)

Normalizes address columns to uppercase alphanumeric characters only. Also normalizes zip codes to between 3 and 5 digits if possible.

Parameters:

df (pd.DataFrame) – Shipments DataFrame.

Returns:

Shipments DataFrame with normalized address values.

Return type:

pd.DataFrame

leaf_engine.etl.map._normalize_string_value(value)
leaf_engine.etl.map._normalize_zip_value(value)
leaf_engine.etl.map.map_pipeline(df, dataset_params, lane_level=False)