holidays 0.82__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 (71) hide show
  1. holidays/calendars/islamic.py +26 -6
  2. holidays/countries/__init__.py +1 -0
  3. holidays/countries/azerbaijan.py +1 -1
  4. holidays/countries/canada.py +27 -13
  5. holidays/countries/denmark.py +18 -6
  6. holidays/countries/fiji.py +2 -3
  7. holidays/countries/finland.py +3 -6
  8. holidays/countries/guyana.py +24 -32
  9. holidays/countries/india.py +21 -78
  10. holidays/countries/iran.py +133 -269
  11. holidays/countries/ireland.py +1 -1
  12. holidays/countries/israel.py +1 -1
  13. holidays/countries/macau.py +5 -8
  14. holidays/countries/mauritius.py +10 -9
  15. holidays/countries/montserrat.py +1 -1
  16. holidays/countries/myanmar.py +9 -10
  17. holidays/countries/nepal.py +11 -30
  18. holidays/countries/netherlands.py +28 -24
  19. holidays/countries/new_zealand.py +75 -31
  20. holidays/countries/nigeria.py +53 -75
  21. holidays/countries/norway.py +1 -1
  22. holidays/countries/rwanda.py +2 -2
  23. holidays/countries/slovakia.py +23 -4
  24. holidays/countries/sri_lanka.py +21 -58
  25. holidays/countries/suriname.py +1 -2
  26. holidays/countries/sweden.py +1 -1
  27. holidays/countries/switzerland.py +86 -3
  28. holidays/countries/taiwan.py +1 -1
  29. holidays/countries/tanzania.py +19 -29
  30. holidays/countries/thailand.py +8 -7
  31. holidays/countries/trinidad_and_tobago.py +1 -1
  32. holidays/countries/ukraine.py +1 -1
  33. holidays/countries/united_kingdom.py +1 -1
  34. holidays/countries/united_states.py +2 -2
  35. holidays/countries/western_sahara.py +92 -0
  36. holidays/groups/buddhist.py +2 -2
  37. holidays/groups/chinese.py +5 -2
  38. holidays/groups/christian.py +10 -0
  39. holidays/groups/eastern.py +3 -1
  40. holidays/groups/hindu.py +9 -3
  41. holidays/groups/international.py +1 -1
  42. holidays/groups/islamic.py +10 -3
  43. holidays/groups/mongolian.py +5 -2
  44. holidays/groups/sinhala.py +6 -3
  45. holidays/groups/tibetan.py +5 -2
  46. holidays/holiday_base.py +21 -22
  47. holidays/locale/ar/LC_MESSAGES/EH.mo +0 -0
  48. holidays/locale/de/LC_MESSAGES/CH.mo +0 -0
  49. holidays/locale/en_US/LC_MESSAGES/CH.mo +0 -0
  50. holidays/locale/en_US/LC_MESSAGES/EH.mo +0 -0
  51. holidays/locale/en_US/LC_MESSAGES/NL.mo +0 -0
  52. holidays/locale/es/LC_MESSAGES/EH.mo +0 -0
  53. holidays/locale/fr/LC_MESSAGES/CH.mo +0 -0
  54. holidays/locale/fr/LC_MESSAGES/EH.mo +0 -0
  55. holidays/locale/fy/LC_MESSAGES/NL.mo +0 -0
  56. holidays/locale/it/LC_MESSAGES/CH.mo +0 -0
  57. holidays/locale/nl/LC_MESSAGES/NL.mo +0 -0
  58. holidays/locale/th/LC_MESSAGES/CH.mo +0 -0
  59. holidays/locale/th/LC_MESSAGES/DK.mo +0 -0
  60. holidays/locale/th/LC_MESSAGES/NL.mo +0 -0
  61. holidays/locale/uk/LC_MESSAGES/CH.mo +0 -0
  62. holidays/locale/uk/LC_MESSAGES/NL.mo +0 -0
  63. holidays/observed_holiday_base.py +16 -4
  64. holidays/registry.py +2 -0
  65. holidays/version.py +1 -1
  66. {holidays-0.82.dist-info → holidays-0.83.dist-info}/METADATA +18 -16
  67. {holidays-0.82.dist-info → holidays-0.83.dist-info}/RECORD +71 -63
  68. {holidays-0.82.dist-info → holidays-0.83.dist-info}/WHEEL +0 -0
  69. {holidays-0.82.dist-info → holidays-0.83.dist-info}/licenses/CONTRIBUTORS +0 -0
  70. {holidays-0.82.dist-info → holidays-0.83.dist-info}/licenses/LICENSE +0 -0
  71. {holidays-0.82.dist-info → holidays-0.83.dist-info}/top_level.txt +0 -0
