holidays 0.62__py3-none-any.whl → 0.64__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 (97) hide show
  1. holidays/calendars/hebrew.py +32 -3
  2. holidays/calendars/thai.py +25 -9
  3. holidays/constants.py +1 -0
  4. holidays/countries/__init__.py +1 -0
  5. holidays/countries/afghanistan.py +104 -0
  6. holidays/countries/angola.py +22 -25
  7. holidays/countries/argentina.py +2 -3
  8. holidays/countries/azerbaijan.py +2 -2
  9. holidays/countries/belarus.py +93 -14
  10. holidays/countries/bolivia.py +1 -1
  11. holidays/countries/bosnia_and_herzegovina.py +1 -1
  12. holidays/countries/cambodia.py +6 -7
  13. holidays/countries/canada.py +1 -2
  14. holidays/countries/chile.py +10 -11
  15. holidays/countries/costa_rica.py +1 -1
  16. holidays/countries/croatia.py +1 -2
  17. holidays/countries/czechia.py +1 -1
  18. holidays/countries/dominica.py +1 -2
  19. holidays/countries/el_salvador.py +45 -24
  20. holidays/countries/france.py +18 -3
  21. holidays/countries/hungary.py +2 -2
  22. holidays/countries/israel.py +55 -81
  23. holidays/countries/kazakhstan.py +8 -2
  24. holidays/countries/latvia.py +2 -4
  25. holidays/countries/lithuania.py +1 -1
  26. holidays/countries/montenegro.py +143 -27
  27. holidays/countries/namibia.py +1 -1
  28. holidays/countries/new_zealand.py +3 -8
  29. holidays/countries/norway.py +1 -1
  30. holidays/countries/philippines.py +2 -2
  31. holidays/countries/poland.py +9 -1
  32. holidays/countries/russia.py +1 -1
  33. holidays/countries/south_korea.py +4 -8
  34. holidays/countries/thailand.py +499 -213
  35. holidays/countries/turkey.py +2 -4
  36. holidays/countries/ukraine.py +19 -10
  37. holidays/countries/united_states.py +26 -23
  38. holidays/countries/uruguay.py +8 -7
  39. holidays/financial/__init__.py +2 -2
  40. holidays/financial/european_central_bank.py +10 -3
  41. holidays/financial/ny_stock_exchange.py +82 -45
  42. holidays/groups/__init__.py +1 -0
  43. holidays/groups/christian.py +2 -0
  44. holidays/groups/custom.py +12 -0
  45. holidays/groups/hebrew.py +151 -0
  46. holidays/holiday_base.py +4 -13
  47. holidays/locale/be/LC_MESSAGES/BY.mo +0 -0
  48. holidays/locale/be/LC_MESSAGES/BY.po +53 -17
  49. holidays/locale/cnr/LC_MESSAGES/ME.mo +0 -0
  50. holidays/locale/cnr/LC_MESSAGES/ME.po +102 -0
  51. holidays/locale/en_US/LC_MESSAGES/AF.mo +0 -0
  52. holidays/locale/en_US/LC_MESSAGES/AF.po +98 -0
  53. holidays/locale/en_US/LC_MESSAGES/BY.mo +0 -0
  54. holidays/locale/en_US/LC_MESSAGES/BY.po +61 -20
  55. holidays/locale/en_US/LC_MESSAGES/ME.mo +0 -0
  56. holidays/locale/en_US/LC_MESSAGES/ME.po +102 -0
  57. holidays/locale/en_US/LC_MESSAGES/PL.mo +0 -0
  58. holidays/locale/en_US/LC_MESSAGES/PL.po +7 -5
  59. holidays/locale/en_US/LC_MESSAGES/SV.mo +0 -0
  60. holidays/locale/en_US/LC_MESSAGES/SV.po +75 -0
  61. holidays/locale/en_US/LC_MESSAGES/TH.mo +0 -0
  62. holidays/locale/en_US/LC_MESSAGES/TH.po +128 -24
  63. holidays/locale/es/LC_MESSAGES/SV.mo +0 -0
  64. holidays/locale/es/LC_MESSAGES/SV.po +75 -0
  65. holidays/locale/fa_AF/LC_MESSAGES/AF.mo +0 -0
  66. holidays/locale/fa_AF/LC_MESSAGES/AF.po +98 -0
  67. holidays/locale/pl/LC_MESSAGES/PL.mo +0 -0
  68. holidays/locale/pl/LC_MESSAGES/PL.po +8 -4
  69. holidays/locale/ps_AF/LC_MESSAGES/AF.mo +0 -0
  70. holidays/locale/ps_AF/LC_MESSAGES/AF.po +98 -0
  71. holidays/locale/ru/LC_MESSAGES/BY.mo +0 -0
  72. holidays/locale/ru/LC_MESSAGES/BY.po +111 -0
  73. holidays/locale/th/LC_MESSAGES/BY.mo +0 -0
  74. holidays/locale/th/LC_MESSAGES/BY.po +109 -0
  75. holidays/locale/th/LC_MESSAGES/NO.mo +0 -0
  76. holidays/locale/th/LC_MESSAGES/NO.po +80 -0
  77. holidays/locale/th/LC_MESSAGES/RU.mo +0 -0
  78. holidays/locale/th/LC_MESSAGES/RU.po +90 -0
  79. holidays/locale/th/LC_MESSAGES/TH.mo +0 -0
  80. holidays/locale/th/LC_MESSAGES/TH.po +127 -23
  81. holidays/locale/th/LC_MESSAGES/UA.mo +0 -0
  82. holidays/locale/th/LC_MESSAGES/UA.po +114 -0
  83. holidays/locale/uk/LC_MESSAGES/ME.mo +0 -0
  84. holidays/locale/uk/LC_MESSAGES/ME.po +102 -0
  85. holidays/locale/uk/LC_MESSAGES/PL.mo +0 -0
  86. holidays/locale/uk/LC_MESSAGES/PL.po +7 -5
  87. holidays/locale/uk/LC_MESSAGES/SV.mo +0 -0
  88. holidays/locale/uk/LC_MESSAGES/SV.po +75 -0
  89. holidays/registry.py +3 -2
  90. holidays/utils.py +1 -5
  91. holidays/version.py +1 -1
  92. {holidays-0.62.dist-info → holidays-0.64.dist-info}/AUTHORS +1 -0
  93. {holidays-0.62.dist-info → holidays-0.64.dist-info}/METADATA +22 -17
  94. {holidays-0.62.dist-info → holidays-0.64.dist-info}/RECORD +97 -67
  95. {holidays-0.62.dist-info → holidays-0.64.dist-info}/WHEEL +1 -1
  96. {holidays-0.62.dist-info → holidays-0.64.dist-info}/LICENSE +0 -0
  97. {holidays-0.62.dist-info → holidays-0.64.dist-info}/top_level.txt +0 -0
