holidays 0.67__py3-none-any.whl → 0.69__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. holidays/calendars/__init__.py +1 -0
  2. holidays/calendars/balinese_saka.py +112 -0
  3. holidays/calendars/chinese.py +1 -1
  4. holidays/calendars/hindu.py +865 -1
  5. holidays/constants.py +1 -0
  6. holidays/countries/__init__.py +1 -0
  7. holidays/countries/afghanistan.py +8 -2
  8. holidays/countries/albania.py +8 -2
  9. holidays/countries/algeria.py +6 -2
  10. holidays/countries/american_samoa.py +6 -2
  11. holidays/countries/azerbaijan.py +26 -4
  12. holidays/countries/bahrain.py +8 -2
  13. holidays/countries/bosnia_and_herzegovina.py +8 -2
  14. holidays/countries/brunei.py +8 -2
  15. holidays/countries/burkina_faso.py +8 -2
  16. holidays/countries/burundi.py +6 -2
  17. holidays/countries/cameroon.py +8 -2
  18. holidays/countries/chad.py +8 -2
  19. holidays/countries/djibouti.py +6 -2
  20. holidays/countries/egypt.py +6 -2
  21. holidays/countries/ethiopia.py +8 -2
  22. holidays/countries/gabon.py +8 -2
  23. holidays/countries/ghana.py +6 -2
  24. holidays/countries/guam.py +6 -2
  25. holidays/countries/hongkong.py +38 -52
  26. holidays/countries/india.py +482 -166
  27. holidays/countries/indonesia.py +14 -58
  28. holidays/countries/iran.py +8 -2
  29. holidays/countries/jordan.py +6 -2
  30. holidays/countries/kazakhstan.py +8 -2
  31. holidays/countries/kenya.py +209 -47
  32. holidays/countries/kuwait.py +6 -2
  33. holidays/countries/kyrgyzstan.py +6 -2
  34. holidays/countries/macau.py +474 -0
  35. holidays/countries/malaysia.py +30 -6
  36. holidays/countries/maldives.py +6 -2
  37. holidays/countries/mauritania.py +6 -2
  38. holidays/countries/montenegro.py +8 -2
  39. holidays/countries/morocco.py +6 -2
  40. holidays/countries/nigeria.py +6 -2
  41. holidays/countries/north_macedonia.py +6 -2
  42. holidays/countries/northern_mariana_islands.py +6 -2
  43. holidays/countries/pakistan.py +8 -2
  44. holidays/countries/philippines.py +13 -3
  45. holidays/countries/poland.py +1 -1
  46. holidays/countries/puerto_rico.py +6 -2
  47. holidays/countries/saudi_arabia.py +6 -2
  48. holidays/countries/singapore.py +7 -2
  49. holidays/countries/spain.py +8 -2
  50. holidays/countries/sri_lanka.py +8 -2
  51. holidays/countries/taiwan.py +226 -29
  52. holidays/countries/tanzania.py +8 -2
  53. holidays/countries/timor_leste.py +21 -2
  54. holidays/countries/tunisia.py +6 -2
  55. holidays/countries/turkey.py +8 -2
  56. holidays/countries/united_arab_emirates.py +8 -2
  57. holidays/countries/united_states.py +84 -35
  58. holidays/countries/united_states_minor_outlying_islands.py +6 -2
  59. holidays/countries/united_states_virgin_islands.py +6 -2
  60. holidays/countries/uzbekistan.py +8 -2
  61. holidays/groups/__init__.py +1 -0
  62. holidays/groups/balinese_saka.py +45 -0
  63. holidays/groups/chinese.py +68 -3
  64. holidays/groups/hindu.py +255 -0
  65. holidays/groups/islamic.py +5 -2
  66. holidays/holiday_base.py +44 -29
  67. holidays/locale/de/LC_MESSAGES/PL.mo +0 -0
  68. holidays/locale/en_HK/LC_MESSAGES/HK.mo +0 -0
  69. holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
  70. holidays/locale/en_KE/LC_MESSAGES/KE.mo +0 -0
  71. holidays/locale/en_MO/LC_MESSAGES/MO.mo +0 -0
  72. holidays/locale/en_US/LC_MESSAGES/HK.mo +0 -0
  73. holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
  74. holidays/locale/en_US/LC_MESSAGES/KE.mo +0 -0
  75. holidays/locale/en_US/LC_MESSAGES/MO.mo +0 -0
  76. holidays/locale/en_US/LC_MESSAGES/MY.mo +0 -0
  77. holidays/locale/en_US/LC_MESSAGES/TW.mo +0 -0
  78. holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
  79. holidays/locale/ms_MY/LC_MESSAGES/MY.mo +0 -0
  80. holidays/locale/pt_MO/LC_MESSAGES/MO.mo +0 -0
  81. holidays/locale/sw/LC_MESSAGES/KE.mo +0 -0
  82. holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
  83. holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
  84. holidays/locale/th/LC_MESSAGES/MY.mo +0 -0
  85. holidays/locale/th/LC_MESSAGES/TW.mo +0 -0
  86. holidays/locale/zh_CN/LC_MESSAGES/HK.mo +0 -0
  87. holidays/locale/zh_CN/LC_MESSAGES/MO.mo +0 -0
  88. holidays/locale/zh_CN/LC_MESSAGES/TW.mo +0 -0
  89. holidays/locale/zh_HK/LC_MESSAGES/HK.mo +0 -0
  90. holidays/locale/zh_MO/LC_MESSAGES/MO.mo +0 -0
  91. holidays/locale/zh_TW/LC_MESSAGES/TW.mo +0 -0
  92. holidays/registry.py +1 -0
  93. holidays/version.py +1 -1
  94. {holidays-0.67.dist-info → holidays-0.69.dist-info}/AUTHORS +1 -0
  95. {holidays-0.67.dist-info → holidays-0.69.dist-info}/METADATA +24 -19
  96. {holidays-0.67.dist-info → holidays-0.69.dist-info}/RECORD +99 -83
  97. {holidays-0.67.dist-info → holidays-0.69.dist-info}/WHEEL +1 -1
  98. {holidays-0.67.dist-info → holidays-0.69.dist-info}/LICENSE +0 -0
  99. {holidays-0.67.dist-info → holidays-0.69.dist-info}/top_level.txt +0 -0