@@ -94,12 +94,18 @@ class SriLanka(
94
94
  islamic_show_estimated:
95
95
  Whether to add "estimated" label to Islamic holidays name
96
96
  if holiday date is estimated.
97
+
98
+ In Sri Lanka, the dates of the Islamic calendar usually fall a day later than
99
+ the corresponding dates in the Umm al-Qura calendar.
97
100
  """
98
101
  ChristianHolidays.__init__(self)
99
102
  HinduCalendarHolidays.__init__(self, SriLankaHinduHolidays)
100
103
  InternationalHolidays.__init__(self)
101
104
  IslamicHolidays.__init__(
102
- self, cls=SriLankaIslamicHolidays, show_estimated=islamic_show_estimated
105
+ self,
106
+ cls=SriLankaIslamicHolidays,
107
+ show_estimated=islamic_show_estimated,
108
+ calendar_delta_days=+1,
103
109
  )
104
110
  SinhalaCalendarHolidays.__init__(self)
105
111
  StaticHolidays.__init__(self, cls=SriLankaStaticHolidays)
@@ -289,75 +295,32 @@ class SriLankaHinduHolidays(_CustomHinduHolidays):
289
295
 
290
296
 
291
297
  class SriLankaIslamicHolidays(_CustomIslamicHolidays):
298
+ # https://web.archive.org/web/20111103102902/http://www.adaderana.lk:80/news.php?nid=15606
299
+ # https://web.archive.org/web/20121029024049/http://www.adaderana.lk:80/news.php?nid=20136
292
300
  EID_AL_ADHA_DATES_CONFIRMED_YEARS = (2003, 2025)
293
301
  EID_AL_ADHA_DATES = {
294
- 2003: (FEB, 12),
302
+ 2004: (FEB, 1),
303
+ 2005: (JAN, 21),
295
304
  2006: ((JAN, 11), (DEC, 31)),
296
- 2007: (DEC, 21),
297
- 2008: (DEC, 9),
298
- 2009: (NOV, 28),
299
- 2010: (NOV, 17),
300
- # https://web.archive.org/web/20111103102902/http://www.adaderana.lk:80/news.php?nid=15606
301
- 2011: (NOV, 7),
302
- # https://web.archive.org/web/20121029024049/http://www.adaderana.lk:80/news.php?nid=20136
303
- 2012: (OCT, 27),
304
- 2013: (OCT, 16),
305
- 2014: (OCT, 5),
306
- 2015: (SEP, 24),
307
- 2016: (SEP, 12),
308
- 2018: (AUG, 22),
309
- 2019: (AUG, 12),
310
- 2020: (AUG, 1),
311
- 2021: (JUL, 21),
312
- 2022: (JUL, 10),
313
- 2023: (JUN, 29),
314
- 2024: (JUN, 17),
315
- 2025: (JUN, 7),
305
+ 2017: (SEP, 1),
316
306
  }
317
307
 
318
308
  EID_AL_FITR_DATES_CONFIRMED_YEARS = (2003, 2025)
319
309
  EID_AL_FITR_DATES = {
320
- 2003: (NOV, 26),
321
- 2005: (NOV, 4),
322
- 2006: (OCT, 24),
323
- 2009: (SEP, 21),
324
- 2011: (AUG, 31),
325
- 2013: (AUG, 9),
326
- 2014: (JUL, 29),
327
- 2015: (JUL, 18),
328
- 2017: (JUN, 26),
329
- 2019: (JUN, 5),
330
- 2020: (MAY, 25),
331
- 2021: (MAY, 14),
332
- 2022: (MAY, 3),
333
- 2023: (APR, 22),
334
- 2024: (APR, 11),
335
- 2025: (MAR, 31),
310
+ 2004: (NOV, 14),
311
+ 2007: (OCT, 13),
312
+ 2008: (OCT, 1),
313
+ 2010: (SEP, 10),
314
+ 2012: (AUG, 19),
315
+ 2016: (JUL, 6),
316
+ 2018: (JUN, 15),
336
317
  }
337
318
 
338
319
  MAWLID_DATES_CONFIRMED_YEARS = (2003, 2025)
339
320
  MAWLID_DATES = {
340
- 2003: (MAY, 14),
341
- 2004: (MAY, 2),
342
- 2005: (APR, 22),
343
- 2006: (APR, 11),
344
- 2007: (APR, 1),
345
- 2009: (MAR, 10),
346
- 2010: (FEB, 27),
347
- 2011: (FEB, 16),
348
- 2012: (FEB, 5),
349
- 2013: (JAN, 25),
350
- 2014: (JAN, 14),
321
+ 2008: (MAR, 20),
351
322
  2015: (JAN, 4),
352
- 2016: (DEC, 12),
353
- 2017: (DEC, 1),
354
- 2019: (NOV, 10),
355
- 2020: (OCT, 30),
356
- 2021: (OCT, 19),
357
- 2022: (OCT, 9),
358
- 2023: (SEP, 28),
359
- 2024: (SEP, 16),
360
- 2025: (SEP, 5),
323
+ 2018: (NOV, 20),
361
324
  }
362
325
 
363
326
 
@@ -108,14 +108,13 @@ class Suriname(
108
108
  self._add_holiday_oct_10(tr("Dag der Marrons"))
109
109
 
110
110
  if self._year >= 1976:
111
- name = (
111
+ self._add_holiday_nov_25(
112
112
  # Independence Day.
113
113
  tr("Onafhankelijkheidsdag")
114
114
  if self._year >= 2008
115
115
  # Republic Day.
116
116
  else tr("Dag van de Republiek")
117
117
  )
118
- self._add_holiday_nov_25(name)
119
118
 
120
119
  # Christmas Day.
121
120
  self._add_christmas_day(tr("Eerste Kerstdag"))
@@ -39,7 +39,7 @@ class Sweden(HolidayBase, ChristianHolidays, InternationalHolidays):
39
39
  default_language = "sv"
40
40
  supported_languages = ("en_US", "sv", "th", "uk")
41
41
 
42
- def __init__(self, include_sundays: bool = True, *args, **kwargs):
42
+ def __init__(self, *args, include_sundays: bool = True, **kwargs):
43
43
  """
44
44
  Args:
45
45
  include_sundays:
@@ -12,10 +12,17 @@
12
12
 
13
13
  from gettext import gettext as tr
14
14
 
15
- from holidays.calendars.gregorian import APR, THU, _timedelta, _get_nth_weekday_of_month
15
+ from holidays.calendars.gregorian import MAR, APR, MON, THU, _timedelta, _get_nth_weekday_of_month
16
16
  from holidays.constants import HALF_DAY, OPTIONAL, PUBLIC
17
17
  from holidays.groups import ChristianHolidays, InternationalHolidays
18
- from holidays.observed_holiday_base import ObservedHolidayBase, MON_ONLY, TUE_TO_NONE, SAT_TO_NONE
18
+ from holidays.observed_holiday_base import (
19
+ ObservedHolidayBase,
20
+ MON_ONLY,
21
+ TUE_TO_NONE,
22
+ SAT_TO_NONE,
23
+ SUN_TO_NONE,
24
+ ALL_TO_NEXT_MON,
25
+ )
19
26
 
20
27
 
21
28
  class Switzerland(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
@@ -23,6 +30,11 @@ class Switzerland(ObservedHolidayBase, ChristianHolidays, InternationalHolidays)
23
30
 
24
31
  References:
25
32
  * <https://web.archive.org/web/20250201054902/https://www.bj.admin.ch/dam/bj/de/data/publiservice/service/zivilprozessrecht/kant-feiertage.pdf>
33
+ * <https://web.archive.org/web/20251002085718/https://www.zuerich.com/en/inform-plan/useful-information-and-services/opening-hours-and-public-holidays/feiertage>
34
+ * <https://web.archive.org/web/20251008032850/https://www.stadt-zuerich.ch/de/politik-und-verwaltung/arbeiten-bei-der-stadt/gut-zu-wissen/ferien-urlaub/feiertage-betriebsferientage-bft.html>
35
+ * <https://web.archive.org/web/20230423124030/https://zuercher-bankenverband.ch/zbv/assets/uploads/2021/09/2022-Feiertagsuebersicht.pdf>
36
+ * <https://web.archive.org/web/20251008045946/https://zuercher-bankenverband.ch/zbv/assets/uploads/2022/09/2023-Feiertagsuebersicht.pdf>
37
+ * <https://web.archive.org/web/20251003094601/https://www.timeanddate.com/calendar/seasons.html?year=1900&n=268>
26
38
  * <https://de.wikipedia.org/wiki/Feiertage_in_der_Schweiz>
27
39
  * <https://en.wikipedia.org/wiki/Public_holidays_in_Switzerland>
28
40
  """
@@ -92,7 +104,7 @@ class Switzerland(ObservedHolidayBase, ChristianHolidays, InternationalHolidays)
92
104
  "Zürich": "ZH",
93
105
  }
94
106
  supported_categories = (HALF_DAY, OPTIONAL, PUBLIC)
95
- supported_languages = ("de", "en_US", "fr", "it", "uk")
107
+ supported_languages = ("de", "en_US", "fr", "it", "th", "uk")
96
108
 
97
109
  def __init__(self, *args, **kwargs):
98
110
  ChristianHolidays.__init__(self)
@@ -713,9 +725,80 @@ class Switzerland(ObservedHolidayBase, ChristianHolidays, InternationalHolidays)
713
725
  # Whit Monday.
714
726
  self._add_whit_monday(tr("Pfingstmontag"))
715
727
 
728
+ if self._year >= 1899:
729
+ # Knabenschiessen.
730
+ name = tr("Knabenschiessen")
731
+ self._add_holiday_2nd_sun_of_sep(name)
732
+ self._add_holiday_1_day_prior_2nd_sun_of_sep(name)
733
+
716
734
  # Saint Stephen's Day.
717
735
  self._add_christmas_day_two(tr("Stephanstag"))
718
736
 
737
+ def _populate_subdiv_zh_common(self):
738
+ """Populate list of holidays observed by both `HALF_DAY` and `OPTIONAL` categories."""
739
+ # Day before Good Friday.
740
+ self._add_holy_thursday(tr("Vortag vor Karfreitag"))
741
+
742
+ if self._year >= 1902:
743
+ # Sechseläuten.
744
+ name = tr("Sechseläuten")
745
+ # Third Monday in April but not in Holy Week.
746
+ if self._year >= 1952:
747
+ dt = _get_nth_weekday_of_month(3, MON, APR, self._year)
748
+ self._add_holiday(
749
+ name, _timedelta(dt, +7) if dt == _timedelta(self._easter_sunday, +1) else dt
750
+ )
751
+ # From 1902-1951 this was the First Monday following the Vernal Equinox.
752
+ else:
753
+ self._move_holiday_forced(
754
+ self._add_holiday(name, self._vernal_equinox_date), rule=ALL_TO_NEXT_MON
755
+ )
756
+
757
+ # Christmas Eve.
758
+ self._add_christmas_eve(tr("Heiligabend"))
759
+
760
+ # New Year's Eve.
761
+ self._add_new_years_eve(tr("Vortag vor Neujahr"))
762
+
763
+ def _populate_subdiv_zh_half_day_holidays(self):
764
+ self._populate_subdiv_zh_common()
765
+
766
+ if self._year >= 1899:
767
+ # Knabenschiessen.
768
+ self._add_holiday_1_day_past_2nd_sun_of_sep(tr("Knabenschiessen"))
769
+
770
+ # Day before Ascension Day.
771
+ self._add_holiday_38_days_past_easter(tr("Vortag vor Auffahrt"))
772
+
773
+ def _populate_subdiv_zh_optional_holidays(self):
774
+ self._populate_subdiv_zh_common()
775
+
776
+ dec_25 = self._christmas_day
777
+
778
+ # This is only granted if end-year bridge holidays <= 2.
779
+ if self._is_tuesday(dec_25) or self._is_wednesday(dec_25) or self._is_thursday(dec_25):
780
+ # Bridge Holiday for Ascension Day.
781
+ self._add_holiday_40_days_past_easter(tr("Brückentag nach Auffahrt"))
782
+
783
+ # This is only granted if end-year bridge holidays <= 3.
784
+ if self._year >= 1899 and not self._is_weekend(dec_25):
785
+ # Knabenschiessen.
786
+ self._add_holiday_1_day_past_2nd_sun_of_sep(tr("Knabenschiessen"))
787
+
788
+ # Bridge Holiday.
789
+ name = tr("Brückentag")
790
+ self._add_observed(self._add_holiday_dec_27(name), rule=SAT_TO_NONE + SUN_TO_NONE)
791
+ self._add_observed(self._add_holiday_dec_28(name), rule=SAT_TO_NONE + SUN_TO_NONE)
792
+ self._add_observed(self._add_holiday_dec_29(name), rule=SAT_TO_NONE + SUN_TO_NONE)
793
+ self._add_observed(self._add_holiday_dec_30(name), rule=SAT_TO_NONE + SUN_TO_NONE)
794
+
795
+ @property
796
+ def _vernal_equinox_date(self) -> tuple[int, int]:
797
+ """Return the Vernal Equinox date for Zurich (1902-1951)."""
798
+ return MAR, 20 if (
799
+ (self._year >= 1916 and self._year % 4 == 0) or self._year == 1949
800
+ ) else 21
801
+
719
802
 
720
803
  class CH(Switzerland):
721
804
  pass
@@ -134,7 +134,7 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
134
134
  dt,
135
135
  name,
136
136
  # Children's Day falls on the same day as Tomb-Sweeping Day.
137
- 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,
138
138
  )
139
139
 
140
140
  def _populate_public_holidays(self):
@@ -121,11 +121,17 @@ class Tanzania(
121
121
  islamic_show_estimated:
122
122
  Whether to add "estimated" label to Islamic holidays name
123
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.
124
127
  """
125
128
  ChristianHolidays.__init__(self)
126
129
  InternationalHolidays.__init__(self)
127
130
  IslamicHolidays.__init__(
128
- self, cls=TanzaniaIslamicHolidays, show_estimated=islamic_show_estimated
131
+ self,
132
+ cls=TanzaniaIslamicHolidays,
133
+ show_estimated=islamic_show_estimated,
134
+ calendar_delta_days=+1,
129
135
  )
130
136
  StaticHolidays.__init__(self, TanzaniaStaticHolidays)
131
137
  super().__init__(*args, **kwargs)
@@ -155,7 +161,7 @@ class Tanzania(
155
161
  else:
156
162
  rule = SAT_SUN_TO_NEXT_MON
157
163
  for name in self.get_list(dt):
158
- self._add_observed(dt, name, rule)
164
+ self._add_observed(dt, name, rule=rule)
159
165
 
160
166
  def _populate_bank_holidays(self):
161
167
  # Sikukuu ya Pasaka.
@@ -324,16 +330,11 @@ class TanzaniaIslamicHolidays(_CustomIslamicHolidays):
324
330
  2004: (FEB, 2),
325
331
  2006: (JAN, 9),
326
332
  2007: (JAN, 1),
327
- 2014: (OCT, 5),
328
- 2016: (SEP, 16),
329
- 2017: (SEP, 2),
330
- 2018: (AUG, 22),
333
+ 2013: (OCT, 15),
334
+ 2015: (SEP, 23),
335
+ 2016: (SEP, 13),
331
336
  2019: (AUG, 13),
332
- 2021: (JUL, 21),
333
- 2022: (JUL, 10),
334
- 2023: (JUN, 29),
335
- 2024: (JUN, 17),
336
- 2025: (JUN, 7),
337
+ 2020: (JUL, 31),
337
338
  }
338
339
 
339
340
  EID_AL_FITR_DATES_CONFIRMED_YEARS = (2013, 2025)
@@ -360,15 +361,10 @@ class TanzaniaIslamicHolidays(_CustomIslamicHolidays):
360
361
  2004: (OCT, 18),
361
362
  2006: (OCT, 29),
362
363
  2007: (OCT, 13),
363
- 2014: (JUL, 29),
364
- 2015: (JUL, 18),
365
- 2016: (JUL, 7),
366
- 2017: (JUN, 26),
367
- 2019: (JUN, 5),
368
- 2021: (MAY, 14),
369
- 2022: (MAY, 3),
370
- 2023: (APR, 22),
371
- 2025: (MAR, 31),
364
+ 2013: (AUG, 8),
365
+ 2018: (JUN, 15),
366
+ 2020: (MAY, 24),
367
+ 2024: (APR, 10),
372
368
  }
373
369
 
374
370
  MAWLID_DATES_CONFIRMED_YEARS = (2013, 2025)
@@ -395,16 +391,10 @@ class TanzaniaIslamicHolidays(_CustomIslamicHolidays):
395
391
  2004: (MAY, 2),
396
392
  2006: (APR, 10),
397
393
  2007: (MAR, 31),
398
- 2014: (JAN, 14),
394
+ 2013: (JAN, 24),
399
395
  2015: ((JAN, 3), (DEC, 24)),
400
- 2016: (DEC, 12),
401
- 2017: (DEC, 1),
402
- 2018: (NOV, 21),
403
- 2019: (NOV, 10),
404
- 2021: (OCT, 19),
405
- 2022: (OCT, 9),
406
- 2023: (SEP, 28),
407
- 2024: (SEP, 16),
396
+ 2020: (OCT, 29),
397
+ 2025: (SEP, 4),
408
398
  }