@@ -48,27 +48,25 @@ class Turkey(HolidayBase, InternationalHolidays, IslamicHolidays, StaticHolidays
48
48
  # New Year's Day.
49
49
  self._add_new_years_day(tr("Yılbaşı"))
50
50
 
51
- name = (
51
+ self._add_holiday_apr_23(
52
52
  # National Sovereignty and Children's Day.
53
53
  tr("Ulusal Egemenlik ve Çocuk Bayramı")
54
54
  if self._year >= 1981
55
55
  # National Sovereignty Day.
56
56
  else tr("Ulusal Egemenlik Bayramı")
57
57
  )
58
- self._add_holiday_apr_23(name)
59
58
 
60
59
  if self._year >= 2009:
61
60
  # Labour and Solidarity Day.
62
61
  self._add_labor_day(tr("Emek ve Dayanışma Günü"))
63
62
 
64
- name = (
63
+ self._add_holiday_may_19(
65
64
  # Commemoration of Atatürk, Youth and Sports Day.
66
65
  tr("Atatürk'ü Anma, Gençlik ve Spor Bayramı")
67
66
  if self._year >= 1981
68
67
  # Youth and Sports Day.
69
68
  else tr("Gençlik ve Spor Bayramı")
70
69
  )
71
- self._add_holiday_may_19(name)
72
70
 
73
71
  if 1963 <= self._year <= 1980:
74
72
  # Freedom and Constitution Day.
@@ -25,8 +25,9 @@ class Ukraine(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
25
25
  """
26
26
  Ukraine holidays.
27
27
 
28
- Current holidays list:
29
- - https://zakon1.rada.gov.ua/laws/show/322-08/paran454#n454
28
+ References:
29
+ - Labor Code of Ukraine, Art. 73 `<https://zakon1.rada.gov.ua/laws/show/322-08/paran454#n454>`_
30
+ - https://zakon.rada.gov.ua/laws/show/585-12
30
31
  """
31
32
 
32
33
  country = "UA"
@@ -34,7 +35,7 @@ class Ukraine(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
34
35
  # %s (observed).
35
36
  observed_label = tr("%s (вихідний)")
36
37
  supported_categories = (PUBLIC, WORKDAY)
37
- supported_languages = ("ar", "en_US", "uk")
38
+ supported_languages = ("ar", "en_US", "th", "uk")
38
39
  # The current set of holidays came into force in 1991.
39
40
  start_year = 1991
40
41
 
@@ -71,10 +72,9 @@ class Ukraine(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
71
72
  # International Women's Day.
72
73
  dts_observed.add(self._add_womens_day(tr("Міжнародний жіночий день")))
73
74
 
74
- if (self._year >= 2022) == is_martial_law:
75
- if self._year >= 1992:
76
- # Easter Sunday (Pascha).
77
- dts_observed.add(self._add_easter_sunday(tr("Великдень (Пасха)")))
75
+ if (self._year >= 2022) is is_martial_law:
76
+ # Easter Sunday (Pascha).
77
+ dts_observed.add(self._add_easter_sunday(tr("Великдень (Пасха)")))
78
78
 
79
79
  # Holy Trinity Day.
80
80
  dts_observed.add(self._add_whit_sunday(tr("Трійця")))
@@ -169,6 +169,7 @@ class UKR(Ukraine):
169
169
  class UkraineStaticHolidays:
170
170
  """
171
171
  Substituted holidays:
172
+ - `1991 <https://zakon.rada.gov.ua/laws/show/60-91-%D0%BF>`_
172
173
  - `1992 [1] <https://zakon.rada.gov.ua/laws/show/202-92-%D0%BF>`_
173
174
  - `1992 [2] <https://zakon.rada.gov.ua/laws/show/377-91-%D0%BF>`_
174
175
  - `1993 [1] <https://zakon.rada.gov.ua/laws/show/563-93-%D0%BF>`_
@@ -178,8 +179,9 @@ class UkraineStaticHolidays:
178
179
  - `1995 [2] <https://zakon.rada.gov.ua/laws/show/634-95-%D0%BF>`_
179
180
  - `1995 [3] <https://zakon.rada.gov.ua/laws/show/266-95-%D0%BF>`_
180
181
  - `1996 <https://zakon.rada.gov.ua/laws/show/424-96-%D0%BF>`_
181
- - `1997[1] <https://zakon.rada.gov.ua/laws/show/326-97-%D0%BF>`_
182
- - `1997[2] <https://zakon.rada.gov.ua/laws/show/1547-96-%D0%BF>`_
182
+ - `1997 [1] <https://zakon.rada.gov.ua/laws/show/326-97-%D0%BF>`_
183
+ - `1997 [2] <https://zakon.rada.gov.ua/laws/show/1547-96-%D0%BF>`_
184
+ - `1998 <https://zakon.rada.gov.ua/laws/show/1404-97-%D0%BF>`_,
183
185
  - `1999 [1] <https://zakon.rada.gov.ua/laws/show/1433-99-%D0%BF>`_,
184
186
  - `1999 [2] <https://zakon.rada.gov.ua/laws/show/558-99-%D0%BF>`_,
185
187
  - `1999 [3] <https://zakon.rada.gov.ua/laws/show/2070-98-%D0%BF>`_
@@ -221,6 +223,11 @@ class UkraineStaticHolidays:
221
223
  # Day off (substituted from %s).
222
224
  substituted_label = tr("Вихідний день (перенесено з %s)")
223
225
  special_public_holidays = {
226
+ 1991: (
227
+ (MAY, 3, MAY, 5),
228
+ (MAY, 10, MAY, 12),
229
+ (JUL, 15, JUL, 13),
230
+ ),
224
231
  1992: (
225
232
  (JAN, 6, JAN, 4),
226
233
  (APR, 27, MAY, 16),
@@ -244,9 +251,11 @@ class UkraineStaticHolidays:
244
251
  1997: (
245
252
  (JAN, 2, DEC, 28, 1996),
246
253
  (JAN, 6, JAN, 4),
254
+ (JAN, 8, JAN, 11),
247
255
  (APR, 29, APR, 19),
248
256
  (APR, 30, MAY, 17),
249
257
  ),
258
+ 1998: (JAN, 2, JAN, 4),
250
259
  1999: (
251
260
  (JAN, 8, JAN, 10),
252
261
  (APR, 12, APR, 24),
@@ -324,7 +333,7 @@ class UkraineStaticHolidays:
324
333
  ),
325
334
  2012: (
326
335
  (MAR, 9, MAR, 3),
327
- (APR, 20, APR, 28),
336
+ (APR, 30, APR, 28),
328
337
  (JUN, 29, JUL, 7),
329
338
  (DEC, 31, DEC, 29),
330
339
  ),
@@ -214,25 +214,29 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
214
214
  self._add_holiday_feb_22(name)
215
215
 
216
216
  # Columbus Day
217
- if self._year >= 1937 and self.subdiv in {
218
- "AS",
219
- "AZ",
220
- "CT",
221
- "GA",
222
- "ID",
223
- "IL",
224
- "IN",
225
- "MA",
226
- "MD",
227
- "MO",
228
- "MT",
229
- "NJ",
230
- "NY",
231
- "OH",
232
- "PA",
233
- "UT",
234
- "WV",
235
- }:
217
+ if self._year >= 1937 and (
218
+ self.subdiv is None
219
+ or self.subdiv
220
+ in {
221
+ "AS",
222
+ "AZ",
223
+ "CT",
224
+ "GA",
225
+ "ID",
226
+ "IL",
227
+ "IN",
228
+ "MA",
229
+ "MD",
230
+ "MO",
231
+ "MT",
232
+ "NJ",
233
+ "NY",
234
+ "OH",
235
+ "PA",
236
+ "UT",
237
+ "WV",
238
+ }
239
+ ):
236
240
  name = "Columbus Day"
237
241
  if self._year >= 1971:
238
242
  self._add_holiday_2nd_mon_of_oct(name)
@@ -293,12 +297,11 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
293
297
  def _populate_subdiv_ar_public_holidays(self):
294
298
  # Martin Luther King Jr. Day
295
299
  if self._year >= 1986:
296
- name = (
300
+ self._add_holiday_3rd_mon_of_jan(
297
301
  "Martin Luther King Jr. Day"
298
302
  if self._year >= 2018
299
303
  else "Dr. Martin Luther King Jr. and Robert E. Lee's Birthdays"
300
304
  )
301
- self._add_holiday_3rd_mon_of_jan(name)
302
305
 
303
306
  # Washington's Birthday
304
307
  name = "George Washington's Birthday and Daisy Gatson Bates Day"
@@ -479,7 +482,7 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
479
482
  self._add_holiday_3rd_mon_of_jan(
480
483
  "Martin Luther King Jr. / Idaho Human Rights Day"
481
484
  if self._year >= 2006
482
- else "Martin Luther King Jr. Day",
485
+ else "Martin Luther King Jr. Day"
483
486
  )
484
487
 
485
488
  def _populate_subdiv_il_public_holidays(self):
@@ -637,7 +640,7 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
637
640
  # Martin Luther King Jr. Day
638
641
  if self._year >= 1986:
639
642
  self._add_holiday_3rd_mon_of_jan(
640
- "Dr. Martin Luther King Jr. and Robert E. Lee's Birthdays",
643
+ "Dr. Martin Luther King Jr. and Robert E. Lee's Birthdays"
641
644
  )
642
645
 
643
646
  # Confederate Memorial Day
@@ -134,14 +134,15 @@ class Uruguay(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
134
134
  self._move_holiday(dt)
135
135
 
136
136
  if self._year <= 1932 or self._year >= 1937:
137
- name = (
138
- # Cultural Diversity Day.
139
- tr("Día de la Diversidad Cultural")
140
- if self._year >= 2014
141
- # Columbus Day.
142
- else tr("Día de la Raza")
137
+ self._move_holiday(
138
+ self._add_columbus_day(
139
+ # Cultural Diversity Day.
140
+ tr("Día de la Diversidad Cultural")
141
+ if self._year >= 2014
142
+ # Columbus Day.
143
+ else tr("Día de la Raza")
144
+ )
143
145
  )
144
- self._move_holiday(self._add_columbus_day(name))
145
146
 
146
147
  if self._year <= 1932 or self._year >= 1938:
147
148
  # All Souls' Day.
@@ -13,6 +13,6 @@
13
13
  # flake8: noqa: F401
14
14
 
15
15
  from .brasil_bolsa_balcao import BrasilBolsaBalcao, BVMF, B3
16
- from .european_central_bank import EuropeanCentralBank, ECB, TAR
16
+ from .european_central_bank import EuropeanCentralBank, XECB, ECB, TAR
17
17
  from .ice_futures_europe import ICEFuturesEurope, IFEU
18
- from .ny_stock_exchange import NewYorkStockExchange, NYSE, XNYS
18
+ from .ny_stock_exchange import NewYorkStockExchange, XNYS, NYSE
@@ -19,11 +19,12 @@ class EuropeanCentralBank(HolidayBase, ChristianHolidays, InternationalHolidays)
19
19
  """
20
20
  References:
21
21
  - https://en.wikipedia.org/wiki/TARGET2
22
+ - https://www.ecb.europa.eu/ecb/contacts/working-hours/html/index.en.html
22
23
  - https://www.ecb.europa.eu/press/pr/date/1999/html/pr990715_1.en.html
23
24
  - https://www.ecb.europa.eu/press/pr/date/2000/html/pr001214_4.en.html
24
25
  """
25
26
 
26
- market = "ECB"
27
+ market = "XECB"
27
28
  start_year = 2000
28
29
 
29
30
  def __init__(self, *args, **kwargs):
@@ -36,12 +37,18 @@ class EuropeanCentralBank(HolidayBase, ChristianHolidays, InternationalHolidays)
36
37
  self._add_new_years_day("New Year's Day")
37
38
 
38
39
  self._add_good_friday("Good Friday")
40
+
39
41
  self._add_easter_monday("Easter Monday")
40
42
 
41
- self._add_labor_day("1 May (Labour Day)")
43
+ self._add_labor_day("Labour Day")
42
44
 
43
45
  self._add_christmas_day("Christmas Day")
44
- self._add_christmas_day_two("26 December")
46
+
47
+ self._add_christmas_day_two("Christmas Holiday")
48
+
49
+
50
+ class XECB(EuropeanCentralBank):
51
+ pass
45
52
 
46
53
 
47
54
  class ECB(EuropeanCentralBank):
@@ -43,7 +43,7 @@ class NewYorkStockExchange(
43
43
  - https://web.archive.org/web/20211101162021/https://www.nyse.com/markets/hours-calendars
44
44
  """
45
45
 
46
- market = "NYSE"
46
+ market = "XNYS"
47
47
  observed_label = "%s (observed)"
48
48
  start_year = 1863
49
49
 
@@ -147,22 +147,58 @@ class NYSE(NewYorkStockExchange):
147
147
 
148
148
 
149
149
  class NewYorkStockExchangeStaticHolidays:
150
+ """
151
+ References:
152
+ - https://guides.loc.gov/presidents-portraits/chronological
153
+ - https://www.presidency.ucsb.edu/documents/proclamation-3561-national-day-mourning-for-president-kennedy
154
+ """
155
+
156
+ # Blizzard of 1888.
157
+ name_blizard_1888 = "Blizzard of 1888"
158
+
159
+ # Centennial of George Washington's Inauguration.
160
+ name_george_washington_centennial = "Centennial of George Washington's Inauguration"
161
+
162
+ # Columbian Celebration.
163
+ name_columbian_celebration = "Columbian Celebration"
164
+
165
+ # Heatless Day.
166
+ name_heatless_day = "Heatless Day"
167
+
168
+ # Catch Up Day.
169
+ name_catch_up_day = "Catch Up Day"
170
+
171
+ # Special Bank Holiday.
172
+ name_special_bank_holiday = "Special Bank Holiday"
173
+
174
+ # V-J Day (WWII).
175
+ name_vj_day_wwii = "V-J Day (WWII)"
176
+
177
+ # Christmas Eve.
178
+ name_christmas_eve = "Christmas Eve"
179
+
180
+ # Closed for Sept 11, 2001 Attacks.
181
+ name_sept11_attacks = "Closed for Sept 11, 2001 Attacks"
182
+
183
+ # Hurricane Sandy.
184
+ name_hurricane_sandy = "Hurricane Sandy"
185
+
150
186
  special_public_holidays = {
151
187
  1888: (
152
- (MAR, 12, "Blizzard of 1888"),
153
- (MAR, 13, "Blizzard of 1888"),
188
+ (MAR, 12, name_blizard_1888),
189
+ (MAR, 13, name_blizard_1888),
154
190
  (NOV, 30, "Thanksgiving Friday 1888"),
155
191
  ),
156
192
  1889: (
157
- (APR, 29, "Centennial of Washington Inauguration"),
158
- (APR, 30, "Centennial of Washington Inauguration"),
159
- (MAY, 1, "Centennial of Washington Inauguration"),
193
+ (APR, 29, name_george_washington_centennial),
194
+ (APR, 30, name_george_washington_centennial),
195
+ (MAY, 1, name_george_washington_centennial),
160
196
  ),
161
197
  1892: (
162
- (OCT, 12, "Columbian Celebration"),
163
- (OCT, 21, "Columbian Celebration"),
198
+ (OCT, 12, name_columbian_celebration),
199
+ (OCT, 21, name_columbian_celebration),
164
200
  ),
165
- 1893: (APR, 27, "Columbian Celebration"),
201
+ 1893: (APR, 27, name_columbian_celebration),
166
202
  1897: (APR, 27, "Grant's Birthday"),
167
203
  1898: (MAY, 4, "Charter Day"),
168
204
  1899: (
@@ -170,17 +206,17 @@ class NewYorkStockExchangeStaticHolidays:
170
206
  (JUL, 3, "Monday before Independence Day"),
171
207
  (SEP, 29, "Admiral Dewey Celebration"),
172
208
  ),
173
- 1900: (DEC, 24, "Christmas Eve"),
209
+ 1900: (DEC, 24, name_christmas_eve),
174
210
  1901: (
175
211
  (JUL, 5, "Friday after Independence Day"),
176
- (SEP, 19, "Funeral of President McKinley"),
212
+ (SEP, 19, "National Day of Mourning for President WIlliam McKinley"),
177
213
  ),
178
214
  1903: (APR, 22, "Opening of new NYSE building"),
179
215
  1917: (JUN, 5, "Draft Registration Day"),
180
216
  1918: (
181
- (JAN, 28, "Heatless Day"),
182
- (FEB, 4, "Heatless Day"),
183
- (FEB, 11, "Heatless Day"),
217
+ (JAN, 28, name_heatless_day),
218
+ (FEB, 4, name_heatless_day),
219
+ (FEB, 11, name_heatless_day),
184
220
  (SEP, 12, "Draft Registration Day"),
185
221
  (NOV, 11, "Armistice Day"),
186
222
  ),
@@ -191,58 +227,59 @@ class NewYorkStockExchangeStaticHolidays:
191
227
  ),
192
228
  1923: (
193
229
  (AUG, 3, "Death of President Warren G. Harding"),
194
- (AUG, 10, "Funeral of President Warren G. Harding"),
230
+ (AUG, 10, "National Day of Mourning for President Warren G. Harding"),
195
231
  ),
196
232
  1927: (JUN, 13, "Parade for Colonel Charles Lindbergh"),
197
233
  1929: (
198
- (NOV, 1, "Catch Up Day"),
199
- (NOV, 29, "Catch Up Day"),
234
+ (NOV, 1, name_catch_up_day),
235
+ (NOV, 29, name_catch_up_day),
200
236
  ),
201
237
  1933: (
202
- (MAR, 6, "Special Bank Holiday"),
203
- (MAR, 7, "Special Bank Holiday"),
204
- (MAR, 8, "Special Bank Holiday"),
205
- (MAR, 9, "Special Bank Holiday"),
206
- (MAR, 10, "Special Bank Holiday"),
207
- (MAR, 13, "Special Bank Holiday"),
208
- (MAR, 14, "Special Bank Holiday"),
238
+ (MAR, 6, name_special_bank_holiday),
239
+ (MAR, 7, name_special_bank_holiday),
240
+ (MAR, 8, name_special_bank_holiday),
241
+ (MAR, 9, name_special_bank_holiday),
242
+ (MAR, 10, name_special_bank_holiday),
243
+ (MAR, 13, name_special_bank_holiday),
244
+ (MAR, 14, name_special_bank_holiday),
209
245
  ),
210
246
  1945: (
211
- (AUG, 15, "V-J Day (WWII)"),
212
- (AUG, 16, "V-J Day (WWII)"),
213
- (DEC, 24, "Christmas Eve"),
247
+ (AUG, 15, name_vj_day_wwii),
248
+ (AUG, 16, name_vj_day_wwii),
249
+ (DEC, 24, name_christmas_eve),
214
250
  ),
215
- 1954: (DEC, 24, "Christmas Eve"),
216
- 1956: (DEC, 24, "Christmas Eve"),
251
+ 1954: (DEC, 24, name_christmas_eve),
252
+ 1956: (DEC, 24, name_christmas_eve),
217
253
  1958: (DEC, 26, "Day after Christmas"),
218
254
  1961: (MAY, 29, "Day before Decoration Day"),
219
- 1963: (NOV, 25, "Funeral of President John F. Kennedy"),
220
- 1965: (DEC, 24, "Christmas Eve"),
255
+ 1963: (NOV, 25, "National Day of Mourning for President John F. Kennedy"),
256
+ 1965: (DEC, 24, name_christmas_eve),
221
257
  1968: (
222
- (APR, 9, "Day of Mourning for Martin Luther King Jr."),
258
+ (APR, 9, "National Day of Mourning for Martin Luther King Jr."),
223
259
  (JUL, 5, "Day after Independence Day"),
224
260
  ),
225
261
  1969: (
226
262
  (FEB, 10, "Heavy Snow"),
227
- (MAR, 31, "Funeral of President Dwight D. Eisenhower"),
263
+ (MAR, 31, "National Day of Mourning for former President Dwight D. Eisenhower"),
228
264
  (JUL, 21, "National Participation in Lunar Exploration"),
229
265
  ),
230
- 1972: (DEC, 28, "Funeral for President Harry S. Truman"),
231
- 1973: (JAN, 25, "Funeral for President Lyndon B. Johnson"),
266
+ 1972: (DEC, 28, "National Day of Mourning for former President Harry S. Truman"),
267
+ 1973: (JAN, 25, "National Day of Mourning for former President Lyndon B. Johnson"),
232
268
  1977: (JUL, 14, "Blackout in New York City"),
233
269
  1985: (SEP, 27, "Hurricane Gloria"),
234
- 1994: (APR, 27, "Funeral for President Richard M. Nixon"),
270
+ 1994: (APR, 27, "National Day of Mourning for former President Richard M. Nixon"),
235
271
  2001: (
236
- (SEP, 11, "Closed for Sept 11, 2001 Attacks"),
237
- (SEP, 12, "Closed for Sept 11, 2001 Attacks"),
238
- (SEP, 13, "Closed for Sept 11, 2001 Attacks"),
239
- (SEP, 14, "Closed for Sept 11, 2001 Attacks"),
272
+ (SEP, 11, name_sept11_attacks),
273
+ (SEP, 12, name_sept11_attacks),
274
+ (SEP, 13, name_sept11_attacks),
275
+ (SEP, 14, name_sept11_attacks),
240
276
  ),
241
- 2004: (JUN, 11, "Day of Mourning for President Ronald W. Reagan"),
242
- 2007: (JAN, 2, "Day of Mourning for President Gerald R. Ford"),
277
+ 2004: (JUN, 11, "National Day of Mourning for former President Ronald Reagan"),
278
+ 2007: (JAN, 2, "National Day of Mourning for former President Gerald R. Ford"),
243
279
  2012: (
244
- (OCT, 29, "Hurricane Sandy"),
245
- (OCT, 30, "Hurricane Sandy"),
280
+ (OCT, 29, name_hurricane_sandy),
281
+ (OCT, 30, name_hurricane_sandy),
246
282
  ),
247
- 2018: (DEC, 5, "Day of Mourning for President George H.W. Bush"),
283
+ 2018: (DEC, 5, "National Day of Mourning for former President George H. W. Bush"),
284
+ 2025: (JAN, 9, "National Day of Mourning for former President Jimmy Carter"),
248
285
  }
@@ -17,6 +17,7 @@ from holidays.groups.chinese import ChineseCalendarHolidays
17
17
  from holidays.groups.christian import ChristianHolidays
18
18
  from holidays.groups.custom import StaticHolidays
19
19
  from holidays.groups.eastern import EasternCalendarHolidays
20
+ from holidays.groups.hebrew import HebrewCalendarHolidays
20
21
  from holidays.groups.hindu import HinduCalendarHolidays
21
22
  from holidays.groups.international import InternationalHolidays
22
23
  from holidays.groups.islamic import IslamicHolidays
@@ -110,7 +110,9 @@ class ChristianHolidays:
110
110
 
111
111
  All Souls' Day is a day of prayer and remembrance for the faithful
112
112
  departed, observed by certain Christian denominations on 2 November.
113
+ In Belarussian tradition it is called Dziady.
113
114
  https://en.wikipedia.org/wiki/All_Souls%27_Day
115
+ https://en.wikipedia.org/wiki/Dziady
114
116
  """
115
117
  return self._add_holiday_nov_2(name)
116
118
 
holidays/groups/custom.py CHANGED
@@ -10,6 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from datetime import date
14
+
15
+ from holidays.helpers import _normalize_tuple
16
+
13
17
 
14
18
  class StaticHolidays:
15
19
  """Helper class for special and substituted holidays support.
@@ -33,3 +37,11 @@ class StaticHolidays:
33
37
  ):
34
38
  setattr(self, attribute_name, value)
35
39
  self.has_substituted_holidays = True
40
+
41
+ # Populate substituted holidays from adjacent years.
42
+ self.weekend_workdays = set()
43
+ for special_public_holidays in getattr(self, "special_public_holidays", {}).values():
44
+ for special_public_holiday in _normalize_tuple(special_public_holidays):
45
+ if len(special_public_holiday) == 5: # The fifth element is the year.
46
+ _, _, from_month, from_day, from_year = special_public_holiday
47
+ self.weekend_workdays.add(date(from_year, from_month, from_day))
@@ -0,0 +1,151 @@
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 AUTHORS 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 collections.abc import Iterable
14
+ from datetime import date
15
+ from typing import Optional, Union
16
+
17
+ from holidays.calendars import _HebrewLunisolar
18
+ from holidays.calendars.gregorian import _timedelta
19
+
20
+
21
+ class HebrewCalendarHolidays:
22
+ """
23
+ Hebrew lunisolar calendar holidays.
24
+ """
25
+
26
+ def __init__(self) -> None:
27
+ self._hebrew_calendar = _HebrewLunisolar()
28
+
29
+ def _add_hebrew_calendar_holiday(
30
+ self, name: str, hol_date: date, days_delta: Union[int, Iterable[int]] = 0
31
+ ) -> set[date]:
32
+ added_dates = set()
33
+ for delta in (days_delta,) if isinstance(days_delta, int) else days_delta:
34
+ if dt := self._add_holiday(name, _timedelta(hol_date, delta)):
35
+ added_dates.add(dt)
36
+ return added_dates
37
+
38
+ def _add_hanukkah(
39
+ self, name: str, days_delta: Union[int, Iterable[int]] = 0
40
+ ) -> set[Optional[date]]:
41
+ """
42
+ Add Hanukkah.
43
+ In some Gregorian years, there may be two Hanukkah dates.
44
+
45
+ Hanukkah is a Jewish festival commemorating the recovery of Jerusalem
46
+ and subsequent rededication of the Second Temple.
47
+ https://en.wikipedia.org/wiki/Hanukkah
48
+ """
49
+ dts = self._hebrew_calendar.hanukkah_date(self._year)
50
+ for dt in dts:
51
+ self._add_hebrew_calendar_holiday(name, dt, days_delta) # type: ignore[arg-type]
52
+ return dts
53
+
54
+ def _add_lag_baomer(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
55
+ """
56
+ Add Lag BaOmer.
57
+
58
+ Lag BaOmer, also Lag B'Omer or Lag LaOmer, is a Jewish religious holiday celebrated
59
+ on the 33rd day of the Counting of the Omer, which occurs on the 18th day of
60
+ the Hebrew month of Iyar.
61
+ https://en.wikipedia.org/wiki/Lag_BaOmer
62
+ """
63
+ return self._add_hebrew_calendar_holiday(
64
+ name,
65
+ self._hebrew_calendar.lag_baomer_date(self._year), # type: ignore[arg-type]
66
+ days_delta,
67
+ )
68
+
69
+ def _add_passover(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
70
+ """
71
+ Add Passover.
72
+
73
+ Passover, also called Pesach, is a major Jewish holiday and one of the Three Pilgrimage
74
+ Festivals. It celebrates the Exodus of the Israelites from slavery in Egypt.
75
+ https://en.wikipedia.org/wiki/Passover
76
+ """
77
+ return self._add_hebrew_calendar_holiday(
78
+ name,
79
+ self._hebrew_calendar.passover_date(self._year), # type: ignore[arg-type]
80
+ days_delta,
81
+ )
82
+
83
+ def _add_purim(self, name: str) -> set[date]:
84
+ """
85
+ Add Purim.
86
+
87
+ Purim is a Jewish holiday that commemorates the saving of the Jewish people
88
+ from annihilation at the hands of an official of the Achaemenid Empire named Haman,
89
+ as it is recounted in the Book of Esther.
90
+ https://en.wikipedia.org/wiki/Purim
91
+ """
92
+ return self._add_hebrew_calendar_holiday(
93
+ name,
94
+ self._hebrew_calendar.purim_date(self._year), # type: ignore[arg-type]
95
+ )
96
+
97
+ def _add_rosh_hashanah(
98
+ self, name: str, days_delta: Union[int, Iterable[int]] = 0
99
+ ) -> set[date]:
100
+ """
101
+ Add Rosh Hashanah.
102
+
103
+ Rosh Hashanah is the New Year in Judaism.
104
+ https://en.wikipedia.org/wiki/Rosh_Hashanah
105
+ """
106
+ return self._add_hebrew_calendar_holiday(
107
+ name,
108
+ self._hebrew_calendar.rosh_hashanah_date(self._year), # type: ignore[arg-type]
109
+ days_delta,
110
+ )
111
+
112
+ def _add_shavuot(self, name: str) -> set[date]:
113
+ """
114
+ Add Shavuot.
115
+
116
+ Shavuot, or Shvues, is a Jewish holiday, one of the biblically ordained
117
+ Three Pilgrimage Festivals. It occurs on the sixth day of the Hebrew month of Sivan.
118
+ https://en.wikipedia.org/wiki/Shavuot
119
+ """
120
+ return self._add_hebrew_calendar_holiday(
121
+ name,
122
+ self._hebrew_calendar.shavuot_date(self._year), # type: ignore[arg-type]
123
+ )
124
+
125
+ def _add_sukkot(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
126
+ """
127
+ Add Sukkot.
128
+
129
+ Sukkot, also known as the Feast of Tabernacles or Feast of Booths, is a Torah-commanded
130
+ holiday celebrated for seven days, beginning on the 15th day of the month of Tishrei.
131
+ https://en.wikipedia.org/wiki/Sukkot
132
+ """
133
+ return self._add_hebrew_calendar_holiday(
134
+ name,
135
+ self._hebrew_calendar.sukkot_date(self._year), # type: ignore[arg-type]
136
+ days_delta,
137
+ )
138
+
139
+ def _add_yom_kippur(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
140
+ """
141
+ Add Yom Kippur.
142
+
143
+ Yom Kippur (Day of Atonement) is the holiest day of the year in Judaism.
144
+ It occurs annually on the 10th of Tishrei.
145
+ https://en.wikipedia.org/wiki/Yom_Kippur
146
+ """
147
+ return self._add_hebrew_calendar_holiday(
148
+ name,
149
+ self._hebrew_calendar.yom_kippur_date(self._year), # type: ignore[arg-type]
150
+ days_delta,
151
+ )