HolidayEnricher Class

Defines a common holiday enricher.

The HolidayEnricher class can be used to join holiday public data with your data. For example, see the Public Holidays dataset in the Open Datasets catalog.

Intialize with public data object.

Inheritance
HolidayEnricher

Constructor

HolidayEnricher(public_data_object: PublicData, enable_telemetry: bool = False)

Parameters

Name Description
public_data_object
Required

A public dataset.

enable_telemetry

Indicates whether to send telemetry.

default value: False

Methods

enrich_customer_data_no_agg

Enrich customer data with default aggregator_all.

enrich_customer_data_with_agg

Enrich customer data with specified aggregator.

enrich_customer_data_no_agg

Enrich customer data with default aggregator_all.

enrich_customer_data_no_agg(customer_data_object: CustomerData, time_round_granularity: str = 'day') -> Tuple[CustomerData, PublicData, List[Tuple[str, str]]]

Parameters

Name Description
customer_data_object
Required

An instance of a customer data class.

time_round_granularity
str

The time granularity, 'day', 'hour', or 'month'. The default is 'day'.

default value: day

Returns

Type Description

A tuple of enriched customer data (new_customer_data) and processed_public_data.

enrich_customer_data_with_agg

Enrich customer data with specified aggregator.

enrich_customer_data_with_agg(customer_data_object: CustomerData, agg: str, time_round_granularity: str = 'day') -> Tuple[CustomerData, List[Tuple[str, str]]]

Parameters

Name Description
customer_data_object
Required

An instance of a customer data class.

agg
Required

An aggregator.

time_round_granularity
str

A time granularity, 'hour', 'day', or 'month'. The default is 'day'.

default value: day

Returns

Type Description

A tuple of enriched customer data (joined_data).