diff --git a/holidays/countries/angola.py b/holidays/countries/angola.py index a718eb38b..de75eaaf1 100644 --- a/holidays/countries/angola.py +++ b/holidays/countries/angola.py @@ -14,7 +14,7 @@ from typing import Tuple from holidays.calendars.gregorian import AUG, SEP, DEC -from holidays.groups import ChristianHolidays, InternationalHolidays +from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays from holidays.observed_holiday_base import ( ObservedHolidayBase, TUE_TO_PREV_MON, @@ -23,7 +23,7 @@ ) -class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): +class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ References: - https://en.wikipedia.org/wiki/Public_holidays_in_Angola @@ -45,14 +45,11 @@ class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): supported_languages = ("en_US", "pt_AO", "uk") # %s (Observed). observed_label = tr("%s (Ponte)") - special_holidays = { - # General Election Day. - 2017: (AUG, 23, tr("Dia de eleições gerais")), - } def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) + StaticHolidays.__init__(self, cls=AngolaStaticHolidays) super().__init__(observed_rule=TUE_TO_PREV_MON + THU_TO_NEXT_FRI, *args, **kwargs) def _is_observed(self, dt: date) -> bool: @@ -188,3 +185,10 @@ class AO(Angola): class AGO(Angola): pass + + +class AngolaStaticHolidays: + special_holidays = { + # General Election Day. + 2017: (AUG, 23, tr("Dia de eleições gerais")), + } diff --git a/holidays/countries/brunei.py b/holidays/countries/brunei.py index 102fce96d..66d9da6ac 100644 --- a/holidays/countries/brunei.py +++ b/holidays/countries/brunei.py @@ -18,6 +18,7 @@ ChristianHolidays, InternationalHolidays, IslamicHolidays, + StaticHolidays, ) from holidays.observed_holiday_base import ( ObservedHolidayBase, @@ -35,6 +36,7 @@ class Brunei( ChristianHolidays, InternationalHolidays, IslamicHolidays, + StaticHolidays, ): """ A subclass of :py:class:`HolidayBase` representing public holidays in Brunei Darussalam. @@ -69,16 +71,12 @@ class Brunei( observed_label = tr("%s - Diperhatikan") supported_languages = ("en_US", "ms", "th") - special_holidays = { - # Sultan Hassanal Bolkiah's Golden Jubilee celebration - 2017: (OCT, 5, tr("Jubli Emas Sultan Hassanal Bolkiah")), - } - def __init__(self, *args, **kwargs): ChineseCalendarHolidays.__init__(self) ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) IslamicHolidays.__init__(self, cls=BruneiIslamicHolidays) + StaticHolidays.__init__(self, cls=BruneiStaticHolidays) super().__init__(observed_rule=FRI_SUN_TO_NEXT_SAT_MON, *args, **kwargs) def _populate(self, year): @@ -394,3 +392,10 @@ class BruneiIslamicHolidays(_CustomIslamicHolidays): 2022: (APR, 3), 2023: (MAR, 23), } + + +class BruneiStaticHolidays: + special_holidays = { + # Sultan Hassanal Bolkiah's Golden Jubilee celebration + 2017: (OCT, 5, tr("Jubli Emas Sultan Hassanal Bolkiah")), + } diff --git a/holidays/countries/cambodia.py b/holidays/countries/cambodia.py index 23e8450db..35b913e22 100644 --- a/holidays/countries/cambodia.py +++ b/holidays/countries/cambodia.py @@ -54,7 +54,7 @@ class Cambodia(HolidayBase, InternationalHolidays, StaticHolidays, ThaiCalendarH def __init__(self, *args, **kwargs): InternationalHolidays.__init__(self) - StaticHolidays.__init__(self, CameroonStaticHolidays) + StaticHolidays.__init__(self, cls=CambodiaStaticHolidays) ThaiCalendarHolidays.__init__(self, KHMER_CALENDAR) super().__init__(*args, **kwargs) @@ -281,7 +281,7 @@ class KHM(Cambodia): pass -class CameroonStaticHolidays: +class CambodiaStaticHolidays: sangkranta_in_lieu_covid = tr( # Khmer New Year's Replacement Holiday "ថ្ងៃឈប់សម្រាកសងជំនួសឲ្យពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ" diff --git a/holidays/countries/cameroon.py b/holidays/countries/cameroon.py index 27c77a324..ddcdea669 100644 --- a/holidays/countries/cameroon.py +++ b/holidays/countries/cameroon.py @@ -11,11 +11,18 @@ from holidays.calendars import _CustomIslamicHolidays from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC -from holidays.groups import ChristianHolidays, InternationalHolidays, IslamicHolidays +from holidays.groups import ( + ChristianHolidays, + InternationalHolidays, + IslamicHolidays, + StaticHolidays, +) from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_WORKDAY -class Cameroon(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays): +class Cameroon( + ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays +): """ References: - https://en.wikipedia.org/wiki/Public_holidays_in_Cameroon @@ -25,17 +32,12 @@ class Cameroon(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Is country = "CM" observed_label = "%s (Observed)" - special_holidays = { - 2021: ( - (MAY, 14, "Public Holiday"), - (JUL, 19, "Public Holiday"), - ), - } def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) IslamicHolidays.__init__(self, cls=CameroonIslamicHolidays) + StaticHolidays.__init__(self, cls=CameroonStaticHolidays) super().__init__(observed_rule=SUN_TO_NEXT_WORKDAY, *args, **kwargs) def _populate(self, year): @@ -174,3 +176,12 @@ class CameroonIslamicHolidays(_CustomIslamicHolidays): 2021: (OCT, 19), 2022: (OCT, 8), } + + +class CameroonStaticHolidays: + special_holidays = { + 2021: ( + (MAY, 14, "Public Holiday"), + (JUL, 19, "Public Holiday"), + ), + } diff --git a/holidays/countries/china.py b/holidays/countries/china.py index fe0a6415f..09d6888d3 100644 --- a/holidays/countries/china.py +++ b/holidays/countries/china.py @@ -15,11 +15,11 @@ from holidays.calendars.gregorian import JAN, MAY, SEP, OCT, DEC from holidays.constants import HALF_DAY, PUBLIC -from holidays.groups import ChineseCalendarHolidays, InternationalHolidays +from holidays.groups import ChineseCalendarHolidays, InternationalHolidays, StaticHolidays from holidays.holiday_base import HolidayBase -class China(HolidayBase, ChineseCalendarHolidays, InternationalHolidays): +class China(HolidayBase, ChineseCalendarHolidays, InternationalHolidays, StaticHolidays): """ References: - https://en.wikipedia.org/wiki/Public_holidays_in_China @@ -66,58 +66,10 @@ class China(HolidayBase, ChineseCalendarHolidays, InternationalHolidays): default_language = "zh_CN" supported_languages = ("en_US", "th", "zh_CN", "zh_TW") - # Special Cases. - - # New Year's Day. - new_years_day_overflow = tr("元旦") - - # National Day. - national_day_2008_golden_week = tr("国庆节") - - # Mid-Autumn Festival. - mid_autumn_festival_2010_special = tr("中秋节") - - special_public_holidays = { - 2007: ( - # 2007: Overflow from 2008 Notice. - (DEC, 30, new_years_day_overflow), - (DEC, 31, new_years_day_overflow), - ), - 2008: ( - # 2008: weird National Day Golden Week pattern. - (SEP, 29, national_day_2008_golden_week), - (SEP, 30, national_day_2008_golden_week), - (OCT, 4, national_day_2008_golden_week), - (OCT, 5, national_day_2008_golden_week), - ), - 2010: ( - # 2010: doesn't fit with existing observed pattern. - (SEP, 23, mid_autumn_festival_2010_special), - (SEP, 24, mid_autumn_festival_2010_special), - ), - 2013: ( - # 2013: doesn't fit with existing observed pattern. - (JAN, 2, new_years_day_overflow), - (JAN, 3, new_years_day_overflow), - ), - 2018: ( - # 2018: Overflow from 2019 Notice. - (DEC, 30, new_years_day_overflow), - (DEC, 31, new_years_day_overflow), - ), - 2022: ( - # 2022: Overflow from 2023 Notice. - (DEC, 31, new_years_day_overflow), - ), - 2023: ( - # 2023: Overflow from 2023 Notice. - (JAN, 2, new_years_day_overflow), - ), - } - def __init__(self, *args, **kwargs): ChineseCalendarHolidays.__init__(self) InternationalHolidays.__init__(self) + StaticHolidays.__init__(self, cls=ChinaStaticHolidays) super().__init__(*args, **kwargs) def _add_observed_one_off_holidays(self, dt: date): @@ -372,3 +324,54 @@ class CN(China): class CHN(China): pass + + +class ChinaStaticHolidays: + # Special Cases. + + # New Year's Day. + new_years_day_overflow = tr("元旦") + + # National Day. + national_day_2008_golden_week = tr("国庆节") + + # Mid-Autumn Festival. + mid_autumn_festival_2010_special = tr("中秋节") + + special_public_holidays = { + 2007: ( + # 2007: Overflow from 2008 Notice. + (DEC, 30, new_years_day_overflow), + (DEC, 31, new_years_day_overflow), + ), + 2008: ( + # 2008: weird National Day Golden Week pattern. + (SEP, 29, national_day_2008_golden_week), + (SEP, 30, national_day_2008_golden_week), + (OCT, 4, national_day_2008_golden_week), + (OCT, 5, national_day_2008_golden_week), + ), + 2010: ( + # 2010: doesn't fit with existing observed pattern. + (SEP, 23, mid_autumn_festival_2010_special), + (SEP, 24, mid_autumn_festival_2010_special), + ), + 2013: ( + # 2013: doesn't fit with existing observed pattern. + (JAN, 2, new_years_day_overflow), + (JAN, 3, new_years_day_overflow), + ), + 2018: ( + # 2018: Overflow from 2019 Notice. + (DEC, 30, new_years_day_overflow), + (DEC, 31, new_years_day_overflow), + ), + 2022: ( + # 2022: Overflow from 2023 Notice. + (DEC, 31, new_years_day_overflow), + ), + 2023: ( + # 2023: Overflow from 2023 Notice. + (JAN, 2, new_years_day_overflow), + ), + } diff --git a/holidays/countries/eswatini.py b/holidays/countries/eswatini.py index 72c9e4c29..0725e3074 100644 --- a/holidays/countries/eswatini.py +++ b/holidays/countries/eswatini.py @@ -12,11 +12,11 @@ import warnings from holidays.calendars.gregorian import JAN, DEC -from holidays.groups import ChristianHolidays, InternationalHolidays +from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON, SUN_TO_NEXT_TUE -class Eswatini(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): +class Eswatini(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ https://swazilii.org/sz/legislation/act/1938/71 https://www.officeholidays.com/countries/swaziland @@ -24,15 +24,11 @@ class Eswatini(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): country = "SZ" observed_label = "%s (Observed)" - special_holidays = { - # https://mg.co.za/article/1999-12-09-swaziland-declares-bank-holidays/ - 1999: (DEC, 31, "Y2K changeover"), - 2000: (JAN, 3, "Y2K changeover"), - } def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) + StaticHolidays.__init__(self, cls=EswatiniStaticHolidays) super().__init__(observed_rule=SUN_TO_NEXT_MON, observed_since=2021, *args, **kwargs) def _populate(self, year): @@ -87,3 +83,11 @@ class SZ(Eswatini): class SZW(Eswatini): pass + + +class EswatiniStaticHolidays: + special_holidays = { + # https://mg.co.za/article/1999-12-09-swaziland-declares-bank-holidays/ + 1999: (DEC, 31, "Y2K changeover"), + 2000: (JAN, 3, "Y2K changeover"), + } diff --git a/holidays/countries/indonesia.py b/holidays/countries/indonesia.py index 147a6ced0..d99e2b0a8 100644 --- a/holidays/countries/indonesia.py +++ b/holidays/countries/indonesia.py @@ -24,6 +24,7 @@ ChristianHolidays, InternationalHolidays, IslamicHolidays, + StaticHolidays, ) from holidays.holiday_base import HolidayBase @@ -35,6 +36,7 @@ class Indonesia( ChristianHolidays, InternationalHolidays, IslamicHolidays, + StaticHolidays, ): """ References: @@ -50,48 +52,13 @@ class Indonesia( supported_languages = ("en_US", "id", "uk") supported_categories = {GOVERNMENT, PUBLIC} - # Election Day. - election_day = tr("Hari Pemilihan") - # Eid al-Fitr Joint Holiday. - eid_al_fitr_joint_holiday = tr("Cuti Bersama Hari Raya Idulfitri") - # Christmas Joint Holiday. - christmas_joint_holiday = tr("Cuti Bersama Hari Raya Natal") - # Lunar New Year Joint Holiday. - lunar_new_year_joint_holiday = tr("Cuti Bersama Tahun Baru Imlek") - # Day of Silence Joint Holiday. - day_of_silence_joint_holiday = tr("Cuti Bersama Hari Suci Nyepi") - - special_public_holidays = { - 2018: (JUN, 27, election_day), - 2019: (APR, 17, election_day), - 2020: (DEC, 9, election_day), - } - special_government_holidays = { - 2022: ( - (APR, 29, eid_al_fitr_joint_holiday), - (MAY, 4, eid_al_fitr_joint_holiday), - (MAY, 5, eid_al_fitr_joint_holiday), - (MAY, 6, eid_al_fitr_joint_holiday), - (DEC, 26, christmas_joint_holiday), - ), - 2023: ( - (JAN, 23, lunar_new_year_joint_holiday), - (MAR, 23, day_of_silence_joint_holiday), - (APR, 19, eid_al_fitr_joint_holiday), - (APR, 20, eid_al_fitr_joint_holiday), - (APR, 21, eid_al_fitr_joint_holiday), - (APR, 24, eid_al_fitr_joint_holiday), - (APR, 25, eid_al_fitr_joint_holiday), - (DEC, 26, christmas_joint_holiday), - ), - } - def __init__(self, *args, **kwargs): BuddhistCalendarHolidays.__init__(self, cls=IndonesiaBuddhistHolidays, show_estimated=True) ChineseCalendarHolidays.__init__(self, cls=IndonesiaChineseHolidays, show_estimated=True) ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) IslamicHolidays.__init__(self, cls=IndonesiaIslamicHolidays) + StaticHolidays.__init__(self, cls=IndonesiaStaticHolidays) super().__init__(*args, **kwargs) def _populate_public_holidays(self): @@ -380,3 +347,41 @@ class IndonesiaIslamicHolidays(_CustomIslamicHolidays): 2021: (OCT, 19), 2022: (OCT, 8), } + + +class IndonesiaStaticHolidays: + # Election Day. + election_day = tr("Hari Pemilihan") + # Eid al-Fitr Joint Holiday. + eid_al_fitr_joint_holiday = tr("Cuti Bersama Hari Raya Idulfitri") + # Christmas Joint Holiday. + christmas_joint_holiday = tr("Cuti Bersama Hari Raya Natal") + # Lunar New Year Joint Holiday. + lunar_new_year_joint_holiday = tr("Cuti Bersama Tahun Baru Imlek") + # Day of Silence Joint Holiday. + day_of_silence_joint_holiday = tr("Cuti Bersama Hari Suci Nyepi") + + special_public_holidays = { + 2018: (JUN, 27, election_day), + 2019: (APR, 17, election_day), + 2020: (DEC, 9, election_day), + } + special_government_holidays = { + 2022: ( + (APR, 29, eid_al_fitr_joint_holiday), + (MAY, 4, eid_al_fitr_joint_holiday), + (MAY, 5, eid_al_fitr_joint_holiday), + (MAY, 6, eid_al_fitr_joint_holiday), + (DEC, 26, christmas_joint_holiday), + ), + 2023: ( + (JAN, 23, lunar_new_year_joint_holiday), + (MAR, 23, day_of_silence_joint_holiday), + (APR, 19, eid_al_fitr_joint_holiday), + (APR, 20, eid_al_fitr_joint_holiday), + (APR, 21, eid_al_fitr_joint_holiday), + (APR, 24, eid_al_fitr_joint_holiday), + (APR, 25, eid_al_fitr_joint_holiday), + (DEC, 26, christmas_joint_holiday), + ), + } diff --git a/holidays/countries/japan.py b/holidays/countries/japan.py index c70137919..1d9a019bb 100644 --- a/holidays/countries/japan.py +++ b/holidays/countries/japan.py @@ -16,12 +16,12 @@ from holidays.calendars.gregorian import FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV from holidays.constants import BANK, PUBLIC -from holidays.groups import InternationalHolidays +from holidays.groups import InternationalHolidays, StaticHolidays from holidays.helpers import _normalize_tuple from holidays.holiday_base import HolidayBase -class Japan(HolidayBase, InternationalHolidays): +class Japan(HolidayBase, InternationalHolidays, StaticHolidays): """ References: @@ -31,21 +31,12 @@ class Japan(HolidayBase, InternationalHolidays): country = "JP" default_language = "ja" - special_public_holidays = { - 1959: (APR, 10, tr("結婚の儀")), # The Crown Prince marriage ceremony. - 1989: (FEB, 24, tr("大喪の礼")), # State Funeral of Emperor Shōwa. - 1990: (NOV, 12, tr("即位礼正殿の儀")), # Enthronement ceremony. - 1993: (JUN, 9, tr("結婚の儀")), # The Crown Prince marriage ceremony. - 2019: ( - (MAY, 1, tr("天皇の即位の日")), # Enthronement day. - (OCT, 22, tr("即位礼正殿の儀が行われる日")), # Enthronement ceremony. - ), - } supported_categories = {BANK, PUBLIC} supported_languages = ("en_US", "ja") def __init__(self, *args, **kwargs) -> None: InternationalHolidays.__init__(self) + StaticHolidays.__init__(self, cls=JapanStaticHolidays) super().__init__(*args, **kwargs) def _populate_public_holidays(self): @@ -240,3 +231,16 @@ class JP(Japan): class JPN(Japan): pass + + +class JapanStaticHolidays: + special_public_holidays = { + 1959: (APR, 10, tr("結婚の儀")), # The Crown Prince marriage ceremony. + 1989: (FEB, 24, tr("大喪の礼")), # State Funeral of Emperor Shōwa. + 1990: (NOV, 12, tr("即位礼正殿の儀")), # Enthronement ceremony. + 1993: (JUN, 9, tr("結婚の儀")), # The Crown Prince marriage ceremony. + 2019: ( + (MAY, 1, tr("天皇の即位の日")), # Enthronement day. + (OCT, 22, tr("即位礼正殿の儀が行われる日")), # Enthronement ceremony. + ), + } diff --git a/holidays/countries/kenya.py b/holidays/countries/kenya.py index 02d455416..b9d52e6f8 100644 --- a/holidays/countries/kenya.py +++ b/holidays/countries/kenya.py @@ -10,11 +10,11 @@ # License: MIT (see LICENSE file) from holidays.calendars.gregorian import FEB, APR, AUG, SEP -from holidays.groups import ChristianHolidays, InternationalHolidays +from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON, SUN_TO_NEXT_TUE -class Kenya(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): +class Kenya(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ https://en.wikipedia.org/wiki/Public_holidays_in_Kenya http://kenyaembassyberlin.de/Public-Holidays-in-Kenya.48.0.html @@ -23,21 +23,11 @@ class Kenya(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): country = "KE" observed_label = "%s (Observed)" - special_holidays = { - 2020: (FEB, 11, "President Moi Celebration of Life Day"), - 2022: ( - (APR, 29, "State Funeral for Former President Mwai Kibaki"), - (AUG, 9, "Election Day"), - (SEP, 10, "Day of Mourning for Queen Elizabeth II"), - (SEP, 11, "Day of Mourning for Queen Elizabeth II"), - (SEP, 12, "Day of Mourning for Queen Elizabeth II"), - (SEP, 13, "Inauguration Day"), - ), - } def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) + StaticHolidays.__init__(self, cls=KenyaStaticHolidays) super().__init__(observed_rule=SUN_TO_NEXT_MON, *args, **kwargs) def _populate(self, year): @@ -89,3 +79,17 @@ class KE(Kenya): class KEN(Kenya): pass + + +class KenyaStaticHolidays: + special_holidays = { + 2020: (FEB, 11, "President Moi Celebration of Life Day"), + 2022: ( + (APR, 29, "State Funeral for Former President Mwai Kibaki"), + (AUG, 9, "Election Day"), + (SEP, 10, "Day of Mourning for Queen Elizabeth II"), + (SEP, 11, "Day of Mourning for Queen Elizabeth II"), + (SEP, 12, "Day of Mourning for Queen Elizabeth II"), + (SEP, 13, "Inauguration Day"), + ), + } diff --git a/holidays/countries/laos.py b/holidays/countries/laos.py index 4b4225cf6..8e588e23b 100644 --- a/holidays/countries/laos.py +++ b/holidays/countries/laos.py @@ -14,7 +14,7 @@ from holidays.calendars.gregorian import JAN, MAR, APR, MAY, JUL, OCT, DEC from holidays.calendars.thai import KHMER_CALENDAR from holidays.constants import BANK, PUBLIC, SCHOOL, WORKDAY -from holidays.groups import InternationalHolidays, ThaiCalendarHolidays +from holidays.groups import InternationalHolidays, ThaiCalendarHolidays, StaticHolidays from holidays.observed_holiday_base import ( ObservedHolidayBase, THU_FRI_TO_NEXT_MON, @@ -25,7 +25,7 @@ ) -class Laos(ObservedHolidayBase, InternationalHolidays, ThaiCalendarHolidays): +class Laos(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiCalendarHolidays): """ A subclass of :py:class:`HolidayBase` representing public holidays in Laos. @@ -68,77 +68,12 @@ class Laos(ObservedHolidayBase, InternationalHolidays, ThaiCalendarHolidays): default_language = "lo" # %s (in lieu). observed_label = tr("ພັກຊົດເຊີຍ%s") - - # Special Cases. - - # Special Bank Holiday. - special_bank_day_off = tr("ມື້ປິດການໃຫ້ບໍລິການຂອງທະນາຄານຕົວແທນ") - - # New Year's Day (in lieu). - new_year_day_in_lieu = tr("ພັກຊົດເຊີຍວັນປີໃໝ່ສາກົນ") - - # Internation Women's Rights Day (in lieu). - international_womens_rights_day_in_lieu = tr("ພັກຊົດເຊີຍວັນແມ່ຍິງສາກົນ") - - # Lao New Year's Day (in lieu). - lao_new_year_in_lieu = tr("ພັກຊົດເຊີຍບຸນປີໃໝ່ລາວ") - - # Lao New Year's Day (Special). - lao_new_year_special = tr("ພັກບຸນປີໃໝ່ລາວ") - - # Labor Day (in lieu). - labor_day_in_lieu = tr("ພັກຊົດເຊີຍວັນກຳມະກອນສາກົນ") - - # Establishment Day of the Lao Women's Union (in lieu). - lao_womens_union_in_lieu = tr("ພັກຊົດເຊີຍວັນສ້າງຕັ້ງສະຫະພັນແມ່ຍິງລາວ") - - # Establishment Day of the BOL (in lieu). - establishment_day_of_bol_in_lieu = tr("ພັກຊົດເຊີຍວັນສ້າງຕັ້ງທະນາຄານແຫ່ງ ສປປ ລາວ") - - # Lao National Day (in lieu). - lao_national_day_in_lieu = tr("ພັກຊົດເຊີຍວັນຊາດ") - - special_bank_holidays = { - 2015: (JAN, 2, special_bank_day_off), - 2017: (OCT, 9, establishment_day_of_bol_in_lieu), - } - special_public_holidays = { - 2011: (APR, 13, lao_new_year_in_lieu), - 2012: ( - (JAN, 2, new_year_day_in_lieu), - (APR, 13, lao_new_year_in_lieu), - (APR, 17, lao_new_year_in_lieu), - (DEC, 3, lao_national_day_in_lieu), - ), - 2013: (APR, 17, lao_new_year_in_lieu), - 2015: ( - (MAR, 9, international_womens_rights_day_in_lieu), - (APR, 17, lao_new_year_special), - ), - 2016: ( - (APR, 13, lao_new_year_special), - (APR, 18, lao_new_year_special), - (MAY, 2, labor_day_in_lieu), - ), - 2017: ( - (JAN, 2, new_year_day_in_lieu), - (APR, 13, lao_new_year_in_lieu), - (APR, 17, lao_new_year_in_lieu), - (DEC, 4, lao_national_day_in_lieu), - ), - 2020: ( - (APR, 13, lao_new_year_special), - (APR, 17, lao_new_year_special), - ), - } - special_workday_holidays = { - 2019: (JUL, 22, lao_womens_union_in_lieu), - } supported_languages = ("en_US", "lo", "th") def __init__(self, *args, **kwargs): InternationalHolidays.__init__(self) ThaiCalendarHolidays.__init__(self, KHMER_CALENDAR) + StaticHolidays.__init__(self, cls=LaosStaticHolidays) super().__init__(observed_rule=SAT_SUN_TO_NEXT_MON, observed_since=2018, *args, **kwargs) def _populate_bank_holidays(self): @@ -447,3 +382,71 @@ class LA(Laos): class LAO(Laos): pass + + +class LaosStaticHolidays: + # Special Cases. + + # Special Bank Holiday. + special_bank_day_off = tr("ມື້ປິດການໃຫ້ບໍລິການຂອງທະນາຄານຕົວແທນ") + + # New Year's Day (in lieu). + new_year_day_in_lieu = tr("ພັກຊົດເຊີຍວັນປີໃໝ່ສາກົນ") + + # Internation Women's Rights Day (in lieu). + international_womens_rights_day_in_lieu = tr("ພັກຊົດເຊີຍວັນແມ່ຍິງສາກົນ") + + # Lao New Year's Day (in lieu). + lao_new_year_in_lieu = tr("ພັກຊົດເຊີຍບຸນປີໃໝ່ລາວ") + + # Lao New Year's Day (Special). + lao_new_year_special = tr("ພັກບຸນປີໃໝ່ລາວ") + + # Labor Day (in lieu). + labor_day_in_lieu = tr("ພັກຊົດເຊີຍວັນກຳມະກອນສາກົນ") + + # Establishment Day of the Lao Women's Union (in lieu). + lao_womens_union_in_lieu = tr("ພັກຊົດເຊີຍວັນສ້າງຕັ້ງສະຫະພັນແມ່ຍິງລາວ") + + # Establishment Day of the BOL (in lieu). + establishment_day_of_bol_in_lieu = tr("ພັກຊົດເຊີຍວັນສ້າງຕັ້ງທະນາຄານແຫ່ງ ສປປ ລາວ") + + # Lao National Day (in lieu). + lao_national_day_in_lieu = tr("ພັກຊົດເຊີຍວັນຊາດ") + + special_bank_holidays = { + 2015: (JAN, 2, special_bank_day_off), + 2017: (OCT, 9, establishment_day_of_bol_in_lieu), + } + special_public_holidays = { + 2011: (APR, 13, lao_new_year_in_lieu), + 2012: ( + (JAN, 2, new_year_day_in_lieu), + (APR, 13, lao_new_year_in_lieu), + (APR, 17, lao_new_year_in_lieu), + (DEC, 3, lao_national_day_in_lieu), + ), + 2013: (APR, 17, lao_new_year_in_lieu), + 2015: ( + (MAR, 9, international_womens_rights_day_in_lieu), + (APR, 17, lao_new_year_special), + ), + 2016: ( + (APR, 13, lao_new_year_special), + (APR, 18, lao_new_year_special), + (MAY, 2, labor_day_in_lieu), + ), + 2017: ( + (JAN, 2, new_year_day_in_lieu), + (APR, 13, lao_new_year_in_lieu), + (APR, 17, lao_new_year_in_lieu), + (DEC, 4, lao_national_day_in_lieu), + ), + 2020: ( + (APR, 13, lao_new_year_special), + (APR, 17, lao_new_year_special), + ), + } + special_workday_holidays = { + 2019: (JUL, 22, lao_womens_union_in_lieu), + } diff --git a/holidays/countries/slovakia.py b/holidays/countries/slovakia.py index fb9abc5db..30be81360 100644 --- a/holidays/countries/slovakia.py +++ b/holidays/countries/slovakia.py @@ -13,11 +13,11 @@ from holidays.calendars.gregorian import OCT from holidays.constants import PUBLIC, WORKDAY -from holidays.groups import ChristianHolidays, InternationalHolidays +from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays from holidays.holiday_base import HolidayBase -class Slovakia(HolidayBase, ChristianHolidays, InternationalHolidays): +class Slovakia(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ https://en.wikipedia.org/wiki/Public_holidays_in_Slovakia https://sk.wikipedia.org/wiki/Zoznam_sviatkov_na_Slovensku @@ -26,17 +26,13 @@ class Slovakia(HolidayBase, ChristianHolidays, InternationalHolidays): country = "SK" default_language = "sk" - special_public_holidays = { - # 100th anniversary of the adoption of the Declaration - # of the Slovak Nation. - 2018: (OCT, 30, tr("100. výročie prijatia Deklarácie slovenského národa")) - } supported_categories = {PUBLIC, WORKDAY} supported_languages = ("en_US", "sk", "uk") def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) + StaticHolidays.__init__(self, cls=SlovakiaStaticHolidays) super().__init__(*args, **kwargs) def _populate_public_holidays(self): @@ -107,3 +103,11 @@ class SK(Slovakia): class SVK(Slovakia): pass + + +class SlovakiaStaticHolidays: + special_public_holidays = { + # 100th anniversary of the adoption of the Declaration + # of the Slovak Nation. + 2018: (OCT, 30, tr("100. výročie prijatia Deklarácie slovenského národa")) + } diff --git a/holidays/countries/south_korea.py b/holidays/countries/south_korea.py index dedb227db..68c63d8a7 100644 --- a/holidays/countries/south_korea.py +++ b/holidays/countries/south_korea.py @@ -17,46 +17,46 @@ from holidays.calendars import _CustomChineseHolidays from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, AUG, SEP, SAT, SUN from holidays.constants import BANK, PUBLIC -from holidays.groups import ChineseCalendarHolidays, ChristianHolidays, InternationalHolidays +from holidays.groups import ( + ChineseCalendarHolidays, + ChristianHolidays, + InternationalHolidays, + StaticHolidays, +) from holidays.holiday_base import HolidayBase -class SouthKorea(HolidayBase, ChineseCalendarHolidays, ChristianHolidays, InternationalHolidays): +class SouthKorea( + HolidayBase, + ChineseCalendarHolidays, + ChristianHolidays, + InternationalHolidays, + StaticHolidays, +): """ + References: 1. https://publicholidays.co.kr/ko/2020-dates/ 2. https://en.wikipedia.org/wiki/Public_holidays_in_South_Korea - 3. https://www.law.go.kr/%EB%B2%95%EB%A0%B9/%EA%B4%80%EA%B3%B5%EC%84%9C%EC%9D%98%20%EA%B3%B5%ED%9C%B4%EC%9D%BC%EC%97%90%20%EA%B4%80%ED%95%9C%20%EA%B7%9C%EC%A0%95 # noqa + 3. https://www.law.go.kr/법령/관공서의%20공휴일에%20관한%20규정 According to (3), the alt holidays in Korea are as follows: - The alt holiday means next first non holiday after the holiday. - Independence movement day, Liberation day, National Foundation Day, - Hangul Day, Children's Day, Birthday of the Buddha, Christmas Day have alt holiday if they fell on Saturday or Sunday. - Lunar New Year's Day, Korean Mid Autumn Day have alt holiday if they fell - on only sunday. + - The alt holiday means next first non holiday after the holiday. + - Independence Movement Day, Liberation Day, National Foundation Day, + Hangul Day, Children's Day, Birthday of the Buddha, Christmas Day have + alt holiday if they fell on Saturday or Sunday. + - Lunar New Year's Day, Korean Mid Autumn Day have alt holiday if they + fell on Sunday. """ country = "KR" supported_categories = {BANK, PUBLIC} - special_public_holidays = { - 2016: (APR, 13, "National Assembly Election Day"), - 2017: (MAY, 9, "Presidential Election Day"), - 2018: (JUN, 13, "Local Election Day"), - 2020: ( - (APR, 15, "National Assembly Election Day"), - # Since 2020.08.15 is Sat, the government decided to make 2020.08.17 holiday. - (AUG, 17, "Alternative public holiday"), - ), - 2022: ( - (MAR, 9, "Presidential Election Day"), - (JUN, 1, "Local Election Day"), - ), - } def __init__(self, *args, **kwargs): ChineseCalendarHolidays.__init__(self, cls=SouthKoreaLunisolarHolidays) ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) + StaticHolidays.__init__(self, cls=SouthKoreaStaticHolidays) super().__init__(*args, **kwargs) def _add_alt_holiday( @@ -206,3 +206,20 @@ class SouthKoreaLunisolarHolidays(_CustomChineseHolidays): 1942: (SEP, 25), 2040: (SEP, 21), } + + +class SouthKoreaStaticHolidays: + special_public_holidays = { + 2016: (APR, 13, "National Assembly Election Day"), + 2017: (MAY, 9, "Presidential Election Day"), + 2018: (JUN, 13, "Local Election Day"), + 2020: ( + (APR, 15, "National Assembly Election Day"), + # Since 2020.08.15 is Sat, the government decided to make 2020.08.17 holiday. + (AUG, 17, "Alternative public holiday"), + ), + 2022: ( + (MAR, 9, "Presidential Election Day"), + (JUN, 1, "Local Election Day"), + ), + } diff --git a/holidays/countries/uruguay.py b/holidays/countries/uruguay.py index 22e84e5a1..10e312407 100644 --- a/holidays/countries/uruguay.py +++ b/holidays/countries/uruguay.py @@ -15,7 +15,7 @@ from holidays.calendars.gregorian import MAR from holidays.constants import BANK, PUBLIC -from holidays.groups import ChristianHolidays, InternationalHolidays +from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays from holidays.observed_holiday_base import ( ObservedHolidayBase, TUE_WED_TO_PREV_MON, @@ -23,7 +23,7 @@ ) -class Uruguay(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): +class Uruguay(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ References: - https://en.wikipedia.org/wiki/Public_holidays_in_Uruguay @@ -40,22 +40,10 @@ class Uruguay(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): supported_categories = {BANK, PUBLIC} supported_languages = ("en_US", "es", "uk") - # Presidential Inauguration Day. - presidential_inauguration_day = tr("Inauguración del Presidente de la República") - special_public_holidays = { - 1985: (MAR, 1, presidential_inauguration_day), - 1990: (MAR, 1, presidential_inauguration_day), - 1995: (MAR, 1, presidential_inauguration_day), - 2000: (MAR, 1, presidential_inauguration_day), - 2005: (MAR, 1, presidential_inauguration_day), - 2010: (MAR, 1, presidential_inauguration_day), - 2015: (MAR, 1, presidential_inauguration_day), - 2020: (MAR, 1, presidential_inauguration_day), - } - def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) + StaticHolidays.__init__(self, cls=UruguayStaticHolidays) # Decree Law #14977, # 15535, #16805. super().__init__(observed_rule=TUE_WED_TO_PREV_MON + THU_FRI_TO_NEXT_MON, *args, **kwargs) @@ -172,3 +160,18 @@ class UY(Uruguay): class URY(Uruguay): pass + + +class UruguayStaticHolidays: + # Presidential Inauguration Day. + presidential_inauguration_day = tr("Inauguración del Presidente de la República") + special_public_holidays = { + 1985: (MAR, 1, presidential_inauguration_day), + 1990: (MAR, 1, presidential_inauguration_day), + 1995: (MAR, 1, presidential_inauguration_day), + 2000: (MAR, 1, presidential_inauguration_day), + 2005: (MAR, 1, presidential_inauguration_day), + 2010: (MAR, 1, presidential_inauguration_day), + 2015: (MAR, 1, presidential_inauguration_day), + 2020: (MAR, 1, presidential_inauguration_day), + }