409
399
 
410
400
 
@@ -681,14 +681,15 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
681
681
  # **For pre-1941 data, Buddhist Era year starts on APR 1st.
682
682
 
683
683
  if 1915 <= self._year <= 1925 or self._year >= 1938:
684
- name = (
685
- # Makha Bucha.
686
- tr("วันมาฆบูชา")
687
- if self._year >= 1938
688
- # Makha Bucha, the Fourfold Assembly Day.
689
- 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
+ )
690
692
  )
691
- self._add_observed(self._add_makha_bucha(name))
692
693
 
693
694
  # วันวิสาขบูชา
694
695
  # Status: In-Use.
@@ -87,7 +87,7 @@ class TrinidadAndTobago(
87
87
  )
88
88
  super().__init__(*args, **kwargs)
89
89
 
90
- def _populate_observed(self, dts: set[date], multiple: bool = False) -> None:
90
+ def _populate_observed(self, dts: set[date], *, multiple: bool = False) -> None:
91
91
  for dt in sorted(dts):
92
92
  self._add_observed(
93
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
@@ -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,7 @@ 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
1343
 
1344
1344
  # Mother's Day.
1345
1345
  # Starts to be observed by most US states by 1911.
@@ -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
@@ -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]:
@@ -23,7 +23,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
23
23
  Chinese lunisolar calendar holidays.
