holidays.countries.canada

Classes

CA(*args, **kwargs)

param years:

CAN(*args, **kwargs)

param years:

Canada(*args, **kwargs)

References:

CanadaStaticHolidays()

class holidays.countries.canada.Canada(*args, **kwargs)

Bases: ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays

References:
Parameters:
  • years – The year(s) to pre-calculate public holidays for at instantiation.

  • expand – Whether the entire year is calculated when one date from that year is requested.

  • observed – Whether to include the dates when public holiday are observed (e.g. a holiday falling on a Sunday being observed the following Monday). This doesn’t work for all countries.

  • subdiv – The subdivision (e.g. state or province) as a ISO 3166-2 code or its alias; not implemented for all countries (see documentation).

  • provdeprecated use subdiv instead.

  • statedeprecated use subdiv instead.

  • language – The language which the returned holiday names will be translated into. It must be an ISO 639-1 (2-letter) language code. If the language translation is not supported the original holiday names will be used.

  • categories – Requested holiday categories.

Returns:

A HolidayBase object matching the country.

country: str = 'CA'

The country’s ISO 3166-1 alpha-2 code.

default_language: str | None = 'en_CA'

The entity language used by default.

observed_label = '%s (observed)'
supported_categories: Tuple[str, ...] = ('government', 'optional', 'public')

All holiday categories supported by this entity.

subdivisions: Tuple[str, ...] = ('AB', 'BC', 'MB', 'NB', 'NL', 'NS', 'NT', 'NU', 'ON', 'PE', 'QC', 'SK', 'YT')

The subdivisions supported for this country (see documentation).

supported_languages: Tuple[str, ...] = ('ar', 'en_CA', 'en_US', 'fr', 'th')

All languages supported by this entity.

class holidays.countries.canada.CA(*args, **kwargs)

Bases: Canada

Parameters:
  • years – The year(s) to pre-calculate public holidays for at instantiation.

  • expand – Whether the entire year is calculated when one date from that year is requested.

  • observed – Whether to include the dates when public holiday are observed (e.g. a holiday falling on a Sunday being observed the following Monday). This doesn’t work for all countries.

  • subdiv – The subdivision (e.g. state or province) as a ISO 3166-2 code or its alias; not implemented for all countries (see documentation).

  • provdeprecated use subdiv instead.

  • statedeprecated use subdiv instead.

  • language – The language which the returned holiday names will be translated into. It must be an ISO 639-1 (2-letter) language code. If the language translation is not supported the original holiday names will be used.

  • categories – Requested holiday categories.

Returns:

A HolidayBase object matching the country.

class holidays.countries.canada.CAN(*args, **kwargs)

Bases: Canada

Parameters:
  • years – The year(s) to pre-calculate public holidays for at instantiation.

  • expand – Whether the entire year is calculated when one date from that year is requested.

  • observed – Whether to include the dates when public holiday are observed (e.g. a holiday falling on a Sunday being observed the following Monday). This doesn’t work for all countries.

  • subdiv – The subdivision (e.g. state or province) as a ISO 3166-2 code or its alias; not implemented for all countries (see documentation).

  • provdeprecated use subdiv instead.

  • statedeprecated use subdiv instead.

  • language – The language which the returned holiday names will be translated into. It must be an ISO 639-1 (2-letter) language code. If the language translation is not supported the original holiday names will be used.

  • categories – Requested holiday categories.

Returns:

A HolidayBase object matching the country.

class holidays.countries.canada.CanadaStaticHolidays

Bases: object

queen_funeral = 'Funeral of Her Majesty the Queen Elizabeth II'
special_bc_public_holidays = {2022: (9, 19, 'Funeral of Her Majesty the Queen Elizabeth II')}
special_nb_public_holidays = {2022: (9, 19, 'Funeral of Her Majesty the Queen Elizabeth II')}
special_nl_public_holidays = {2022: (9, 19, 'Funeral of Her Majesty the Queen Elizabeth II')}
special_ns_public_holidays = {2022: (9, 19, 'Funeral of Her Majesty the Queen Elizabeth II')}
special_pe_public_holidays = {2022: (9, 19, 'Funeral of Her Majesty the Queen Elizabeth II')}
special_yt_public_holidays = {2022: (9, 19, 'Funeral of Her Majesty the Queen Elizabeth II')}