@@ -31,10 +31,14 @@ class Nigeria(
31
31
  observed_label = "%s (observed)"
32
32
  start_year = 1979
33
33
 
34
- def __init__(self, *args, **kwargs):
34
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
35
+ """
36
+ :param islamic_show_estimated:
37
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
38
+ """
35
39
  ChristianHolidays.__init__(self)
36
40
  InternationalHolidays.__init__(self)
37
- IslamicHolidays.__init__(self)
41
+ IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
38
42
  StaticHolidays.__init__(self, NigeriaStaticHolidays)
39
43
  kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_WORKDAY)
40
44
  kwargs.setdefault("observed_since", 2016)
@@ -22,10 +22,14 @@ class NorthMacedonia(HolidayBase, ChristianHolidays, InternationalHolidays, Isla
22
22
 
23
23
  country = "MK"
24
24
 
25
- def __init__(self, *args, **kwargs):
25
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
26
+ """
27
+ :param islamic_show_estimated:
28
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
29
+ """
26
30
  ChristianHolidays.__init__(self, JULIAN_CALENDAR)
27
31
  InternationalHolidays.__init__(self)
28
- IslamicHolidays.__init__(self)
32
+ IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
29
33
  super().__init__(*args, **kwargs)
30
34
 
31
35
  def _populate_public_holidays(self):
@@ -10,7 +10,7 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from holidays.constants import PUBLIC, UNOFFICIAL
13
+ from holidays.constants import GOVERNMENT, PUBLIC, UNOFFICIAL
14
14
  from holidays.countries.united_states import US
15
15
 
16
16
 
@@ -20,13 +20,17 @@ class HolidaysMP(US):
20
20
  # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1
21
21
 
22
22
  country = "MP"
23
- supported_categories = (PUBLIC, UNOFFICIAL)
23
+ supported_categories = (GOVERNMENT, PUBLIC, UNOFFICIAL)
24
24
  subdivisions = () # Override US subdivisions.
25
25
 
26
26
  def _populate_public_holidays(self) -> None:
27
27
  self.subdiv = "MP"
28
28
  super()._populate_public_holidays()
29
29
 
30
+ def _populate_government_holidays(self) -> None:
31
+ self.subdiv = "MP"
32
+ super()._populate_government_holidays()
33
+
30
34
  def _populate_unofficial_holidays(self) -> None:
31
35
  self.subdiv = "MP"
32
36
  super()._populate_unofficial_holidays()
@@ -20,9 +20,15 @@ class Pakistan(HolidayBase, InternationalHolidays, IslamicHolidays):
20
20
  country = "PK"
21
21
  start_year = 1948
22
22
 
23
- def __init__(self, *args, **kwargs):
23
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
24
+ """
25
+ :param islamic_show_estimated:
26
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
27
+ """
24
28
  InternationalHolidays.__init__(self)
25
- IslamicHolidays.__init__(self, cls=PakistanIslamicHolidays)
29
+ IslamicHolidays.__init__(
30
+ self, cls=PakistanIslamicHolidays, show_estimated=islamic_show_estimated
31
+ )
26
32
  super().__init__(*args, **kwargs)
27
33
 
28
34
  def _populate_public_holidays(self):
@@ -13,7 +13,7 @@
13
13
  from gettext import gettext as tr
14
14
 
15
15
  from holidays.calendars import _CustomChineseHolidays, _CustomIslamicHolidays
16
- from holidays.calendars.gregorian import JAN, FEB, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
16
+ from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
17
17
  from holidays.constants import PUBLIC, WORKDAY
18
18
  from holidays.groups import (
19
19
  ChineseCalendarHolidays,
@@ -50,6 +50,7 @@ class Philippines(
50
50
  - `Proclamation No. 665/2024` <https://www.officialgazette.gov.ph/2024/08/15/proclamation-no-665-s-2024/>`_
51
51
  - `Proclamation No. 729/2024` <https://www.officialgazette.gov.ph/2024/10/30/proclamation-no-729-s-2024/>`_
52
52
  - `Nationwide holidays 2018-2025 <https://www.officialgazette.gov.ph/nationwide-holidays/2018/>`_
53
+ - `2025 Eid'l Fitr and Eid'l Adha Tentative Date <https://melbournepcg.org/?page_id=9779>`_
53
54
  """
54
55
 
55
56
  country = "PH"
@@ -60,11 +61,17 @@ class Philippines(
60
61
  supported_languages = ("en_PH", "en_US", "fil", "th")
61
62
  start_year = 1988
62
63
 
63
- def __init__(self, *args, **kwargs):
64
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
65
+ """
66
+ :param islamic_show_estimated:
67
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
68
+ """
64
69
  ChineseCalendarHolidays.__init__(self, cls=PhilippinesChineseHolidays)
65
70
  ChristianHolidays.__init__(self)
66
71
  InternationalHolidays.__init__(self)
67
- IslamicHolidays.__init__(self, cls=PhilippinesIslamicHolidays)
72
+ IslamicHolidays.__init__(
73
+ self, cls=PhilippinesIslamicHolidays, show_estimated=islamic_show_estimated
74
+ )
68
75
  StaticHolidays.__init__(self, cls=PhilippinesStaticHolidays)
69
76
  super().__init__(*args, **kwargs)
70
77
 
@@ -203,6 +210,7 @@ class PhilippinesChineseHolidays(_CustomChineseHolidays):
203
210
  2022: (FEB, 1),
204
211
  2023: (JAN, 22),
205
212
  2024: (FEB, 10),
213
+ 2025: (JAN, 29),
206
214
  }
207
215
 
208
216
 
@@ -223,6 +231,7 @@ class PhilippinesIslamicHolidays(_CustomIslamicHolidays):
223
231
  2022: (JUL, 9),
224
232
  2023: (JUN, 28),
225
233
  2024: (JUN, 17),
234
+ 2025: (JUN, 6),
226
235
  }
227
236
 
228
237
  EID_AL_FITR_DATES = {
@@ -249,6 +258,7 @@ class PhilippinesIslamicHolidays(_CustomIslamicHolidays):
249
258
  2022: (MAY, 3),
250
259
  2023: (APR, 21),
251
260
  2024: (APR, 10),
261
+ 2025: (MAR, 31),
252
262
  }
253
263
 
254
264
 
@@ -27,7 +27,7 @@ class Poland(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolida
27
27
 
28
28
  country = "PL"
29
29
  default_language = "pl"
30
- supported_languages = ("en_US", "pl", "uk")
30
+ supported_languages = ("de", "en_US", "pl", "uk")
31
31
  start_year = 1925
32
32
 
33
33
  def __init__(self, *args, **kwargs):
@@ -10,7 +10,7 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from holidays.constants import PUBLIC, UNOFFICIAL
13
+ from holidays.constants import GOVERNMENT, PUBLIC, UNOFFICIAL
14
14
  from holidays.countries.united_states import US
15
15
 
16
16
 
@@ -20,13 +20,17 @@ class HolidaysPR(US):
20
20
  # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1
21
21
 
22
22
  country = "PR"
23
- supported_categories = (PUBLIC, UNOFFICIAL)
23
+ supported_categories = (GOVERNMENT, PUBLIC, UNOFFICIAL)
24
24
  subdivisions = () # Override US subdivisions.
25
25
 
26
26
  def _populate_public_holidays(self) -> None:
27
27
  self.subdiv = "PR"
28
28
  super()._populate_public_holidays()
29
29
 
30
+ def _populate_government_holidays(self) -> None:
31
+ self.subdiv = "PR"
32
+ super()._populate_government_holidays()
33
+
30
34
  def _populate_unofficial_holidays(self) -> None:
31
35
  self.subdiv = "PR"
32
36
  super()._populate_unofficial_holidays()
@@ -51,8 +51,12 @@ class SaudiArabia(ObservedHolidayBase, IslamicHolidays, StaticHolidays):
51
51
  observed_estimated_label = tr("(تقدير ملاحظة) %s")
52
52
  supported_languages = ("ar", "en_US")
53
53
 
54
- def __init__(self, *args, **kwargs):
55
- IslamicHolidays.__init__(self)
54
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
55
+ """
56
+ :param islamic_show_estimated:
57
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
58
+ """
59
+ IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
56
60
  StaticHolidays.__init__(self, SaudiArabiaStaticHolidays)
57
61
  kwargs.setdefault("observed_rule", FRI_TO_PREV_THU + SAT_TO_NEXT_SUN)
58
62
  super().__init__(*args, **kwargs)
@@ -47,8 +47,11 @@ class Singapore(
47
47
  observed_label = tr("%s (observed)")
48
48
  supported_languages = ("en_SG", "en_US", "th")
49
49
 
50
- def __init__(self, *args, **kwargs):
50
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
51
51
  """
52
+ :param islamic_show_estimated:
53
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
54
+
52
55
  A subclass of :py:class:`HolidayBase` representing public holidays in
53
56
  Singapore.
54
57
 
@@ -86,7 +89,9 @@ class Singapore(
86
89
  ChristianHolidays.__init__(self)
87
90
  HinduCalendarHolidays.__init__(self, cls=SingaporeHinduHolidays)
88
91
  InternationalHolidays.__init__(self)
89
- IslamicHolidays.__init__(self, cls=SingaporeIslamicHolidays)
92
+ IslamicHolidays.__init__(
93
+ self, cls=SingaporeIslamicHolidays, show_estimated=islamic_show_estimated
94
+ )
90
95
  StaticHolidays.__init__(self, cls=SingaporeStaticHolidays)
91
96
  # Implement Section 4(2) of the Holidays Act:
92
97
  # "if any day specified in the Schedule falls on a Sunday,
@@ -78,10 +78,16 @@ class Spain(
78
78
  )
79
79
  supported_languages = ("en_US", "es", "uk")
80
80
 
81
- def __init__(self, *args, **kwargs):
81
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
82
+ """
83
+ :param islamic_show_estimated:
84
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
85
+ """
82
86
  ChristianHolidays.__init__(self)
83
87
  InternationalHolidays.__init__(self)
84
- IslamicHolidays.__init__(self, cls=SpainIslamicHolidays)
88
+ IslamicHolidays.__init__(
89
+ self, cls=SpainIslamicHolidays, show_estimated=islamic_show_estimated
90
+ )
85
91
  StaticHolidays.__init__(self, cls=SpainStaticHolidays)
86
92
  kwargs.setdefault("observed_rule", SUN_TO_NEXT_MON)
87
93
  super().__init__(*args, **kwargs)
@@ -87,11 +87,17 @@ class SriLanka(
87
87
  start_year = 1972
88
88
  end_year = 2025
89
89
 
90
- def __init__(self, *args, **kwargs):
90
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
91
+ """
92
+ :param islamic_show_estimated:
93
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
94
+ """
91
95
  ChristianHolidays.__init__(self)
92
96
  HinduCalendarHolidays.__init__(self, SriLankaHinduHolidays)
93
97
  InternationalHolidays.__init__(self)
94
- IslamicHolidays.__init__(self, SriLankaIslamicHolidays)
98
+ IslamicHolidays.__init__(
99
+ self, cls=SriLankaIslamicHolidays, show_estimated=islamic_show_estimated
100
+ )
95
101
  SinhalaCalendarHolidays.__init__(self)
96
102
  StaticHolidays.__init__(self, cls=SriLankaStaticHolidays)
97
103
  super().__init__(*args, **kwargs)
@@ -31,6 +31,7 @@ from holidays.calendars.gregorian import (
31
31
  SAT,
32
32
  SUN,
33
33
  )
34
+ from holidays.constants import GOVERNMENT, OPTIONAL, PUBLIC, SCHOOL, WORKDAY
34
35
  from holidays.groups import ChineseCalendarHolidays, InternationalHolidays, StaticHolidays
35
36
  from holidays.observed_holiday_base import (
36
37
  ObservedHolidayBase,
@@ -45,32 +46,36 @@ CHILDRENS_DAY_RULE = ObservedRule({MON: +1, TUE: -1, WED: -1, THU: +1, FRI: -1,
45
46
 
46
47
  class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays, StaticHolidays):
47
48
  """
48
- References:
49
+ Commemorative Day and Day Implementation Method Amendments:
50
+ - `Ministry of Interior (87) Order No. 8706459 <https://zh.wikisource.org/wiki/紀念日及節日實施辦法_(民國87年)>`_
51
+ - `Ministry of Interior (88) Order No. 8897074 <https://zh.wikisource.org/wiki/紀念日及節日實施辦法_(民國88年)>`_
52
+ - `Ministry of Interior (89) Order No. 8972185 <https://zh.wikisource.org/wiki/紀念日及節日實施辦法_(民國89年2月)>`_
53
+ - `Ministry of Interior (89) Order No. 8962562 <https://zh.wikisource.org/wiki/紀念日及節日實施辦法_(民國89年12月)>`_
54
+ - `Ministry of Interior Order No. 0950045320 <https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20060309&lser=001>`_
55
+ - `Ministry of Interior Order No. 0960110433 <https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20070711&lser=001>`_
56
+ - `Ministry of Interior Order No. 0960131407 <https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20070711&lser=001>`_
57
+ - `Ministry of Interior Order No. 0960155673 <https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20071003&lser=001>`_
58
+ - `Ministry of Interior Order No. 0990212117 <https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20101102&lser=001>`_
59
+ - `Ministry of Interior Order No. 1010307327 and 1030128812 <https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20120925&lser=001>`_
60
+ - `Ministry of Interior Order No. 1030182404 <https://law.moj.gov.tw/LawClass/LawAll.aspx?pcode=D0020033>`_
61
+
62
+ Other References:
63
+ - https://zh.wikipedia.org/wiki/中華民國節日與歲時列表
49
64
  - https://en.wikipedia.org/wiki/Public_holidays_in_Taiwan
50
- - `2025 <https://www.dgpa.gov.tw/en/information?uid=353&pid=11979>`_
51
- - `2024 <https://www.dgpa.gov.tw/en/information?uid=353&pid=11402>`_
52
- - `2023 <https://www.dgpa.gov.tw/en/information?uid=353&pid=11016>`_
53
- - `2022 <https://www.dgpa.gov.tw/en/information?uid=353&pid=10659>`_
54
- - `2021 <https://www.dgpa.gov.tw/en/information?uid=353&pid=10181>`_
55
- - `2020 <https://www.dgpa.gov.tw/en/information?uid=353&pid=9724>`_
56
- - `2019 <https://www.dgpa.gov.tw/en/information?uid=353&pid=8178>`_
57
- - `2018 <https://www.dgpa.gov.tw/en/information?uid=353&pid=7730>`_
58
- - `2017 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6178>`_
59
- - `2016 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6180>`_
60
- - `2015 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6182>`_
61
- - `2014 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6183>`_
62
- - `2013 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6186>`_
63
- - `2012 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6187>`_
64
- - `2011 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6188>`_
65
- - `2010 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6189>`_
65
+
66
+ Checked With:
67
+ - `DGPA Work Calendar (1998-2025; Chinese) <https://www.dgpa.gov.tw/informationlist?uid=30>`_
68
+ - `DGPA Work Calendar (2001-2025; English) <https://www.dgpa.gov.tw/en/informationlist?uid=353>`_
66
69
  """
67
70
 
68
71
  country = "TW"
69
72
  # %s (observed).
70
73
  observed_label = tr("%s(慶祝)")
71
74
  default_language = "zh_TW"
75
+ supported_categories = (GOVERNMENT, OPTIONAL, PUBLIC, SCHOOL, WORKDAY)
72
76
  supported_languages = ("en_US", "th", "zh_CN", "zh_TW")
73
- start_year = 1912
77
+ # Ministry of Interior (87) Order No. 8706459.
78
+ start_year = 1998
74
79
 
75
80
  def __init__(self, *args, **kwargs):
76
81
  ChineseCalendarHolidays.__init__(self)
@@ -82,9 +87,18 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
82
87
  def _populate_observed(
83
88
  self, dts: set[date], rule: ObservedRule = None, since: int = 2015
84
89
  ) -> None:
90
+ """
91
+ Taiwan's General Observance Rule first started in 2015 as per
92
+ decreed in 內政部台內民字第1030182404號令.
93
+
94
+ Children's Day Special Observance Rule first started in 2012 as per
95
+ decreed in 內政部台內民字第1010307327號令 - as this doesn't affect 2011 ones,
96
+ as such the logic is simplified.
97
+ """
85
98
  if self._year < since:
86
99
  return None
87
100
 
101
+ # Children's Day.
88
102
  childrens_day = self.tr("兒童節")
89
103
  for dt in sorted(dts):
90
104
  names = self.get_list(dt)
@@ -92,7 +106,7 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
92
106
  self._add_observed(
93
107
  dt,
94
108
  name,
95
- # Children's Day falls on the same day as Tomb Sweeping Day.
109
+ # Children's Day falls on the same day as Tomb-Sweeping Day.
96
110
  CHILDRENS_DAY_RULE if name == childrens_day and len(names) > 1 else rule,
97
111
  )
98
112
 
@@ -115,17 +129,15 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
115
129
  dts_observed_forward.add(self._add_chinese_new_years_day_two(name))
116
130
  dts_observed_forward.add(self._add_chinese_new_years_day_three(name))
117
131
 
118
- if self._year >= 1997:
119
- # Peace Memorial Day.
120
- dts_observed.add(self._add_holiday_feb_28(tr("和平紀念日")))
132
+ # Peace Memorial Day.
133
+ dts_observed.add(self._add_holiday_feb_28(tr("和平紀念日")))
121
134
 
122
- if 1990 <= self._year <= 1999 or self._year >= 2011:
135
+ if self._year >= 2011:
123
136
  # Children's Day.
124
137
  dts_observed.add(self._add_holiday_apr_4(tr("兒童節")))
125
138
 
126
- if self._year >= 1972:
127
- # Tomb Sweeping Day.
128
- dts_observed.add(self._add_qingming_festival(tr("清明節")))
139
+ # Tomb-Sweeping Day.
140
+ dts_observed.add(self._add_qingming_festival(tr("民族掃墓節")))
129
141
 
130
142
  # Dragon Boat Festival.
131
143
  dts_observed.add(self._add_dragon_boat_festival(tr("端午節")))
@@ -134,11 +146,112 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
134
146
  dts_observed.add(self._add_mid_autumn_festival(tr("中秋節")))
135
147
 
136
148
  # National Day.
137
- dts_observed.add(self._add_holiday_oct_10(tr("中華民國國慶日")))
149
+ dts_observed.add(self._add_holiday_oct_10(tr("國慶日")))
138
150
 
139
151
  if self.observed:
140
152
  self._populate_observed(dts_observed)
141
- self._populate_observed(dts_observed_forward, rule=SAT_SUN_TO_NEXT_WORKDAY, since=2010)
153
+ # While Chinese New Year special observances rule weren't officially decreed
154
+ # until 2015, this was de facto implemented by the DGPA since at least 2003.
155
+ self._populate_observed(dts_observed_forward, rule=SAT_SUN_TO_NEXT_WORKDAY, since=2003)
156
+
157
+ def _populate_school_holidays(self):
158
+ if self._year <= 2000:
159
+ # Founding Day of the Republic of China.
160
+ self._add_new_years_day_two(tr("中華民國開國紀念日"))
161
+
162
+ # Confucius' Birthday.
163
+ self._add_holiday_sep_28(tr("孔子誕辰紀念日"))
164
+
165
+ # Taiwan Retrocession Day.
166
+ self._add_holiday_oct_25(tr("臺灣光復節"))
167
+
168
+ # Late President Chiang Kai-shek's Birthday.
169
+ self._add_holiday_oct_31(tr("先總統 蔣公誕辰紀念日"))
170
+
171
+ # Dr. Sun Yat-sen's Birthday.
172
+ self._add_holiday_nov_12(tr("國父誕辰紀念日"))
173
+
174
+ # Constitution Day.
175
+ self._add_holiday_dec_25(tr("行憲紀念日"))
176
+
177
+ def _populate_government_holidays(self):
178
+ self._populate_school_holidays()
179
+
180
+ if self._year <= 2000:
181
+ # Revolutionary Martyrs Memorial Day.
182
+ self._add_holiday_mar_29(tr("革命先烈紀念日"))
183
+
184
+ def _populate_optional_holidays(self):
185
+ # Labor Day.
186
+ self._add_labor_day(tr("勞動節"))
187
+
188
+ # Armed Forces Day.
189
+ self._add_holiday_sep_3(tr("軍人節"))
190
+
191
+ def _populate_workday_holidays(self):
192
+ # Dr. Sun Yat-sen's Memorial Day.
193
+ self._add_holiday_mar_12(tr("國父逝世紀念日"))
194
+
195
+ # Arbor Day.
196
+ self._add_holiday_mar_12(tr("植樹節"))
197
+
198
+ # Youth Day.
199
+ self._add_holiday_mar_29(tr("青年節"))
200
+
201
+ # Teacher's Day.
202
+ self._add_holiday_sep_28(tr("教師節"))
203
+
204
+ # Chinese Cultural Renaissance Day.
205
+ self._add_holiday_nov_12(tr("中華文化復興節"))
206
+
207
+ # Women's Day.
208
+ self._add_womens_day(tr("婦女節"))
209
+
210
+ if self._year <= 2007:
211
+ # Late President Chiang Kai-shek's Memorial Day.
212
+ self._add_qingming_festival(tr("先總統蔣公逝世紀念日"))
213
+
214
+ if self._year <= 2010:
215
+ # Children's Day.
216
+ self._add_holiday_apr_4(tr("兒童節"))
217
+
218
+ if self._year >= 2000:
219
+ # The Buddha's Birthday.
220
+ self._add_chinese_birthday_of_buddha(tr("佛陀誕辰紀念日"))
221
+
222
+ if self._year >= 2001:
223
+ # Taoism Day.
224
+ self._add_chinese_new_years_day(tr("道教節"))
225
+
226
+ # Revolutionary Martyrs Memorial Day.
227
+ self._add_holiday_mar_29(tr("革命先烈紀念日"))
228
+
229
+ # Confucius' Birthday.
230
+ self._add_holiday_sep_28(tr("孔子誕辰紀念日"))
231
+
232
+ # Taiwan Retrocession Day.
233
+ self._add_holiday_oct_25(tr("臺灣光復節"))
234
+
235
+ # Dr. Sun Yat-sen's Birthday.
236
+ self._add_holiday_nov_12(tr("國父誕辰紀念日"))
237
+
238
+ # Constitution Day.
239
+ self._add_holiday_dec_25(tr("行憲紀念日"))
240
+
241
+ if self._year <= 2006:
242
+ # Late President Chiang Kai-shek's Birthday.
243
+ self._add_holiday_oct_31(tr("先總統 蔣公誕辰紀念日"))
244
+
245
+ if self._year >= 2006:
246
+ # Anti-Aggression Day.
247
+ self._add_holiday_mar_14(tr("反侵略日"))
248
+
249
+ if self._year >= 2008:
250
+ # Commemoration Day of the Lifting of Martial Law.
251
+ self._add_holiday_jul_15(tr("解嚴紀念日"))
252
+
253
+ # Taiwan United Nations Day.
254
+ self._add_united_nations_day(tr("臺灣聯合國日"))
142
255
 
143
256
 
144
257
  class TW(Taiwan):
@@ -150,14 +263,66 @@ class TWN(Taiwan):
150
263
 
151
264
 
152
265
  class TaiwanStaticHolidays:
266
+ """
267
+ DGPA, Executive Yuan Work Calendars:
268
+ - `1998 <https://www.dgpa.gov.tw/information?uid=30&pid=4979>`_
269
+ - `1999 <https://www.dgpa.gov.tw/information?uid=30&pid=4978>`_
270
+ - `2000 <https://www.dgpa.gov.tw/information?uid=30&pid=4977>`_
271
+ - `2001 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6199>`_
272
+ - `2002 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6198>`_
273
+ - `2003 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6197>`_
274
+ - `2004 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6196>`_
275
+ - `2005 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6195>`_
276
+ - `2006 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6192>`_
277
+ - `2007 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6194>`_
278
+ - `2008 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6191>`_
279
+ - `2009 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6190>`_
280
+ - `2010 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6189>`_
281
+ - `2011 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6188>`_
282
+ - `2012 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6187>`_
283
+ - `2013 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6186>`_
284
+ - `2014 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6183>`_
285
+ - `2015 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6182>`_
286
+ - `2016 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6180>`_
287
+ - `2017 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6178>`_
288
+ - `2018 <https://www.dgpa.gov.tw/en/information?uid=353&pid=7730>`_
289
+ - `2019 <https://www.dgpa.gov.tw/en/information?uid=353&pid=8178>`_
290
+ - `2020 <https://www.dgpa.gov.tw/en/information?uid=353&pid=9724>`_
291
+ - `2021 <https://www.dgpa.gov.tw/en/information?uid=353&pid=10181>`_
292
+ - `2022 <https://www.dgpa.gov.tw/en/information?uid=353&pid=10659>`_
293
+ - `2023 <https://www.dgpa.gov.tw/en/information?uid=353&pid=11016>`_
294
+ - `2024 <https://www.dgpa.gov.tw/en/information?uid=353&pid=11402>`_
295
+ - `2025 <https://www.dgpa.gov.tw/en/information?uid=353&pid=11979>`_
296
+ """
297
+
153
298
  # Date format (see strftime() Format Codes).
154
299
  substituted_date_format = tr("%Y-%m-%d")
300
+
155
301
  # Day off (substituted from %s).
156
302
  substituted_label = tr("休息日(%s日起取代)")
157
303
 
304
+ # Women's Day.
305
+ womens_day = tr("婦女節")
306
+
307
+ # Children's Day.
158
308
  childrens_day = tr("兒童節")
159
309
 
160
310
  special_public_holidays = {
311
+ 2000: (APR, 3, APR, 8),
312
+ 2001: (JAN, 22, JAN, 20),
313
+ 2005: (FEB, 7, FEB, 5),
314
+ 2006: (OCT, 9, OCT, 14),
315
+ 2007: (
316
+ (FEB, 23, MAR, 3),
317
+ (APR, 6, APR, 14),
318
+ (JUN, 18, JUN, 23),
319
+ (SEP, 24, SEP, 29),
320
+ ),
321
+ 2009: (
322
+ (JAN, 2, JAN, 10),
323
+ (JAN, 30, JAN, 17),
324
+ (MAY, 29, JUN, 6),
325
+ ),
161
326
  2010: (FEB, 19, FEB, 6),
162
327
  2012: (
163
328
  (JAN, 27, FEB, 4),
@@ -209,7 +374,39 @@ class TaiwanStaticHolidays:
209
374
  2024: (FEB, 8, FEB, 17),
210
375
  2025: (JAN, 27, FEB, 8),
211
376
  }
212
-
377
+ # Prior to 2001, Women's Day and Children's Day holidays were given on
378
+ # the day before the Tomb-Sweeping Day.
379
+ special_optional_holidays_observed = {
380
+ 1998: (
381
+ (APR, 4, childrens_day),
382
+ (APR, 4, womens_day),
383
+ ),
384
+ 1999: (
385
+ (APR, 4, childrens_day),
386
+ (APR, 4, womens_day),
387
+ ),
388
+ 2000: (
389
+ (APR, 3, childrens_day),
390
+ (APR, 3, womens_day),
391
+ # Armed Forces Day.
392
+ (SEP, 4, tr("軍人節")),
393
+ ),
394
+ }
395
+ # The Buddha's Birthday was observed on 2nd Sunday of May in 2000.
213
396
  special_public_holidays_observed = {
397
+ 1998: (
398
+ # Chinese New Year.
399
+ (JAN, 31, tr("春節")),
400
+ # Tomb-Sweeping Day.
401
+ (APR, 6, tr("民族掃墓節")),
402
+ ),
403
+ 1999: (
404
+ # Founding Day of the Republic of China.
405
+ (JAN, 2, tr("中華民國開國紀念日")),
406
+ # Dragon Boat Festival.
407
+ (JUN, 19, tr("端午節")),
408
+ ),
409
+ # The Buddha's Birthday.
410
+ 2000: (MAY, 14, tr("佛陀誕辰紀念日")),
214
411
  2013: (APR, 5, childrens_day),
215
412
  }
@@ -67,10 +67,16 @@ class Tanzania(
67
67
  # Written Law (Miscellaneous Amendments) (No. 2) Act, 1994.
68
68
  start_year = 1994
69
69
 
70
- def __init__(self, *args, **kwargs):
70
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
71
+ """
72
+ :param islamic_show_estimated:
73
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
74
+ """
71
75
  ChristianHolidays.__init__(self)
72
76
  InternationalHolidays.__init__(self)
73
- IslamicHolidays.__init__(self, cls=TanzaniaIslamicHolidays)
77
+ IslamicHolidays.__init__(
78
+ self, cls=TanzaniaIslamicHolidays, show_estimated=islamic_show_estimated
79
+ )
74
80
  StaticHolidays.__init__(self, TanzaniaStaticHolidays)
75
81
  super().__init__(*args, **kwargs)
76
82