24
24
  """
25
25
 
26
- def __init__(self, cls=None, show_estimated=False, calendar=CHINESE_CALENDAR) -> None:
26
+ def __init__(self, cls=None, *, show_estimated=False, calendar=CHINESE_CALENDAR) -> None:
27
27
  self._chinese_calendar = (
28
28
  cls(calendar=calendar) if cls else _ChineseLunisolar(calendar=calendar)
29
29
  )
@@ -92,7 +92,10 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
92
92
  is an estimation.
93
93
  """
94
94
  return self._add_eastern_calendar_holiday(
95
- name, dt_estimated, self._chinese_calendar_show_estimated, days_delta
95
+ name,
96
+ dt_estimated,
97
+ show_estimated=self._chinese_calendar_show_estimated,
98
+ days_delta=days_delta,
96
99
  )
97
100
 
98
101
  def _add_chinese_birthday_of_buddha(self, name) -> Optional[date]:
@@ -455,6 +455,16 @@ class ChristianHolidays:
455
455
  """
456
456
  return self._add_holiday_mar_19(name)
457
457
 
458
+ def _add_saint_patricks_day(self, name) -> date:
459
+ """
460
+ Add Saint Patrick's Day (March 17th).
461
+
462
+ Saint Patrick's Day is a religious and cultural holiday held on 17 March,
463
+ the traditional death date of Saint Patrick, the foremost patron saint of Ireland.
464
+ https://en.wikipedia.org/wiki/Saint_Patrick's_Day
465
+ """
466
+ return self._add_holiday_mar_17(name)
467
+
458
468
  def _add_saints_peter_and_paul_day(self, name) -> date:
459
469
  """
