> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# label_holidays

> Indicate if there are any holidays for given date, location pairs. 

Assigns holiday labels to a given date, location pair. The date must be expressed through a date column,
but the region can be indicated by either giving a country and region column, or indicating the country, region through
parameters. If only one location column is given, it's assumed to be the country.

For supported country/region identifiers, please check [this table](https://github.com/dr-prodigy/python-holidays#available-countries).

Since holidays essentially rely on manual or at best heuristical tagging,
keep in mind that the further you go into the future or into the past the more unreliable the data becomes,
and the same can be said for small countries.
You read more about our holiday data provider [here](https://github.com/dr-prodigy/python-holidays).

## Usage

The following examples show how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Example 1">
      The following labels California holidays in a set of dates

      ```stan theme={null}
      label_holidays(ds.date, {
        "country": "US",
        "region": "CA"
      }) -> (ds.california_holidays, ds.is_holiday)
      ```
    </Tab>

    <Tab title="Example 2">
      The following labels several country/region combinations

      ```stan theme={null}
      label_holidays(ds.date, ds.country, ds.region) -> (ds.holidays, ds.is_holiday)
      ```
    </Tab>

    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      label_holidays(date_col: date, *location: category, {
          "param": value,
          ...
      }) -> (holidays: list[category], is_holiday: boolean)
      ```
    </Tab>
  </Tabs>
</Accordion>

## Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally
columns (`ds.first_name`), datasets (`ds` or `ds[["first_name", "last_name"]]`) or models (referenced
by name e.g. `"churn-clf"`).

<Accordion title="Inputs" icon="right-to-bracket">
  <ParamField path="date_col" type="column[date]" required>
    Dates column to label.
  </ParamField>

  <ParamField path="*location" type="column[category]">
    Optional columns containing the location names (Counry, Region) if different countries or regions are present.
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="holidays" type="column[list[category]]" required>
    A column containing the labels assigned to each text.
  </ParamField>

  <ParamField path="is_holiday" type="column[boolean]" required>
    Indicates wether a given date had some holidays in it or not.
  </ParamField>
</Accordion>

## Configuration

The following parameters can be used to configure the behaviour of the step by including them in
a json object as the last "input" to the step, i.e. `step(..., {"param": "value", ...}) -> (output)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  <ParamField path="country" type="string">
    Country to retrieve the holiday from.

    Values must be one of the following:

    `ABW` `AE` `AGO` `AO` `AR` `ARE` `ARG` `AT` `AU` `AUS` `AUT` `AW` `Angola` `Argentina` `Aruba` `Australia` `Austria` `BD` `BDI` `BE` `BEL` `BG` `BGD` `BI` `BLG` `BLR` `BR` `BRA` `BW` `BWA` `BY` `Bangladesh` `Belarus` `Belgium` `Botswana` `Brazil` `Bulgaria` `Burundi` `CA` `CAN` `CH` `CHE` `CHL` `CL` `CO` `COL` `CUW` `CW` `CZ` `CZE` `Canada` `Chile` `Colombia` `Croatia` `Curacao` `Czech` `Czechia` `DE` `DEU` `DJ` `DJI` `DK` `DNK` `DO` `DOM` `Denmark` `Djibouti` `DominicanRepublic` `ECB` `EE` `EG` `EGY` `ES` `ESP` `EST` `Egypt` `England` `Estonia` `EuropeanCentralBank` `FI` `FIN` `FR` `FRA` `Finland` `France` `GB` `GBR` `GE` `GEO` `GR` `GRC` `Georgia` `Germany` `Greece` `HK` `HKG` `HN` `HND` `HR` `HRV` `HU` `HUN` `Honduras` `HongKong` `Hungary` `IE` `IL` `IN` `IND` `IRL` `IS` `ISL` `ISR` `IT` `ITA` `Iceland` `India` `Ireland` `IsleOfMan` `Israel` `Italy` `JAM` `JM` `JP` `JPN` `Jamaica` `Japan` `KE` `KEN` `KOR` `KR` `Kenya` `Korea` `LT` `LTU` `LU` `LUX` `LV` `LVA` `Latvia` `Lithuania` `Luxembourg` `MA` `MEX` `MOR` `MOZ` `MW` `MWI` `MX` `MY` `MYS` `MZ` `Malawi` `Malaysia` `Mexico` `Morocco` `Mozambique` `NG` `NGA` `NI` `NIC` `NL` `NLD` `NO` `NOR` `NZ` `NZL` `Netherlands` `NewZealand` `Nicaragua` `Nigeria` `NorthernIreland` `Norway` `PE` `PER` `PL` `POL` `PRT` `PRY` `PT` `PTE` `PY` `Paraguay` `Peru` `Poland` `Polish` `Portugal` `PortugalExt` `RO` `ROU` `RS` `RU` `RUS` `Romania` `Russia` `SA` `SAU` `SE` `SG` `SGP` `SI` `SK` `SRB` `SVK` `SVN` `SWE` `SaudiArabia` `Scotland` `Serbia` `Singapore` `Slovak` `Slovakia` `Slovenia` `SouthAfrica` `Spain` `Sweden` `Switzerland` `TAR` `TR` `TUR` `Turkey` `UA` `UK` `UKR` `US` `USA` `Ukraine` `UnitedArabEmirates` `UnitedKingdom` `UnitedStates` `VEN` `VN` `VNM` `Venezuela` `Vietnam` `Wales` `YV` `ZA` `ZAF`
  </ParamField>

  <ParamField path="region" type="string">
    Region identifier.
    Check table referenced above for valid values.
  </ParamField>
</Accordion>
