holidays 0.81__py3-none-any.whl → 0.83__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 (141) hide show
  1. holidays/calendars/__init__.py +1 -0
  2. holidays/calendars/burmese.py +319 -0
  3. holidays/calendars/hebrew.py +2 -2
  4. holidays/calendars/islamic.py +26 -6
  5. holidays/calendars/thai.py +49 -2
  6. holidays/countries/__init__.py +11 -0
  7. holidays/countries/afghanistan.py +7 -5
  8. holidays/countries/algeria.py +89 -24
  9. holidays/countries/antarctica.py +58 -0
  10. holidays/countries/azerbaijan.py +1 -1
  11. holidays/countries/bouvet_island.py +31 -0
  12. holidays/countries/brazil.py +1 -1
  13. holidays/countries/british_indian_ocean_territory.py +31 -0
  14. holidays/countries/bulgaria.py +6 -1
  15. holidays/countries/canada.py +27 -13
  16. holidays/countries/chile.py +9 -8
  17. holidays/countries/cuba.py +3 -4
  18. holidays/countries/denmark.py +18 -6
  19. holidays/countries/djibouti.py +1 -1
  20. holidays/countries/fiji.py +2 -3
  21. holidays/countries/finland.py +3 -6
  22. holidays/countries/guyana.py +24 -32
  23. holidays/countries/heard_island_and_mcdonald_islands.py +31 -0
  24. holidays/countries/hungary.py +4 -5
  25. holidays/countries/india.py +27 -78
  26. holidays/countries/iran.py +133 -269
  27. holidays/countries/ireland.py +1 -1
  28. holidays/countries/israel.py +1 -1
  29. holidays/countries/japan.py +22 -18
  30. holidays/countries/jordan.py +6 -3
  31. holidays/countries/kuwait.py +6 -3
  32. holidays/countries/macau.py +5 -8
  33. holidays/countries/malaysia.py +14 -3
  34. holidays/countries/mauritius.py +10 -9
  35. holidays/countries/montserrat.py +1 -1
  36. holidays/countries/myanmar.py +194 -0
  37. holidays/countries/nepal.py +11 -30
  38. holidays/countries/netherlands.py +28 -24
  39. holidays/countries/new_zealand.py +75 -31
  40. holidays/countries/nigeria.py +53 -75
  41. holidays/countries/north_korea.py +161 -0
  42. holidays/countries/norway.py +24 -9
  43. holidays/countries/oman.py +6 -2
  44. holidays/countries/paraguay.py +70 -23
  45. holidays/countries/portugal.py +5 -6
  46. holidays/countries/qatar.py +5 -2
  47. holidays/countries/rwanda.py +8 -3
  48. holidays/countries/saudi_arabia.py +6 -5
  49. holidays/countries/serbia.py +5 -0
  50. holidays/countries/slovakia.py +23 -4
  51. holidays/countries/south_africa.py +96 -53
  52. holidays/countries/south_korea.py +6 -1
  53. holidays/countries/spain.py +4 -4
  54. holidays/countries/sri_lanka.py +21 -58
  55. holidays/countries/sudan.py +6 -3
  56. holidays/countries/suriname.py +1 -2
  57. holidays/countries/sweden.py +1 -1
  58. holidays/countries/switzerland.py +255 -6
  59. holidays/countries/taiwan.py +23 -3
  60. holidays/countries/tanzania.py +25 -30
  61. holidays/countries/thailand.py +29 -7
  62. holidays/countries/tonga.py +6 -1
  63. holidays/countries/trinidad_and_tobago.py +7 -2
  64. holidays/countries/ukraine.py +1 -1
  65. holidays/countries/united_arab_emirates.py +9 -2
  66. holidays/countries/united_kingdom.py +1 -1
  67. holidays/countries/united_states.py +18 -2
  68. holidays/countries/uruguay.py +6 -1
  69. holidays/countries/vietnam.py +6 -1
  70. holidays/countries/western_sahara.py +92 -0
  71. holidays/countries/yemen.py +6 -3
  72. holidays/groups/__init__.py +1 -0
  73. holidays/groups/balinese_saka.py +1 -1
  74. holidays/groups/buddhist.py +3 -3
  75. holidays/groups/burmese.py +273 -0
  76. holidays/groups/chinese.py +30 -2
  77. holidays/groups/christian.py +10 -0
  78. holidays/groups/custom.py +8 -2
  79. holidays/groups/eastern.py +26 -0
  80. holidays/groups/hebrew.py +16 -14
  81. holidays/groups/hindu.py +23 -15
  82. holidays/groups/international.py +1 -1
  83. holidays/groups/islamic.py +52 -50
  84. holidays/groups/mongolian.py +6 -3
  85. holidays/groups/sinhala.py +9 -11
  86. holidays/groups/tibetan.py +8 -6
  87. holidays/holiday_base.py +26 -26
  88. holidays/ical.py +6 -4
  89. holidays/locale/ar/LC_MESSAGES/DZ.mo +0 -0
  90. holidays/locale/ar/LC_MESSAGES/EH.mo +0 -0
  91. holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
  92. holidays/locale/de/LC_MESSAGES/CH.mo +0 -0
  93. holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
  94. holidays/locale/en_US/LC_MESSAGES/BR.mo +0 -0
  95. holidays/locale/en_US/LC_MESSAGES/CH.mo +0 -0
  96. holidays/locale/en_US/LC_MESSAGES/DZ.mo +0 -0
  97. holidays/locale/en_US/LC_MESSAGES/EH.mo +0 -0
  98. holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
  99. holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
  100. holidays/locale/en_US/LC_MESSAGES/JP.mo +0 -0
  101. holidays/locale/en_US/LC_MESSAGES/KP.mo +0 -0
  102. holidays/locale/en_US/LC_MESSAGES/MM.mo +0 -0
  103. holidays/locale/en_US/LC_MESSAGES/NL.mo +0 -0
  104. holidays/locale/en_US/LC_MESSAGES/PY.mo +0 -0
  105. holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
  106. holidays/locale/es/LC_MESSAGES/EH.mo +0 -0
  107. holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
  108. holidays/locale/es/LC_MESSAGES/PY.mo +0 -0
  109. holidays/locale/fr/LC_MESSAGES/CH.mo +0 -0
  110. holidays/locale/fr/LC_MESSAGES/DZ.mo +0 -0
  111. holidays/locale/fr/LC_MESSAGES/EH.mo +0 -0
  112. holidays/locale/fy/LC_MESSAGES/NL.mo +0 -0
  113. holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
  114. holidays/locale/it/LC_MESSAGES/CH.mo +0 -0
  115. holidays/locale/ja/LC_MESSAGES/JP.mo +0 -0
  116. holidays/locale/ko_KP/LC_MESSAGES/KP.mo +0 -0
  117. holidays/locale/my/LC_MESSAGES/MM.mo +0 -0
  118. holidays/locale/nl/LC_MESSAGES/NL.mo +0 -0
  119. holidays/locale/pt_BR/LC_MESSAGES/BR.mo +0 -0
  120. holidays/locale/th/LC_MESSAGES/CH.mo +0 -0
  121. holidays/locale/th/LC_MESSAGES/DK.mo +0 -0
  122. holidays/locale/th/LC_MESSAGES/JP.mo +0 -0
  123. holidays/locale/th/LC_MESSAGES/MM.mo +0 -0
  124. holidays/locale/th/LC_MESSAGES/NL.mo +0 -0
  125. holidays/locale/th/LC_MESSAGES/US.mo +0 -0
  126. holidays/locale/uk/LC_MESSAGES/BR.mo +0 -0
  127. holidays/locale/uk/LC_MESSAGES/CH.mo +0 -0
  128. holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
  129. holidays/locale/uk/LC_MESSAGES/NL.mo +0 -0
  130. holidays/locale/uk/LC_MESSAGES/PY.mo +0 -0
  131. holidays/no_holiday_base.py +21 -0
  132. holidays/observed_holiday_base.py +16 -4
  133. holidays/registry.py +8 -0
  134. holidays/utils.py +5 -5
  135. holidays/version.py +1 -1
  136. {holidays-0.81.dist-info → holidays-0.83.dist-info}/METADATA +63 -19
  137. {holidays-0.81.dist-info → holidays-0.83.dist-info}/RECORD +141 -118
  138. {holidays-0.81.dist-info → holidays-0.83.dist-info}/licenses/CONTRIBUTORS +2 -0
  139. {holidays-0.81.dist-info → holidays-0.83.dist-info}/WHEEL +0 -0
  140. {holidays-0.81.dist-info → holidays-0.83.dist-info}/licenses/LICENSE +0 -0
  141. {holidays-0.81.dist-info → holidays-0.83.dist-info}/top_level.txt +0 -0