460
470
  Add Feast of Saints Peter and Paul (June 29th).
@@ -26,6 +26,7 @@ class EasternCalendarHolidays:
26
26
  self,
27
27
  name: str,
28
28
  dt_estimated: tuple[Optional[date], bool],
29
+ *,
29
30
  show_estimated: bool = True,
30
31
  days_delta: int = 0,
31
32
  ) -> Optional[date]:
@@ -53,6 +54,7 @@ class EasternCalendarHolidays:
53
54
  self,
54
55
  name: str,
55
56
  dts_estimated: Iterable[tuple[date, bool]],
57
+ *,
56
58
  show_estimated: bool = True,
57
59
  days_delta: int = 0,
58
60
  ) -> set[date]:
@@ -67,7 +69,7 @@ class EasternCalendarHolidays:
67
69
  for dt_estimated in dts_estimated
68
70
  if (
69
71
  dt := self._add_eastern_calendar_holiday(
70
- name, dt_estimated, show_estimated, days_delta
72
+ name, dt_estimated, show_estimated=show_estimated, days_delta=days_delta
71
73
  )
72
74
  )
73
75
  }
holidays/groups/hindu.py CHANGED
@@ -23,7 +23,7 @@ class HinduCalendarHolidays(EasternCalendarHolidays):
23
23
  Hindu lunisolar calendar holidays.
