holidays 0.81__py3-none-any.whl → 0.82__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.
- holidays/calendars/__init__.py +1 -0
- holidays/calendars/burmese.py +319 -0
- holidays/calendars/hebrew.py +2 -2
- holidays/calendars/thai.py +49 -2
- holidays/countries/__init__.py +10 -0
- holidays/countries/afghanistan.py +7 -5
- holidays/countries/algeria.py +89 -24
- holidays/countries/antarctica.py +58 -0
- holidays/countries/bouvet_island.py +31 -0
- holidays/countries/brazil.py +1 -1
- holidays/countries/british_indian_ocean_territory.py +31 -0
- holidays/countries/bulgaria.py +6 -1
- holidays/countries/chile.py +9 -8
- holidays/countries/cuba.py +3 -4
- holidays/countries/djibouti.py +1 -1
- holidays/countries/heard_island_and_mcdonald_islands.py +31 -0
- holidays/countries/hungary.py +4 -5
- holidays/countries/india.py +6 -0
- holidays/countries/japan.py +22 -18
- holidays/countries/jordan.py +6 -3
- holidays/countries/kuwait.py +6 -3
- holidays/countries/malaysia.py +14 -3
- holidays/countries/myanmar.py +195 -0
- holidays/countries/north_korea.py +161 -0
- holidays/countries/norway.py +23 -8
- holidays/countries/oman.py +6 -2
- holidays/countries/paraguay.py +70 -23
- holidays/countries/portugal.py +5 -6
- holidays/countries/qatar.py +5 -2
- holidays/countries/rwanda.py +6 -1
- holidays/countries/saudi_arabia.py +6 -5
- holidays/countries/serbia.py +5 -0
- holidays/countries/south_africa.py +96 -53
- holidays/countries/south_korea.py +6 -1
- holidays/countries/spain.py +4 -4
- holidays/countries/sudan.py +6 -3
- holidays/countries/switzerland.py +169 -3
- holidays/countries/taiwan.py +22 -2
- holidays/countries/tanzania.py +6 -1
- holidays/countries/thailand.py +21 -0
- holidays/countries/tonga.py +6 -1
- holidays/countries/trinidad_and_tobago.py +6 -1
- holidays/countries/united_arab_emirates.py +9 -2
- holidays/countries/united_states.py +16 -0
- holidays/countries/uruguay.py +6 -1
- holidays/countries/vietnam.py +6 -1
- holidays/countries/yemen.py +6 -3
- holidays/groups/__init__.py +1 -0
- holidays/groups/balinese_saka.py +1 -1
- holidays/groups/buddhist.py +1 -1
- holidays/groups/burmese.py +273 -0
- holidays/groups/chinese.py +25 -0
- holidays/groups/custom.py +8 -2
- holidays/groups/eastern.py +24 -0
- holidays/groups/hebrew.py +16 -14
- holidays/groups/hindu.py +15 -13
- holidays/groups/islamic.py +43 -48
- holidays/groups/mongolian.py +1 -1
- holidays/groups/sinhala.py +4 -9
- holidays/groups/tibetan.py +3 -4
- holidays/holiday_base.py +5 -4
- holidays/ical.py +6 -4
- holidays/locale/ar/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KP.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/PY.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
- holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/es/LC_MESSAGES/PY.mo +0 -0
- holidays/locale/fr/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/ja/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/ko_KP/LC_MESSAGES/KP.mo +0 -0
- holidays/locale/my/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/pt_BR/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/th/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/th/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/th/LC_MESSAGES/US.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/PY.mo +0 -0
- holidays/no_holiday_base.py +21 -0
- holidays/registry.py +6 -0
- holidays/utils.py +5 -5
- holidays/version.py +1 -1
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/METADATA +47 -5
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/RECORD +98 -83
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/licenses/CONTRIBUTORS +2 -0
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/WHEEL +0 -0
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/top_level.txt +0 -0
holidays/groups/islamic.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
from collections.abc import Iterable
|
|
14
14
|
from datetime import date
|
|
15
15
|
|
|
16
|
-
from holidays.calendars import _IslamicLunar
|
|
16
|
+
from holidays.calendars.islamic import _IslamicLunar
|
|
17
17
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
18
18
|
|
|
19
19
|
|
|
@@ -35,7 +35,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
35
35
|
|
|
36
36
|
https://en.wikipedia.org/wiki/Ali_al-Rida
|
|
37
37
|
"""
|
|
38
|
-
return self.
|
|
38
|
+
return self._add_islamic_calendar_holiday_set(
|
|
39
39
|
name, self._islamic_calendar.ali_al_rida_death_dates(self._year)
|
|
40
40
|
)
|
|
41
41
|
|
|
@@ -45,7 +45,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
45
45
|
|
|
46
46
|
https://en.wikipedia.org/wiki/Ali
|
|
47
47
|
"""
|
|
48
|
-
return self.
|
|
48
|
+
return self._add_islamic_calendar_holiday_set(
|
|
49
49
|
name, self._islamic_calendar.ali_birthday_dates(self._year)
|
|
50
50
|
)
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
55
55
|
|
|
56
56
|
https://en.wikipedia.org/wiki/Ali
|
|
57
57
|
"""
|
|
58
|
-
return self.
|
|
58
|
+
return self._add_islamic_calendar_holiday_set(
|
|
59
59
|
name, self._islamic_calendar.ali_death_dates(self._year)
|
|
60
60
|
)
|
|
61
61
|
|
|
@@ -65,7 +65,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
65
65
|
|
|
66
66
|
https://en.wikipedia.org/wiki/Arbaeen
|
|
67
67
|
"""
|
|
68
|
-
return self.
|
|
68
|
+
return self._add_islamic_calendar_holiday_set(
|
|
69
69
|
name, self._islamic_calendar.arbaeen_dates(self._year)
|
|
70
70
|
)
|
|
71
71
|
|
|
@@ -78,7 +78,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
78
78
|
Arafat.
|
|
79
79
|
https://en.wikipedia.org/wiki/Day_of_Arafah
|
|
80
80
|
"""
|
|
81
|
-
return self.
|
|
81
|
+
return self._add_islamic_calendar_holiday_set(
|
|
82
82
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=-1
|
|
83
83
|
)
|
|
84
84
|
|
|
@@ -90,7 +90,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
90
90
|
10th of Muharram, the first month of the Islamic calendar.
|
|
91
91
|
https://en.wikipedia.org/wiki/Ashura
|
|
92
92
|
"""
|
|
93
|
-
return self.
|
|
93
|
+
return self._add_islamic_calendar_holiday_set(
|
|
94
94
|
name, self._islamic_calendar.ashura_dates(self._year)
|
|
95
95
|
)
|
|
96
96
|
|
|
@@ -102,7 +102,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
102
102
|
10th of Muharram, the first month of the Islamic calendar.
|
|
103
103
|
https://en.wikipedia.org/wiki/Ashura
|
|
104
104
|
"""
|
|
105
|
-
return self.
|
|
105
|
+
return self._add_islamic_calendar_holiday_set(
|
|
106
106
|
name, self._islamic_calendar.ashura_dates(self._year), days_delta=-1
|
|
107
107
|
)
|
|
108
108
|
|
|
@@ -115,7 +115,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
115
115
|
to Allah's command.
|
|
116
116
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
117
117
|
"""
|
|
118
|
-
return self.
|
|
118
|
+
return self._add_islamic_calendar_holiday_set(
|
|
119
119
|
name, self._islamic_calendar.eid_al_adha_dates(self._year)
|
|
120
120
|
)
|
|
121
121
|
|
|
@@ -125,7 +125,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
125
125
|
|
|
126
126
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
127
127
|
"""
|
|
128
|
-
return self.
|
|
128
|
+
return self._add_islamic_calendar_holiday_set(
|
|
129
129
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+1
|
|
130
130
|
)
|
|
131
131
|
|
|
@@ -135,7 +135,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
135
135
|
|
|
136
136
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
137
137
|
"""
|
|
138
|
-
return self.
|
|
138
|
+
return self._add_islamic_calendar_holiday_set(
|
|
139
139
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+2
|
|
140
140
|
)
|
|
141
141
|
|
|
@@ -145,7 +145,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
145
145
|
|
|
146
146
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
147
147
|
"""
|
|
148
|
-
return self.
|
|
148
|
+
return self._add_islamic_calendar_holiday_set(
|
|
149
149
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+3
|
|
150
150
|
)
|
|
151
151
|
|
|
@@ -158,7 +158,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
158
158
|
dawn-to-sunset fasting of Ramadan.
|
|
159
159
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
160
160
|
"""
|
|
161
|
-
return self.
|
|
161
|
+
return self._add_islamic_calendar_holiday_set(
|
|
162
162
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year)
|
|
163
163
|
)
|
|
164
164
|
|
|
@@ -168,7 +168,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
168
168
|
|
|
169
169
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
170
170
|
"""
|
|
171
|
-
return self.
|
|
171
|
+
return self._add_islamic_calendar_holiday_set(
|
|
172
172
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+1
|
|
173
173
|
)
|
|
174
174
|
|
|
@@ -178,7 +178,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
178
178
|
|
|
179
179
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
180
180
|
"""
|
|
181
|
-
return self.
|
|
181
|
+
return self._add_islamic_calendar_holiday_set(
|
|
182
182
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+2
|
|
183
183
|
)
|
|
184
184
|
|
|
@@ -188,7 +188,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
188
188
|
|
|
189
189
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
190
190
|
"""
|
|
191
|
-
return self.
|
|
191
|
+
return self._add_islamic_calendar_holiday_set(
|
|
192
192
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+3
|
|
193
193
|
)
|
|
194
194
|
|
|
@@ -198,7 +198,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
198
198
|
|
|
199
199
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
200
200
|
"""
|
|
201
|
-
return self.
|
|
201
|
+
return self._add_islamic_calendar_holiday_set(
|
|
202
202
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=-1
|
|
203
203
|
)
|
|
204
204
|
|
|
@@ -208,7 +208,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
208
208
|
|
|
209
209
|
https://en.wikipedia.org/wiki/Eid_al-Ghadeer
|
|
210
210
|
"""
|
|
211
|
-
return self.
|
|
211
|
+
return self._add_islamic_calendar_holiday_set(
|
|
212
212
|
name, self._islamic_calendar.eid_al_ghadir_dates(self._year)
|
|
213
213
|
)
|
|
214
214
|
|
|
@@ -218,7 +218,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
218
218
|
|
|
219
219
|
https://en.wikipedia.org/wiki/Fatima
|
|
220
220
|
"""
|
|
221
|
-
return self.
|
|
221
|
+
return self._add_islamic_calendar_holiday_set(
|
|
222
222
|
name, self._islamic_calendar.fatima_death_dates(self._year)
|
|
223
223
|
)
|
|
224
224
|
|
|
@@ -228,7 +228,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
228
228
|
|
|
229
229
|
https://en.wikipedia.org/wiki/Grand_Magal_of_Touba
|
|
230
230
|
"""
|
|
231
|
-
return self.
|
|
231
|
+
return self._add_islamic_calendar_holiday_set(
|
|
232
232
|
name, self._islamic_calendar.grand_magal_of_touba_dates(self._year)
|
|
233
233
|
)
|
|
234
234
|
|
|
@@ -238,7 +238,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
238
238
|
|
|
239
239
|
https://web.archive.org/web/20241202170507/https://publicholidays.com.my/hari-hol-almarhum-sultan-iskandar/
|
|
240
240
|
"""
|
|
241
|
-
return self.
|
|
241
|
+
return self._add_islamic_calendar_holiday_set(
|
|
242
242
|
name, self._islamic_calendar.hari_hol_johor_dates(self._year)
|
|
243
243
|
)
|
|
244
244
|
|
|
@@ -248,7 +248,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
248
248
|
|
|
249
249
|
https://en.wikipedia.org/wiki/Hasan_al-Askari
|
|
250
250
|
"""
|
|
251
|
-
return self.
|
|
251
|
+
return self._add_islamic_calendar_holiday_set(
|
|
252
252
|
name, self._islamic_calendar.hasan_al_askari_death_dates(self._year)
|
|
253
253
|
)
|
|
254
254
|
|
|
@@ -258,7 +258,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
258
258
|
|
|
259
259
|
https://web.archive.org/web/20250323065556/https://decree.om/2022/rd20220088/
|
|
260
260
|
"""
|
|
261
|
-
return self.
|
|
261
|
+
return self._add_islamic_calendar_holiday_set(
|
|
262
262
|
name, self._islamic_calendar.ramadan_beginning_dates(self._year), days_delta=+28
|
|
263
263
|
)
|
|
264
264
|
|
|
@@ -268,12 +268,12 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
268
268
|
|
|
269
269
|
https://en.wikipedia.org/wiki/Muhammad_al-Mahdi
|
|
270
270
|
"""
|
|
271
|
-
return self.
|
|
271
|
+
return self._add_islamic_calendar_holiday_set(
|
|
272
272
|
name, self._islamic_calendar.imam_mahdi_birthday_dates(self._year)
|
|
273
273
|
)
|
|
274
274
|
|
|
275
|
-
def
|
|
276
|
-
self, name: str,
|
|
275
|
+
def _add_islamic_calendar_holiday_set(
|
|
276
|
+
self, name: str, dts_estimated: Iterable[tuple[date, bool]], days_delta: int = 0
|
|
277
277
|
) -> set[date]:
|
|
278
278
|
"""
|
|
279
279
|
Add lunar calendar holiday.
|
|
@@ -281,14 +281,9 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
281
281
|
Appends customizable estimation label at the end of holiday name if
|
|
282
282
|
holiday date is an estimation.
|
|
283
283
|
"""
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
name, dts, self._islamic_calendar_show_estimated, days_delta
|
|
288
|
-
):
|
|
289
|
-
added_dates.add(dt)
|
|
290
|
-
|
|
291
|
-
return added_dates
|
|
284
|
+
return self._add_eastern_calendar_holiday_set(
|
|
285
|
+
name, dts_estimated, self._islamic_calendar_show_estimated, days_delta
|
|
286
|
+
)
|
|
292
287
|
|
|
293
288
|
def _add_islamic_new_year_day(self, name) -> set[date]:
|
|
294
289
|
"""
|
|
@@ -300,7 +295,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
300
295
|
observed by most Muslims on the first day of the month of Muharram.
|
|
301
296
|
https://en.wikipedia.org/wiki/Islamic_New_Year
|
|
302
297
|
"""
|
|
303
|
-
return self.
|
|
298
|
+
return self._add_islamic_calendar_holiday_set(
|
|
304
299
|
name, self._islamic_calendar.hijri_new_year_dates(self._year)
|
|
305
300
|
)
|
|
306
301
|
|
|
@@ -311,7 +306,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
311
306
|
The Prophet's Ascension.
|
|
312
307
|
https://en.wikipedia.org/wiki/Isra'_and_Mi'raj
|
|
313
308
|
"""
|
|
314
|
-
return self.
|
|
309
|
+
return self._add_islamic_calendar_holiday_set(
|
|
315
310
|
name, self._islamic_calendar.isra_and_miraj_dates(self._year)
|
|
316
311
|
)
|
|
317
312
|
|
|
@@ -322,7 +317,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
322
317
|
The Night of Power.
|
|
323
318
|
https://en.wikipedia.org/wiki/Night_of_Power
|
|
324
319
|
"""
|
|
325
|
-
return self.
|
|
320
|
+
return self._add_islamic_calendar_holiday_set(
|
|
326
321
|
name, self._islamic_calendar.laylat_al_qadr_dates(self._year)
|
|
327
322
|
)
|
|
328
323
|
|
|
@@ -332,7 +327,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
332
327
|
|
|
333
328
|
https://en.wikipedia.org/wiki/Islam_in_Maldives
|
|
334
329
|
"""
|
|
335
|
-
return self.
|
|
330
|
+
return self._add_islamic_calendar_holiday_set(
|
|
336
331
|
name, self._islamic_calendar.maldives_embraced_islam_day_dates(self._year)
|
|
337
332
|
)
|
|
338
333
|
|
|
@@ -344,7 +339,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
344
339
|
Muhammad.
|
|
345
340
|
https://en.wikipedia.org/wiki/Mawlid
|
|
346
341
|
"""
|
|
347
|
-
return self.
|
|
342
|
+
return self._add_islamic_calendar_holiday_set(
|
|
348
343
|
name, self._islamic_calendar.mawlid_dates(self._year)
|
|
349
344
|
)
|
|
350
345
|
|
|
@@ -356,7 +351,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
356
351
|
Muhammad.
|
|
357
352
|
https://en.wikipedia.org/wiki/Mawlid
|
|
358
353
|
"""
|
|
359
|
-
return self.
|
|
354
|
+
return self._add_islamic_calendar_holiday_set(
|
|
360
355
|
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+1
|
|
361
356
|
)
|
|
362
357
|
|
|
@@ -369,7 +364,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
369
364
|
the holy Quran.
|
|
370
365
|
https://web.archive.org/web/20241012115752/https://zamzam.com/blog/nuzul-al-quran/
|
|
371
366
|
"""
|
|
372
|
-
return self.
|
|
367
|
+
return self._add_islamic_calendar_holiday_set(
|
|
373
368
|
name, self._islamic_calendar.nuzul_al_quran_dates(self._year)
|
|
374
369
|
)
|
|
375
370
|
|
|
@@ -386,7 +381,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
386
381
|
ritual akin to Christian baptism.
|
|
387
382
|
https://web.archive.org/web/20240722052111/https://www.officeholidays.com/holidays/mali/prophets-baptism
|
|
388
383
|
"""
|
|
389
|
-
return self.
|
|
384
|
+
return self._add_islamic_calendar_holiday_set(
|
|
390
385
|
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+7
|
|
391
386
|
)
|
|
392
387
|
|
|
@@ -396,7 +391,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
396
391
|
|
|
397
392
|
https://en.wikipedia.org/wiki/Hasan_ibn_Ali
|
|
398
393
|
"""
|
|
399
|
-
return self.
|
|
394
|
+
return self._add_islamic_calendar_holiday_set(
|
|
400
395
|
name, self._islamic_calendar.prophet_death_dates(self._year)
|
|
401
396
|
)
|
|
402
397
|
|
|
@@ -406,7 +401,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
406
401
|
|
|
407
402
|
https://en.wikipedia.org/wiki/Qaumee_Dhuvas_(Maldives_National_Day)
|
|
408
403
|
"""
|
|
409
|
-
return self.
|
|
404
|
+
return self._add_islamic_calendar_holiday_set(
|
|
410
405
|
name, self._islamic_calendar.quamee_dhuvas_dates(self._year)
|
|
411
406
|
)
|
|
412
407
|
|
|
@@ -418,7 +413,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
418
413
|
worldwide as a month of fasting, prayer, reflection, and community
|
|
419
414
|
https://en.wikipedia.org/wiki/Ramadan
|
|
420
415
|
"""
|
|
421
|
-
return self.
|
|
416
|
+
return self._add_islamic_calendar_holiday_set(
|
|
422
417
|
name, self._islamic_calendar.ramadan_beginning_dates(self._year)
|
|
423
418
|
)
|
|
424
419
|
|
|
@@ -428,7 +423,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
428
423
|
|
|
429
424
|
https://en.wikipedia.org/wiki/Ja'far_al-Sadiq
|
|
430
425
|
"""
|
|
431
|
-
return self.
|
|
426
|
+
return self._add_islamic_calendar_holiday_set(
|
|
432
427
|
name, self._islamic_calendar.sadiq_birthday_dates(self._year)
|
|
433
428
|
)
|
|
434
429
|
|
|
@@ -438,7 +433,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
438
433
|
|
|
439
434
|
https://en.wikipedia.org/wiki/Ja'far_al-Sadiq
|
|
440
435
|
"""
|
|
441
|
-
return self.
|
|
436
|
+
return self._add_islamic_calendar_holiday_set(
|
|
442
437
|
name, self._islamic_calendar.sadiq_death_dates(self._year)
|
|
443
438
|
)
|
|
444
439
|
|
|
@@ -448,6 +443,6 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
448
443
|
|
|
449
444
|
https://en.wikipedia.org/wiki/Tasua
|
|
450
445
|
"""
|
|
451
|
-
return self.
|
|
446
|
+
return self._add_islamic_calendar_holiday_set(
|
|
452
447
|
name, self._islamic_calendar.tasua_dates(self._year)
|
|
453
448
|
)
|
holidays/groups/mongolian.py
CHANGED
holidays/groups/sinhala.py
CHANGED
|
@@ -14,7 +14,7 @@ from collections.abc import Iterable
|
|
|
14
14
|
from datetime import date
|
|
15
15
|
from typing import Optional
|
|
16
16
|
|
|
17
|
-
from holidays.calendars import _SinhalaLunar
|
|
17
|
+
from holidays.calendars.sinhala import _SinhalaLunar
|
|
18
18
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
19
19
|
|
|
20
20
|
|
|
@@ -58,14 +58,9 @@ class SinhalaCalendarHolidays(EasternCalendarHolidays):
|
|
|
58
58
|
Adds customizable estimation label to holiday name if holiday date
|
|
59
59
|
is an estimation.
|
|
60
60
|
"""
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
name, dt_estimated, self._sinhala_calendar_show_estimated, days_delta=days_delta
|
|
65
|
-
):
|
|
66
|
-
added_dates.add(dt)
|
|
67
|
-
|
|
68
|
-
return added_dates
|
|
61
|
+
return self._add_eastern_calendar_holiday_set(
|
|
62
|
+
name, dts_estimated, self._sinhala_calendar_show_estimated, days_delta
|
|
63
|
+
)
|
|
69
64
|
|
|
70
65
|
def _add_bak_poya(self, name) -> Optional[date]:
|
|
71
66
|
"""
|
holidays/groups/tibetan.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
from datetime import date
|
|
14
14
|
from typing import Optional
|
|
15
15
|
|
|
16
|
-
from holidays.calendars import _TibetanLunisolar
|
|
16
|
+
from holidays.calendars.tibetan import _TibetanLunisolar
|
|
17
17
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
18
18
|
|
|
19
19
|
|
|
@@ -103,14 +103,13 @@ class TibetanCalendarHolidays(EasternCalendarHolidays):
|
|
|
103
103
|
name, self._tibetan_calendar.losar_date(self._year)
|
|
104
104
|
)
|
|
105
105
|
|
|
106
|
-
def _add_losar_day_two(self, name) ->
|
|
106
|
+
def _add_losar_day_two(self, name) -> Optional[date]:
|
|
107
107
|
"""
|
|
108
108
|
Add Losar Day Two.
|
|
109
109
|
"""
|
|
110
|
-
|
|
110
|
+
return self._add_tibetan_calendar_holiday(
|
|
111
111
|
name, self._tibetan_calendar.losar_date(self._year), days_delta=+1
|
|
112
112
|
)
|
|
113
|
-
return {dt} if dt is not None else set()
|
|
114
113
|
|
|
115
114
|
def _add_thimphu_drubchen_day(self, name) -> Optional[date]:
|
|
116
115
|
"""
|
holidays/holiday_base.py
CHANGED
|
@@ -841,6 +841,9 @@ class HolidayBase(dict[date, str]):
|
|
|
841
841
|
dt = dt if isinstance(dt, date) else date(self._year, *dt)
|
|
842
842
|
return dt.weekday() == weekday
|
|
843
843
|
|
|
844
|
+
def _get_weekend(self, dt: date) -> set[int]:
|
|
845
|
+
return self.weekend
|
|
846
|
+
|
|
844
847
|
def _is_monday(self, *args) -> bool:
|
|
845
848
|
return self._check_weekday(MON, *args)
|
|
846
849
|
|
|
@@ -869,7 +872,7 @@ class HolidayBase(dict[date, str]):
|
|
|
869
872
|
"""
|
|
870
873
|
dt = args if len(args) > 1 else args[0]
|
|
871
874
|
dt = dt if isinstance(dt, date) else date(self._year, *dt)
|
|
872
|
-
return dt.weekday() in self.
|
|
875
|
+
return dt.weekday() in self._get_weekend(dt)
|
|
873
876
|
|
|
874
877
|
def _populate(self, year: int) -> None:
|
|
875
878
|
"""This is a private method that populates (generates and adds) holidays
|
|
@@ -1145,9 +1148,7 @@ class HolidayBase(dict[date, str]):
|
|
|
1145
1148
|
Returns:
|
|
1146
1149
|
True if the date's week day is a weekend day, False otherwise.
|
|
1147
1150
|
"""
|
|
1148
|
-
|
|
1149
|
-
# `HolidayBase._is_weekend` method and perform the check directly instead.
|
|
1150
|
-
return self.__keytransform__(key).weekday() in self.weekend
|
|
1151
|
+
return self._is_weekend(self.__keytransform__(key))
|
|
1151
1152
|
|
|
1152
1153
|
def is_working_day(self, key: DateLike) -> bool:
|
|
1153
1154
|
"""Check if the given date is considered a working day.
|
holidays/ical.py
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
import re
|
|
14
14
|
import uuid
|
|
15
|
-
from datetime import date, datetime,
|
|
15
|
+
from datetime import date, datetime, timezone
|
|
16
16
|
from typing import Union
|
|
17
17
|
|
|
18
|
+
from holidays.calendars.gregorian import _timedelta
|
|
18
19
|
from holidays.holiday_base import HolidayBase
|
|
19
20
|
from holidays.version import __version__
|
|
20
21
|
|
|
@@ -185,16 +186,17 @@ class ICalExporter:
|
|
|
185
186
|
|
|
186
187
|
sorted_dates = sorted(self.holidays.keys())
|
|
187
188
|
# Merged continuous holiday with the same name and use `DURATION` instead.
|
|
189
|
+
n = len(sorted_dates)
|
|
188
190
|
i = 0
|
|
189
|
-
while i <
|
|
191
|
+
while i < n:
|
|
190
192
|
dt = sorted_dates[i]
|
|
191
193
|
names = self.holidays.get_list(dt)
|
|
192
194
|
|
|
193
195
|
for name in names:
|
|
194
196
|
days = 1
|
|
195
197
|
while (
|
|
196
|
-
i + days <
|
|
197
|
-
and sorted_dates[i + days] == sorted_dates[i]
|
|
198
|
+
i + days < n
|
|
199
|
+
and sorted_dates[i + days] == _timedelta(sorted_dates[i], days)
|
|
198
200
|
and name in self.holidays.get_list(sorted_dates[i + days])
|
|
199
201
|
):
|
|
200
202
|
days += 1
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
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 holidays.holiday_base import HolidayBase
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class NoHolidayBase(HolidayBase):
|
|
17
|
+
"""A dummy holiday class that does not contain any holidays."""
|
|
18
|
+
|
|
19
|
+
def _populate(self, year: int) -> None:
|
|
20
|
+
"""No holidays."""
|
|
21
|
+
return None
|
holidays/registry.py
CHANGED
|
@@ -28,6 +28,7 @@ COUNTRIES: RegistryDict = {
|
|
|
28
28
|
"andorra": ("Andorra", "AD", "AND"),
|
|
29
29
|
"angola": ("Angola", "AO", "AGO"),
|
|
30
30
|
"anguilla": ("Anguilla", "AI", "AIA"),
|
|
31
|
+
"antarctica": ("Antarctica", "AQ", "ATA"),
|
|
31
32
|
"antigua_and_barbuda": ("AntiguaAndBarbuda", "AG", "ATG"),
|
|
32
33
|
"argentina": ("Argentina", "AR", "ARG"),
|
|
33
34
|
"armenia": ("Armenia", "AM", "ARM"),
|
|
@@ -49,7 +50,9 @@ COUNTRIES: RegistryDict = {
|
|
|
49
50
|
"bonaire_sint_eustatius_and_saba": ("BonaireSintEustatiusAndSaba", "BQ", "BES"),
|
|
50
51
|
"bosnia_and_herzegovina": ("BosniaAndHerzegovina", "BA", "BIH"),
|
|
51
52
|
"botswana": ("Botswana", "BW", "BWA"),
|
|
53
|
+
"bouvet_island": ("BouvetIsland", "BV", "BVT"),
|
|
52
54
|
"brazil": ("Brazil", "BR", "BRA"),
|
|
55
|
+
"british_indian_ocean_territory": ("BritishIndianOceanTerritory", "IO", "IOT"),
|
|
53
56
|
"british_virgin_islands": ("BritishVirginIslands", "VG", "VGB"),
|
|
54
57
|
"brunei": ("Brunei", "BN", "BRN"),
|
|
55
58
|
"bulgaria": ("Bulgaria", "BG", "BLG"),
|
|
@@ -115,6 +118,7 @@ COUNTRIES: RegistryDict = {
|
|
|
115
118
|
"guinea_bissau": ("GuineaBissau", "GW", "GNB"),
|
|
116
119
|
"guyana": ("Guyana", "GY", "GUY"),
|
|
117
120
|
"haiti": ("Haiti", "HT", "HTI"),
|
|
121
|
+
"heard_island_and_mcdonald_islands": ("HeardIslandAndMcDonaldIslands", "HM", "HMD"),
|
|
118
122
|
"honduras": ("Honduras", "HN", "HND"),
|
|
119
123
|
"hongkong": ("HongKong", "HK", "HKG"),
|
|
120
124
|
"hungary": ("Hungary", "HU", "HUN"),
|
|
@@ -166,6 +170,7 @@ COUNTRIES: RegistryDict = {
|
|
|
166
170
|
"montserrat": ("Montserrat", "MS", "MSR"),
|
|
167
171
|
"morocco": ("Morocco", "MA", "MOR"),
|
|
168
172
|
"mozambique": ("Mozambique", "MZ", "MOZ"),
|
|
173
|
+
"myanmar": ("Myanmar", "MM", "MMR"),
|
|
169
174
|
"namibia": ("Namibia", "NA", "NAM"),
|
|
170
175
|
"nauru": ("Nauru", "NR", "NRU"),
|
|
171
176
|
"nepal": ("Nepal", "NP", "NPL"),
|
|
@@ -177,6 +182,7 @@ COUNTRIES: RegistryDict = {
|
|
|
177
182
|
"nigeria": ("Nigeria", "NG", "NGA"),
|
|
178
183
|
"niue": ("Niue", "NU", "NIU"),
|
|
179
184
|
"norfolk_island": ("NorfolkIsland", "NF", "NFK"),
|
|
185
|
+
"north_korea": ("NorthKorea", "KP", "PRK"),
|
|
180
186
|
"north_macedonia": ("NorthMacedonia", "MK", "MKD"),
|
|
181
187
|
"northern_mariana_islands": ("NorthernMarianaIslands", "MP", "MNP", "HolidaysMP"),
|
|
182
188
|
"norway": ("Norway", "NO", "NOR"),
|
holidays/utils.py
CHANGED
|
@@ -22,7 +22,7 @@ __all__ = (
|
|
|
22
22
|
|
|
23
23
|
import warnings
|
|
24
24
|
from collections.abc import Iterable
|
|
25
|
-
from functools import
|
|
25
|
+
from functools import cache
|
|
26
26
|
from typing import Optional, Union
|
|
27
27
|
|
|
28
28
|
from holidays.holiday_base import CategoryArg, HolidayBase
|
|
@@ -357,7 +357,7 @@ def _list_localized_entities(entity_codes: Iterable[str]) -> dict[str, list[str]
|
|
|
357
357
|
return localized_countries
|
|
358
358
|
|
|
359
359
|
|
|
360
|
-
@
|
|
360
|
+
@cache
|
|
361
361
|
def list_localized_countries(include_aliases: bool = True) -> dict[str, list[str]]:
|
|
362
362
|
"""Get all localized countries and languages they support.
|
|
363
363
|
|
|
@@ -373,7 +373,7 @@ def list_localized_countries(include_aliases: bool = True) -> dict[str, list[str
|
|
|
373
373
|
return _list_localized_entities(EntityLoader.get_country_codes(include_aliases))
|
|
374
374
|
|
|
375
375
|
|
|
376
|
-
@
|
|
376
|
+
@cache
|
|
377
377
|
def list_localized_financial(include_aliases: bool = True) -> dict[str, list[str]]:
|
|
378
378
|
"""Get all localized financial markets and languages they support.
|
|
379
379
|
|
|
@@ -407,7 +407,7 @@ def _list_supported_entities(entity_codes: Iterable[str]) -> dict[str, list[str]
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
|
|
410
|
-
@
|
|
410
|
+
@cache
|
|
411
411
|
def list_supported_countries(include_aliases: bool = True) -> dict[str, list[str]]:
|
|
412
412
|
"""Get all supported countries and their subdivisions.
|
|
413
413
|
|
|
@@ -422,7 +422,7 @@ def list_supported_countries(include_aliases: bool = True) -> dict[str, list[str
|
|
|
422
422
|
return _list_supported_entities(EntityLoader.get_country_codes(include_aliases))
|
|
423
423
|
|
|
424
424
|
|
|
425
|
-
@
|
|
425
|
+
@cache
|
|
426
426
|
def list_supported_financial(include_aliases: bool = True) -> dict[str, list[str]]:
|
|
427
427
|
"""Get all supported financial markets and their subdivisions.
|
|
428
428
|
|
holidays/version.py
CHANGED