@@ -10,9 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
13
+ from __future__ import annotations
14
+
14
15
  from gettext import gettext as tr
15
- from typing import Optional
16
+ from typing import Optional, TYPE_CHECKING
16
17
 
17
18
  from holidays.calendars.gregorian import (
18
19
  JAN,
@@ -31,6 +32,7 @@ from holidays.calendars.gregorian import (
31
32
  FRI,
32
33
  SAT,
33
34
  SUN,
35
+ _get_nth_weekday_of_month,
34
36
  )
35
37
  from holidays.constants import GOVERNMENT, OPTIONAL, PUBLIC, SCHOOL, WORKDAY
36
38
  from holidays.groups import ChineseCalendarHolidays, InternationalHolidays, StaticHolidays
@@ -42,6 +44,9 @@ from holidays.observed_holiday_base import (
42
44
  SAT_SUN_TO_NEXT_WORKDAY,
43
45
  )
44
46
 
47
+ if TYPE_CHECKING:
48
+ from datetime import date
49
+
45
50
  CHILDRENS_DAY_RULE = ObservedRule({MON: +1, TUE: -1, WED: -1, THU: +1, FRI: -1, SAT: -1, SUN: -2})
46
51
 
47
52
 
@@ -91,6 +96,21 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
91
96
  kwargs.setdefault("observed_rule", SAT_TO_PREV_WORKDAY + SUN_TO_NEXT_WORKDAY)
92
97
  super().__init__(*args, **kwargs)
93
98
 
99
+ def _get_weekend(self, dt: date) -> set[int]:
100
+ # 1998–2000: Sundays as well as the 2nd & 4th Saturday of each month.
101
+ if dt.year <= 2000:
102
+ weekend = {SUN}
103
+ if dt.weekday() == SAT:
104
+ if dt in {
105
+ _get_nth_weekday_of_month(2, SAT, dt.month, dt.year), # 2nd Saturday.
106
+ _get_nth_weekday_of_month(4, SAT, dt.month, dt.year), # 4th Saturday.
107
+ }:
108
+ weekend.add(SAT)
109
+ else:
110
+ weekend = {SAT, SUN}
111
+
112
+ return weekend
113
+
94
114
  def _populate_observed(
95
115
  self, dts: set[date], rule: Optional[ObservedRule] = None, since: int = 2015
96
116
  ) -> None:
@@ -114,7 +134,7 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
114
134
  dt,
115
135
  name,
116
136
  # Children's Day falls on the same day as Tomb-Sweeping Day.
117
- CHILDRENS_DAY_RULE if name == childrens_day and len(names) > 1 else rule,
137
+ rule=CHILDRENS_DAY_RULE if name == childrens_day and len(names) > 1 else rule,
118
138
  )