24
24
  """
25
25
 
26
- def __init__(self, cls=None, show_estimated=False) -> None:
26
+ def __init__(self, cls=None, *, show_estimated=False) -> None:
27
27
  self._hindu_calendar = cls() if cls else _HinduLunisolar()
28
28
  self._hindu_calendar_show_estimated = show_estimated
29
29
 
@@ -38,7 +38,10 @@ class HinduCalendarHolidays(EasternCalendarHolidays):
38
38
  """
39
39
 
40
40
  return self._add_eastern_calendar_holiday(
41
- name, dt_estimated, self._hindu_calendar_show_estimated, days_delta
41
+ name,
42
+ dt_estimated,
43
+ show_estimated=self._hindu_calendar_show_estimated,
44
+ days_delta=days_delta,
42
45
  )
43
46
 
44
47
  def _add_hindu_calendar_holiday_set(
@@ -51,7 +54,10 @@ class HinduCalendarHolidays(EasternCalendarHolidays):
51
54
  is an estimation.
52
55
  """
53
56
  return self._add_eastern_calendar_holiday_set(
54
- name, dts_estimated, self._hindu_calendar_show_estimated, days_delta
57
+ name,
58
+ dts_estimated,
59
+ show_estimated=self._hindu_calendar_show_estimated,
60
+ days_delta=days_delta,
55
61
  )
56
62
 
57
63
  def _add_bhai_dooj(self, name) -> Optional[date]:
@@ -212,7 +212,7 @@ class InternationalHolidays:
212
212
  """
213
213
  return self._add_holiday_mar_8(name)
214
214
 
215
- def _add_world_war_two_victory_day(self, name, is_western=True):
215
+ def _add_world_war_two_victory_day(self, name, *, is_western=True):
216
216
  """
217
217
  Add Day of Victory in World War II in Europe (May 8).
218
218
  https://en.wikipedia.org/wiki/Victory_in_Europe_Day