119
139
 
120
140
  def _populate_public_holidays(self):
@@ -10,8 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
13
+ from __future__ import annotations
14
+
14
15
  from gettext import gettext as tr
16
+ from typing import TYPE_CHECKING
15
17
 
16
18
  from holidays.calendars import _CustomIslamicHolidays
17
19
  from holidays.calendars.gregorian import (
@@ -43,6 +45,9 @@ from holidays.observed_holiday_base import (
43
45
  SAT_SUN_TO_NEXT_MON_TUE,
44
46
  )
45
47
 
48
+ if TYPE_CHECKING:
49
+ from datetime import date
50
+
46
51
 
47
52
  class Tanzania(
48
53
  ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays
@@ -116,11 +121,17 @@ class Tanzania(
116
121
  islamic_show_estimated:
117
122
  Whether to add "estimated" label to Islamic holidays name
118
123
  if holiday date is estimated.
124
+
125
+ In Tanzania, the dates of the Islamic calendar usually fall a day later than
126
+ the corresponding dates in the Umm al-Qura calendar.
119
127
  """
120
128
  ChristianHolidays.__init__(self)
121
129
  InternationalHolidays.__init__(self)
122
130
  IslamicHolidays.__init__(
123
- self, cls=TanzaniaIslamicHolidays, show_estimated=islamic_show_estimated
131
+ self,
132
+ cls=TanzaniaIslamicHolidays,
133
+ show_estimated=islamic_show_estimated,
134
+ calendar_delta_days=+1,
124
135
  )
125
136
  StaticHolidays.__init__(self, TanzaniaStaticHolidays)
126
137
  super().__init__(*args, **kwargs)
@@ -150,7 +161,7 @@ class Tanzania(
150
161
  else:
151
162
  rule = SAT_SUN_TO_NEXT_MON
152
163
  for name in self.get_list(dt):
153
- self._add_observed(dt, name, rule)
164
+ self._add_observed(dt, name, rule=rule)
154
165
 
155
166
  def _populate_bank_holidays(self):
156
167
  # Sikukuu ya Pasaka.
@@ -319,16 +330,11 @@ class TanzaniaIslamicHolidays(_CustomIslamicHolidays):
319
330
  2004: (FEB, 2),
320
331
  2006: (JAN, 9),
321
332
  2007: (JAN, 1),
322
- 2014: (OCT, 5),
323
- 2016: (SEP, 16),
324
- 2017: (SEP, 2),
325
- 2018: (AUG, 22),
333
+ 2013: (OCT, 15),
334
+ 2015: (SEP, 23),
335
+ 2016: (SEP, 13),
326
336
  2019: (AUG, 13),
327
- 2021: (JUL, 21),
328
- 2022: (JUL, 10),
329
- 2023: (JUN, 29),
330
- 2024: (JUN, 17),
331
- 2025: (JUN, 7),
337
+ 2020: (JUL, 31),
332
338
  }
333
339
 
334
340
  EID_AL_FITR_DATES_CONFIRMED_YEARS = (2013, 2025)
@@ -355,15 +361,10 @@ class TanzaniaIslamicHolidays(_CustomIslamicHolidays):
355
361
  2004: (OCT, 18),
356
362
  2006: (OCT, 29),
357
363
  2007: (OCT, 13),
358
- 2014: (JUL, 29),
359
- 2015: (JUL, 18),
360
- 2016: (JUL, 7),
361
- 2017: (JUN, 26),
362
- 2019: (JUN, 5),
363
- 2021: (MAY, 14),
364
- 2022: (MAY, 3),
365
- 2023: (APR, 22),
366
- 2025: (MAR, 31),
364
+ 2013: (AUG, 8),
365
+ 2018: (JUN, 15),
366
+ 2020: (MAY, 24),
367
+ 2024: (APR, 10),
367
368
  }
368
369
 
369
370
  MAWLID_DATES_CONFIRMED_YEARS = (2013, 2025)
@@ -390,16 +391,10 @@ class TanzaniaIslamicHolidays(_CustomIslamicHolidays):
390
391
  2004: (MAY, 2),
391
392
  2006: (APR, 10),
392
393
  2007: (MAR, 31),
393
- 2014: (JAN, 14),
394
+ 2013: (JAN, 24),
394
395
  2015: ((JAN, 3), (DEC, 24)),
395
- 2016: (DEC, 12),
396
- 2017: (DEC, 1),
397
- 2018: (NOV, 21),
398
- 2019: (NOV, 10),
399
- 2021: (OCT, 19),
400
- 2022: (OCT, 9),
401
- 2023: (SEP, 28),
402
- 2024: (SEP, 16),
396
+ 2020: (OCT, 29),
397
+ 2025: (SEP, 4),
403
398
  }
404
399
 
405
400
 
@@ -26,6 +26,8 @@ from holidays.calendars.gregorian import (
26
26
  OCT,
27
27
  NOV,
28
28
  DEC,
29
+ SAT,
30
+ SUN,
29
31
  _timedelta,
30
32
  )
31
33
  from holidays.constants import ARMED_FORCES, BANK, GOVERNMENT, PUBLIC, SCHOOL, WORKDAY
@@ -199,6 +201,25 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
199
201
  def _is_observed(self, dt: date) -> bool:
200
202
  return 1961 <= self._year <= 1973 or 1995 <= self._year <= 1997 or self._year >= 2001
201
203
 
204
+ def _get_weekend(self, dt: date) -> set[int]:
205
+ if dt >= date(1959, MAR, 1):
206
+ # SAT & SUN (Full Day).
207
+ weekend = {SAT, SUN}
208
+ elif date(1956, OCT, 1) <= dt <= date(1957, OCT, 6):
209
+ # Buddhist Sabbath Days and Sun (Full Day).
210
+ weekend = {SUN}
211
+ buddhist_sabbath_dates = self._thai_calendar.buddhist_sabbath_dates(dt.year)
212
+ if dt in buddhist_sabbath_dates:
213
+ weekend.add(dt.weekday())
214
+ elif dt >= date(1939, FEB, 28):
215
+ # SAT from 12:00 onwards and SUN (Full Day).
216
+ weekend = {SUN}
217
+ else:
218
+ # Prior to this, there was no concept of weekend.
219
+ weekend = set()
220
+
221
+ return weekend
222
+
202
223
  def _populate_public_holidays(self):
203
224
  # Fixed Date Holidays
204
225
 
@@ -660,14 +681,15 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
660
681
  # **For pre-1941 data, Buddhist Era year starts on APR 1st.
661
682
 
662
683
  if 1915 <= self._year <= 1925 or self._year >= 1938:
663
- name = (
664
- # Makha Bucha.
665
- tr("วันมาฆบูชา")
666
- if self._year >= 1938
667
- # Makha Bucha, the Fourfold Assembly Day.
668
- else tr("มาฆบูชา จาตุรงฅ์สันนิบาต")
684
+ self._add_observed(
685
+ self._add_makha_bucha(
686
+ # Makha Bucha.
687
+ tr("วันมาฆบูชา")
688
+ if self._year >= 1938
689
+ # Makha Bucha, the Fourfold Assembly Day.
690
+ else tr("มาฆบูชา จาตุรงฅ์สันนิบาต")
691
+ )
669
692
  )
670
- self._add_observed(self._add_makha_bucha(name))
671
693
 
672
694
  # วันวิสาขบูชา
673
695
  # Status: In-Use.
@@ -10,8 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
13
+ from __future__ import annotations
14
+
14
15
  from gettext import gettext as tr
16
+ from typing import TYPE_CHECKING
15
17
 
16
18
  from holidays.calendars.gregorian import SEP, NOV, DEC
17
19
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
@@ -22,6 +24,9 @@ from holidays.observed_holiday_base import (
22
24
  SUN_TO_NEXT_MON,
23
25
  )
24
26
 
27
+ if TYPE_CHECKING:
28
+ from datetime import date
29
+
25
30
 
26
31
  class Tonga(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
27
32
  """Tonga holidays.
@@ -10,8 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
13
+ from __future__ import annotations
14
+
14
15
  from gettext import gettext as tr
16
+ from typing import TYPE_CHECKING
15
17
 
16
18
  from holidays.calendars import _CustomHinduHolidays, _CustomIslamicHolidays
17
19
  from holidays.calendars.gregorian import MAR, APR, JUN, JUL, OCT, NOV
@@ -29,6 +31,9 @@ from holidays.observed_holiday_base import (
29
31
  WORKDAY_TO_NEXT_WORKDAY,
30
32
  )
31
33
 
34
+ if TYPE_CHECKING:
35
+ from datetime import date
36
+
32
37
 
33
38
  class TrinidadAndTobago(
34
39
  ObservedHolidayBase,
@@ -82,7 +87,7 @@ class TrinidadAndTobago(
82
87
  )
83
88
  super().__init__(*args, **kwargs)
84
89
 
85
- def _populate_observed(self, dts: set[date], multiple: bool = False) -> None:
90
+ def _populate_observed(self, dts: set[date], *, multiple: bool = False) -> None:
86
91
  for dt in sorted(dts):
87
92
  self._add_observed(
88
93
  dt,
@@ -54,7 +54,7 @@ class Ukraine(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
54
54
  # https://web.archive.org/web/20240315074159/http://zakon.rada.gov.ua/laws/show/576-14
55
55
  return date(1995, JAN, 27) <= dt <= date(1998, JAN, 9) or dt >= date(1999, APR, 23)
56
56
 
57
- def _populate_common(self, is_martial_law: bool = False):
57
+ def _populate_common(self, *, is_martial_law: bool = False):
58
58
  # There is no public holidays in Ukraine during the period of martial law
59
59
  # https://web.archive.org/web/20250418204733/https://zakon.rada.gov.ua/laws/show/2136-20
60
60
  # law is in force from March 15, 2022
@@ -10,7 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from __future__ import annotations
14
+
13
15
  from gettext import gettext as tr
16
+ from typing import TYPE_CHECKING
14
17
 
15
18
  from holidays.calendars import _CustomIslamicHolidays
16
19
  from holidays.calendars.gregorian import (
@@ -32,6 +35,9 @@ from holidays.constants import GOVERNMENT, OPTIONAL, PUBLIC
32
35
  from holidays.groups import InternationalHolidays, IslamicHolidays, StaticHolidays
33
36
  from holidays.holiday_base import HolidayBase
34
37
 
38
+ if TYPE_CHECKING:
39
+ from datetime import date
40
+
35
41
 
36
42
  class UnitedArabEmirates(HolidayBase, InternationalHolidays, IslamicHolidays, StaticHolidays):
37
43
  """United Arab Emirates holidays.
@@ -79,11 +85,12 @@ class UnitedArabEmirates(HolidayBase, InternationalHolidays, IslamicHolidays, St
79
85
  StaticHolidays.__init__(self, UnitedArabEmiratesStaticHolidays)
80
86
  super().__init__(*args, **kwargs)
81
87
 
82
- def _populate_public_holidays(self):
88
+ def _get_weekend(self, dt: date) -> set[int]:
83
89
  # The resting days are Saturday and Sunday since Jan 1, 2022.
84
90
  # https://web.archive.org/web/20250216144205/https://time.com/6126260/uae-working-days-weekend/
85
- self.weekend = {FRI, SAT} if self._year <= 2021 else {SAT, SUN}
91
+ return {SAT, SUN} if dt.year >= 2022 else {FRI, SAT}
86
92
 
93
+ def _populate_public_holidays(self):
87
94
  # New Year's Day.
88
95
  self._add_new_years_day(tr("رأس السنة الميلادية"))
89
96
 
@@ -128,7 +128,7 @@ class UnitedKingdom(ObservedHolidayBase, ChristianHolidays, InternationalHoliday
128
128
  def _populate_subdiv_nir_public_holidays(self):
129
129
  if self._year >= 1903:
130
130
  # Saint Patrick's Day.
131
- self._add_observed(self._add_holiday_mar_17(tr("Saint Patrick's Day")))
131
+ self._add_observed(self._add_saint_patricks_day(tr("Saint Patrick's Day")))
132
132
 
133
133
  # Easter Monday.
134
134
  self._add_easter_monday(tr("Easter Monday"))
@@ -249,7 +249,7 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
249
249
  kwargs.setdefault("observed_since", 1953)
250
250
  super().__init__(*args, **kwargs)
251
251
 
252
- def _populate_common(self, include_federal: bool = False):
252
+ def _populate_common(self, *, include_federal: bool = False):
253
253
  """
254
254
  Populates common US holidays.
255
255
 
@@ -1339,7 +1339,23 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
1339
1339
  # Started in Boston in 1737 for the US.
1340
1340
 
1341
1341
  # Saint Patrick's Day.
1342
- self._add_holiday_mar_17(tr("Saint Patrick's Day"))
1342
+ self._add_saint_patricks_day(tr("Saint Patrick's Day"))
1343
+
1344
+ # Mother's Day.
1345
+ # Starts to be observed by most US states by 1911.
1346
+ # Officially proclaimed as a National Holiday by President Woodrow Wilson in 1914.
1347
+
1348
+ if self._year >= 1914:
1349
+ # Mother's Day.
1350
+ self._add_holiday_2nd_sun_of_may(tr("Mother's Day"))
1351
+
1352
+ # Father's Day.
1353
+ # First founded in the state of Washington by Sonora Smart Dodd in 1910.
1354
+ # Officially proclaimed as a National Holiday by President Richard Nixon in 1972.
1355
+
1356
+ if self._year >= 1972:
1357
+ # Father's Day.
1358
+ self._add_holiday_3rd_sun_of_jun(tr("Father's Day"))
1343
1359
 
1344
1360
  # Halloween.
1345
1361
  # Halloween began in the US sometime around the 19th century.
@@ -10,8 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
13
+ from __future__ import annotations
14
+
14
15
  from gettext import gettext as tr
16
+ from typing import TYPE_CHECKING
15
17
 
16
18
  from holidays.calendars.gregorian import MAR
17
19
  from holidays.constants import BANK, PUBLIC
@@ -22,6 +24,9 @@ from holidays.observed_holiday_base import (
22
24
  THU_FRI_TO_NEXT_MON,
23
25
  )
24
26
 
27
+ if TYPE_CHECKING:
28
+ from datetime import date
29
+
25
30
 
26
31
  class Uruguay(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
27
32
  """Uruguay holidays.
@@ -10,8 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
13
+ from __future__ import annotations
14
+
14
15
  from gettext import gettext as tr
16
+ from typing import TYPE_CHECKING
15
17
 
16
18
  from holidays.calendars.chinese import VIETNAMESE_CALENDAR
17
19
  from holidays.calendars.gregorian import (
@@ -39,6 +41,9 @@ from holidays.observed_holiday_base import (
39
41
  SAT_SUN_TO_NEXT_WORKDAY,
40
42
  )
41
43
 
44
+ if TYPE_CHECKING:
45
+ from datetime import date
46
+
42
47
  NATIONAL_DAY_RULE = ObservedRule({MON: +1, TUE: -1, WED: -1, THU: +1, FRI: -1, SAT: -1, SUN: +1})
43
48
 
44
49
 
@@ -0,0 +1,92 @@
1
+ # holidays
2
+ # --------
3
+ # A fast, efficient Python library for generating country, province and state
4
+ # specific sets of holidays on the fly. It aims to make determining whether a
5
+ # specific date is a holiday as fast and flexible as possible.
6
+ #
7
+ # Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
8
+ # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
9
+ # ryanss <ryanssdev@icloud.com> (c) 2014-2017
10
+ # Website: https://github.com/vacanza/holidays
11
+ # License: MIT (see LICENSE file)
12
+
13
+ from gettext import gettext as tr
14
+
15
+ from holidays.groups import IslamicHolidays
16
+ from holidays.holiday_base import HolidayBase
17
+
18
+
19
+ class WesternSahara(HolidayBase, IslamicHolidays):
20
+ """Western Sahara holidays.
21
+
22
+ References:
23
+ * [1999 Constitution (es)](https://web.archive.org/web/20240210155831/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/Constitucion-RASD_1999_es.pdf)
24
+ * [1999 Constitution (fr)](https://web.archive.org/web/20250824061216/https://www.arso.org/03-const.99.htm)
25
+ * [2003 Constitution (ar)](https://web.archive.org/web/20240415014236/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/Constitucion-RASD_2003_ar.pdf)
26
+ * [2011 Constitution (es)](https://web.archive.org/web/20240415014236/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/RASD_Constitucion_2011_es.pdf)
27
+ * [2015 Constitution (en)](https://web.archive.org/web/20240605212800/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/RASD_Constitution-of-SADR-2015_en.pdf)
28
+ * [2019 Constitution (ar)](https://web.archive.org/web/20240415014236/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/RASD_Const_2019_ar.pdf)
29
+ """
30
+
31
+ country = "EH"
32
+ default_language = "ar"
33
+ # %s (estimated).
34
+ estimated_label = tr("%s (المقدرة)")
35
+ # 1999 Constitution was adopted by the 10th Congress on September 4th, 1999.
36
+ start_year = 2000
37
+ supported_languages = ("ar", "en_US", "es", "fr")
38
+
39
+ def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
40
+ """
41
+ Args:
42
+ islamic_show_estimated:
43
+ Whether to add "estimated" label to Islamic holidays name
44
+ if holiday date is estimated.
45
+ """
46
+ IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
47
+ super().__init__(*args, **kwargs)
48
+
49
+ def _populate_public_holidays(self):
50
+ # Proclamation of the SADR.
51
+ self._add_holiday_feb_27(tr("إعلان الجمهورية العربية الصحراوية الديمقراطية"))
52
+
53
+ # First Martyr.
54
+ self._add_holiday_mar_8(tr("يوم الشهيد الأول"))
55
+
56
+ # Creation of the Polisario Front.
57
+ self._add_holiday_may_10(tr("تأسيس الجبهة الشعبية لتحرير الساقية الحمراء ووادي الذهب"))
58
+
59
+ # Commencement of the Armed Struggle.
60
+ self._add_holiday_may_20(tr("اندلاع الكفاح المسلح"))
61
+
62
+ # Martyrs' Day.
63
+ self._add_holiday_jun_9(tr("يوم الشهداء"))
64
+
65
+ # Uprising Day.
66
+ self._add_holiday_jun_17(tr("يوم الانتفاضة"))
67
+
68
+ # National Unity Day.
69
+ self._add_holiday_oct_12(tr("عيد الوحدة الوطنية"))
70
+
71
+ # Added in the 2003 Constitution on October 19th, 2003.
72
+ if self._year >= 2003:
73
+ # Eid al-Fitr.
74
+ self._add_eid_al_fitr_day(tr("عيد الفطر المبارك"))
75
+
76
+ if self._year >= 2004:
77
+ # Islamic New Year.
78
+ self._add_islamic_new_year_day(tr("رأس السنة الهجرية"))
79
+
80
+ # Prophet's Birthday.
81
+ self._add_mawlid_day(tr("المولد النبوي الشريف"))
82
+
83
+ # Eid al-Adha.
84
+ self._add_eid_al_adha_day(tr("عيد الأضحى المبارك"))
85
+
86
+
87
+ class EH(WesternSahara):
88
+ pass
89
+
90
+
91
+ class ESH(WesternSahara):
92
+ pass
@@ -10,6 +10,7 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from datetime import date
13
14
  from gettext import gettext as tr
14
15
 
15
16
  from holidays.calendars import _CustomIslamicHolidays
@@ -45,6 +46,7 @@ class Yemen(ObservedHolidayBase, InternationalHolidays, IslamicHolidays):
45
46
  start_year = 1991
46
47
  supported_categories = (PUBLIC, SCHOOL, WORKDAY)
47
48
  supported_languages = ("ar", "en_US")
49
+ weekend = {FRI, SAT}
48
50
 
49
51
  def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
50
52
  """
@@ -60,12 +62,13 @@ class Yemen(ObservedHolidayBase, InternationalHolidays, IslamicHolidays):
60
62
  kwargs.setdefault("observed_rule", FRI_TO_NEXT_WORKDAY)
61
63
  super().__init__(*args, **kwargs)
62
64
 
65
+ def _get_weekend(self, dt: date) -> set[int]:
66
+ # Yemen switches from THU-FRI to FRI-SAT on Aug 15, 2013.
67
+ return {FRI, SAT} if dt >= date(2013, AUG, 15) else {THU, FRI}
68
+
63
69
  def _populate_public_holidays(self):
64
70
  dts_observed = set()
65
71
 
66
- # Yemen switches from THU-FRI to FRI-SAT on Aug 15, 2013
67
- self.weekend = {THU, FRI} if self._year <= 2012 else {FRI, SAT}
68
-
69
72
  # Hijri New Year.
70
73
  dts_observed.update(self._add_islamic_new_year_day(tr("عيد رأس السنة الهجرية")))
71
74
 
@@ -14,6 +14,7 @@
14
14
 
15
15
  from holidays.groups.balinese_saka import BalineseSakaCalendarHolidays
16
16
  from holidays.groups.buddhist import BuddhistCalendarHolidays
17
+ from holidays.groups.burmese import BurmeseCalendarHolidays
17
18
  from holidays.groups.chinese import ChineseCalendarHolidays
18
19
  from holidays.groups.christian import ChristianHolidays
19
20
  from holidays.groups.custom import StaticHolidays
@@ -13,7 +13,7 @@
13
13
  from datetime import date
14
14
  from typing import Optional
15
15
 
16
- from holidays.calendars import _BalineseSakaLunar
16
+ from holidays.calendars.balinese_saka import _BalineseSakaLunar
17
17
 
18
18
 
19
19
  class BalineseSakaCalendarHolidays:
@@ -13,7 +13,7 @@
13
13
  from datetime import date
14
14
  from typing import Optional
15
15
 
16
- from holidays.calendars import _BuddhistLunisolar
16
+ from holidays.calendars.buddhist import _BuddhistLunisolar
17
17
  from holidays.groups.eastern import EasternCalendarHolidays
18
18
 
19
19
 
@@ -22,7 +22,7 @@ class BuddhistCalendarHolidays(EasternCalendarHolidays):
22
22
  Buddhist lunisolar calendar holidays.
23
23
  """
24
24
 
25
- def __init__(self, cls=None, show_estimated=False) -> None:
25
+ def __init__(self, cls=None, *, show_estimated=False) -> None:
26
26
  self._buddhist_calendar = cls() if cls else _BuddhistLunisolar()
27
27
  self._buddhist_calendar_show_estimated = show_estimated
28
28
 
@@ -36,7 +36,7 @@ class BuddhistCalendarHolidays(EasternCalendarHolidays):
36
36
  is an estimation.
37
37
  """
38
38
  return self._add_eastern_calendar_holiday(
39
- name, dt_estimated, self._buddhist_calendar_show_estimated
39
+ name, dt_estimated, show_estimated=self._buddhist_calendar_show_estimated
40
40
  )
41
41
 
42
42
  def _add_vesak(self, name) -> Optional[date]: