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.
- holidays/calendars/__init__.py +1 -0
- holidays/calendars/burmese.py +319 -0
- holidays/calendars/hebrew.py +2 -2
- holidays/calendars/islamic.py +26 -6
- holidays/calendars/thai.py +49 -2
- holidays/countries/__init__.py +11 -0
- holidays/countries/afghanistan.py +7 -5
- holidays/countries/algeria.py +89 -24
- holidays/countries/antarctica.py +58 -0
- holidays/countries/azerbaijan.py +1 -1
- 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/canada.py +27 -13
- holidays/countries/chile.py +9 -8
- holidays/countries/cuba.py +3 -4
- holidays/countries/denmark.py +18 -6
- holidays/countries/djibouti.py +1 -1
- holidays/countries/fiji.py +2 -3
- holidays/countries/finland.py +3 -6
- holidays/countries/guyana.py +24 -32
- holidays/countries/heard_island_and_mcdonald_islands.py +31 -0
- holidays/countries/hungary.py +4 -5
- holidays/countries/india.py +27 -78
- holidays/countries/iran.py +133 -269
- holidays/countries/ireland.py +1 -1
- holidays/countries/israel.py +1 -1
- holidays/countries/japan.py +22 -18
- holidays/countries/jordan.py +6 -3
- holidays/countries/kuwait.py +6 -3
- holidays/countries/macau.py +5 -8
- holidays/countries/malaysia.py +14 -3
- holidays/countries/mauritius.py +10 -9
- holidays/countries/montserrat.py +1 -1
- holidays/countries/myanmar.py +194 -0
- holidays/countries/nepal.py +11 -30
- holidays/countries/netherlands.py +28 -24
- holidays/countries/new_zealand.py +75 -31
- holidays/countries/nigeria.py +53 -75
- holidays/countries/north_korea.py +161 -0
- holidays/countries/norway.py +24 -9
- 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 +8 -3
- holidays/countries/saudi_arabia.py +6 -5
- holidays/countries/serbia.py +5 -0
- holidays/countries/slovakia.py +23 -4
- holidays/countries/south_africa.py +96 -53
- holidays/countries/south_korea.py +6 -1
- holidays/countries/spain.py +4 -4
- holidays/countries/sri_lanka.py +21 -58
- holidays/countries/sudan.py +6 -3
- holidays/countries/suriname.py +1 -2
- holidays/countries/sweden.py +1 -1
- holidays/countries/switzerland.py +255 -6
- holidays/countries/taiwan.py +23 -3
- holidays/countries/tanzania.py +25 -30
- holidays/countries/thailand.py +29 -7
- holidays/countries/tonga.py +6 -1
- holidays/countries/trinidad_and_tobago.py +7 -2
- holidays/countries/ukraine.py +1 -1
- holidays/countries/united_arab_emirates.py +9 -2
- holidays/countries/united_kingdom.py +1 -1
- holidays/countries/united_states.py +18 -2
- holidays/countries/uruguay.py +6 -1
- holidays/countries/vietnam.py +6 -1
- holidays/countries/western_sahara.py +92 -0
- holidays/countries/yemen.py +6 -3
- holidays/groups/__init__.py +1 -0
- holidays/groups/balinese_saka.py +1 -1
- holidays/groups/buddhist.py +3 -3
- holidays/groups/burmese.py +273 -0
- holidays/groups/chinese.py +30 -2
- holidays/groups/christian.py +10 -0
- holidays/groups/custom.py +8 -2
- holidays/groups/eastern.py +26 -0
- holidays/groups/hebrew.py +16 -14
- holidays/groups/hindu.py +23 -15
- holidays/groups/international.py +1 -1
- holidays/groups/islamic.py +52 -50
- holidays/groups/mongolian.py +6 -3
- holidays/groups/sinhala.py +9 -11
- holidays/groups/tibetan.py +8 -6
- holidays/holiday_base.py +26 -26
- holidays/ical.py +6 -4
- holidays/locale/ar/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/EH.mo +0 -0
- holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/de/LC_MESSAGES/CH.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/CH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/EH.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/NL.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/EH.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/CH.mo +0 -0
- holidays/locale/fr/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/fr/LC_MESSAGES/EH.mo +0 -0
- holidays/locale/fy/LC_MESSAGES/NL.mo +0 -0
- holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/it/LC_MESSAGES/CH.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/nl/LC_MESSAGES/NL.mo +0 -0
- holidays/locale/pt_BR/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/th/LC_MESSAGES/CH.mo +0 -0
- holidays/locale/th/LC_MESSAGES/DK.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/NL.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/CH.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/NL.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/PY.mo +0 -0
- holidays/no_holiday_base.py +21 -0
- holidays/observed_holiday_base.py +16 -4
- holidays/registry.py +8 -0
- holidays/utils.py +5 -5
- holidays/version.py +1 -1
- {holidays-0.81.dist-info → holidays-0.83.dist-info}/METADATA +63 -19
- {holidays-0.81.dist-info → holidays-0.83.dist-info}/RECORD +141 -118
- {holidays-0.81.dist-info → holidays-0.83.dist-info}/licenses/CONTRIBUTORS +2 -0
- {holidays-0.81.dist-info → holidays-0.83.dist-info}/WHEEL +0 -0
- {holidays-0.81.dist-info → holidays-0.83.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.81.dist-info → holidays-0.83.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
|
|
|
@@ -25,8 +25,12 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
25
25
|
calendar consisting of 12 lunar months in a year of 354 or 355 days.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
|
-
def __init__(self, cls=None, show_estimated=True) -> None:
|
|
29
|
-
self._islamic_calendar =
|
|
28
|
+
def __init__(self, cls=None, *, show_estimated=True, calendar_delta_days=0) -> None:
|
|
29
|
+
self._islamic_calendar = (
|
|
30
|
+
cls(calendar_delta_days=calendar_delta_days)
|
|
31
|
+
if cls
|
|
32
|
+
else _IslamicLunar(calendar_delta_days=calendar_delta_days)
|
|
33
|
+
)
|
|
30
34
|
self._islamic_calendar_show_estimated = show_estimated
|
|
31
35
|
|
|
32
36
|
def _add_ali_al_rida_death_day(self, name) -> set[date]:
|
|
@@ -35,7 +39,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
35
39
|
|
|
36
40
|
https://en.wikipedia.org/wiki/Ali_al-Rida
|
|
37
41
|
"""
|
|
38
|
-
return self.
|
|
42
|
+
return self._add_islamic_calendar_holiday_set(
|
|
39
43
|
name, self._islamic_calendar.ali_al_rida_death_dates(self._year)
|
|
40
44
|
)
|
|
41
45
|
|
|
@@ -45,7 +49,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
45
49
|
|
|
46
50
|
https://en.wikipedia.org/wiki/Ali
|
|
47
51
|
"""
|
|
48
|
-
return self.
|
|
52
|
+
return self._add_islamic_calendar_holiday_set(
|
|
49
53
|
name, self._islamic_calendar.ali_birthday_dates(self._year)
|
|
50
54
|
)
|
|
51
55
|
|
|
@@ -55,7 +59,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
55
59
|
|
|
56
60
|
https://en.wikipedia.org/wiki/Ali
|
|
57
61
|
"""
|
|
58
|
-
return self.
|
|
62
|
+
return self._add_islamic_calendar_holiday_set(
|
|
59
63
|
name, self._islamic_calendar.ali_death_dates(self._year)
|
|
60
64
|
)
|
|
61
65
|
|
|
@@ -65,7 +69,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
65
69
|
|
|
66
70
|
https://en.wikipedia.org/wiki/Arbaeen
|
|
67
71
|
"""
|
|
68
|
-
return self.
|
|
72
|
+
return self._add_islamic_calendar_holiday_set(
|
|
69
73
|
name, self._islamic_calendar.arbaeen_dates(self._year)
|
|
70
74
|
)
|
|
71
75
|
|
|
@@ -78,7 +82,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
78
82
|
Arafat.
|
|
79
83
|
https://en.wikipedia.org/wiki/Day_of_Arafah
|
|
80
84
|
"""
|
|
81
|
-
return self.
|
|
85
|
+
return self._add_islamic_calendar_holiday_set(
|
|
82
86
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=-1
|
|
83
87
|
)
|
|
84
88
|
|
|
@@ -90,7 +94,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
90
94
|
10th of Muharram, the first month of the Islamic calendar.
|
|
91
95
|
https://en.wikipedia.org/wiki/Ashura
|
|
92
96
|
"""
|
|
93
|
-
return self.
|
|
97
|
+
return self._add_islamic_calendar_holiday_set(
|
|
94
98
|
name, self._islamic_calendar.ashura_dates(self._year)
|
|
95
99
|
)
|
|
96
100
|
|
|
@@ -102,7 +106,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
102
106
|
10th of Muharram, the first month of the Islamic calendar.
|
|
103
107
|
https://en.wikipedia.org/wiki/Ashura
|
|
104
108
|
"""
|
|
105
|
-
return self.
|
|
109
|
+
return self._add_islamic_calendar_holiday_set(
|
|
106
110
|
name, self._islamic_calendar.ashura_dates(self._year), days_delta=-1
|
|
107
111
|
)
|
|
108
112
|
|
|
@@ -115,7 +119,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
115
119
|
to Allah's command.
|
|
116
120
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
117
121
|
"""
|
|
118
|
-
return self.
|
|
122
|
+
return self._add_islamic_calendar_holiday_set(
|
|
119
123
|
name, self._islamic_calendar.eid_al_adha_dates(self._year)
|
|
120
124
|
)
|
|
121
125
|
|
|
@@ -125,7 +129,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
125
129
|
|
|
126
130
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
127
131
|
"""
|
|
128
|
-
return self.
|
|
132
|
+
return self._add_islamic_calendar_holiday_set(
|
|
129
133
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+1
|
|
130
134
|
)
|
|
131
135
|
|
|
@@ -135,7 +139,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
135
139
|
|
|
136
140
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
137
141
|
"""
|
|
138
|
-
return self.
|
|
142
|
+
return self._add_islamic_calendar_holiday_set(
|
|
139
143
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+2
|
|
140
144
|
)
|
|
141
145
|
|
|
@@ -145,7 +149,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
145
149
|
|
|
146
150
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
147
151
|
"""
|
|
148
|
-
return self.
|
|
152
|
+
return self._add_islamic_calendar_holiday_set(
|
|
149
153
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+3
|
|
150
154
|
)
|
|
151
155
|
|
|
@@ -158,7 +162,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
158
162
|
dawn-to-sunset fasting of Ramadan.
|
|
159
163
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
160
164
|
"""
|
|
161
|
-
return self.
|
|
165
|
+
return self._add_islamic_calendar_holiday_set(
|
|
162
166
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year)
|
|
163
167
|
)
|
|
164
168
|
|
|
@@ -168,7 +172,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
168
172
|
|
|
169
173
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
170
174
|
"""
|
|
171
|
-
return self.
|
|
175
|
+
return self._add_islamic_calendar_holiday_set(
|
|
172
176
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+1
|
|
173
177
|
)
|
|
174
178
|
|
|
@@ -178,7 +182,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
178
182
|
|
|
179
183
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
180
184
|
"""
|
|
181
|
-
return self.
|
|
185
|
+
return self._add_islamic_calendar_holiday_set(
|
|
182
186
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+2
|
|
183
187
|
)
|
|
184
188
|
|
|
@@ -188,7 +192,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
188
192
|
|
|
189
193
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
190
194
|
"""
|
|
191
|
-
return self.
|
|
195
|
+
return self._add_islamic_calendar_holiday_set(
|
|
192
196
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+3
|
|
193
197
|
)
|
|
194
198
|
|
|
@@ -198,7 +202,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
198
202
|
|
|
199
203
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
200
204
|
"""
|
|
201
|
-
return self.
|
|
205
|
+
return self._add_islamic_calendar_holiday_set(
|
|
202
206
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=-1
|
|
203
207
|
)
|
|
204
208
|
|
|
@@ -208,7 +212,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
208
212
|
|
|
209
213
|
https://en.wikipedia.org/wiki/Eid_al-Ghadeer
|
|
210
214
|
"""
|
|
211
|
-
return self.
|
|
215
|
+
return self._add_islamic_calendar_holiday_set(
|
|
212
216
|
name, self._islamic_calendar.eid_al_ghadir_dates(self._year)
|
|
213
217
|
)
|
|
214
218
|
|
|
@@ -218,7 +222,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
218
222
|
|
|
219
223
|
https://en.wikipedia.org/wiki/Fatima
|
|
220
224
|
"""
|
|
221
|
-
return self.
|
|
225
|
+
return self._add_islamic_calendar_holiday_set(
|
|
222
226
|
name, self._islamic_calendar.fatima_death_dates(self._year)
|
|
223
227
|
)
|
|
224
228
|
|
|
@@ -228,7 +232,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
228
232
|
|
|
229
233
|
https://en.wikipedia.org/wiki/Grand_Magal_of_Touba
|
|
230
234
|
"""
|
|
231
|
-
return self.
|
|
235
|
+
return self._add_islamic_calendar_holiday_set(
|
|
232
236
|
name, self._islamic_calendar.grand_magal_of_touba_dates(self._year)
|
|
233
237
|
)
|
|
234
238
|
|
|
@@ -238,7 +242,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
238
242
|
|
|
239
243
|
https://web.archive.org/web/20241202170507/https://publicholidays.com.my/hari-hol-almarhum-sultan-iskandar/
|
|
240
244
|
"""
|
|
241
|
-
return self.
|
|
245
|
+
return self._add_islamic_calendar_holiday_set(
|
|
242
246
|
name, self._islamic_calendar.hari_hol_johor_dates(self._year)
|
|
243
247
|
)
|
|
244
248
|
|
|
@@ -248,7 +252,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
248
252
|
|
|
249
253
|
https://en.wikipedia.org/wiki/Hasan_al-Askari
|
|
250
254
|
"""
|
|
251
|
-
return self.
|
|
255
|
+
return self._add_islamic_calendar_holiday_set(
|
|
252
256
|
name, self._islamic_calendar.hasan_al_askari_death_dates(self._year)
|
|
253
257
|
)
|
|
254
258
|
|
|
@@ -258,7 +262,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
258
262
|
|
|
259
263
|
https://web.archive.org/web/20250323065556/https://decree.om/2022/rd20220088/
|
|
260
264
|
"""
|
|
261
|
-
return self.
|
|
265
|
+
return self._add_islamic_calendar_holiday_set(
|
|
262
266
|
name, self._islamic_calendar.ramadan_beginning_dates(self._year), days_delta=+28
|
|
263
267
|
)
|
|
264
268
|
|
|
@@ -268,12 +272,12 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
268
272
|
|
|
269
273
|
https://en.wikipedia.org/wiki/Muhammad_al-Mahdi
|
|
270
274
|
"""
|
|
271
|
-
return self.
|
|
275
|
+
return self._add_islamic_calendar_holiday_set(
|
|
272
276
|
name, self._islamic_calendar.imam_mahdi_birthday_dates(self._year)
|
|
273
277
|
)
|
|
274
278
|
|
|
275
|
-
def
|
|
276
|
-
self, name: str,
|
|
279
|
+
def _add_islamic_calendar_holiday_set(
|
|
280
|
+
self, name: str, dts_estimated: Iterable[tuple[date, bool]], days_delta: int = 0
|
|
277
281
|
) -> set[date]:
|
|
278
282
|
"""
|
|
279
283
|
Add lunar calendar holiday.
|
|
@@ -281,14 +285,12 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
281
285
|
Appends customizable estimation label at the end of holiday name if
|
|
282
286
|
holiday date is an estimation.
|
|
283
287
|
"""
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return added_dates
|
|
288
|
+
return self._add_eastern_calendar_holiday_set(
|
|
289
|
+
name,
|
|
290
|
+
dts_estimated,
|
|
291
|
+
show_estimated=self._islamic_calendar_show_estimated,
|
|
292
|
+
days_delta=days_delta,
|
|
293
|
+
)
|
|
292
294
|
|
|
293
295
|
def _add_islamic_new_year_day(self, name) -> set[date]:
|
|
294
296
|
"""
|
|
@@ -300,7 +302,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
300
302
|
observed by most Muslims on the first day of the month of Muharram.
|
|
301
303
|
https://en.wikipedia.org/wiki/Islamic_New_Year
|
|
302
304
|
"""
|
|
303
|
-
return self.
|
|
305
|
+
return self._add_islamic_calendar_holiday_set(
|
|
304
306
|
name, self._islamic_calendar.hijri_new_year_dates(self._year)
|
|
305
307
|
)
|
|
306
308
|
|
|
@@ -311,7 +313,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
311
313
|
The Prophet's Ascension.
|
|
312
314
|
https://en.wikipedia.org/wiki/Isra'_and_Mi'raj
|
|
313
315
|
"""
|
|
314
|
-
return self.
|
|
316
|
+
return self._add_islamic_calendar_holiday_set(
|
|
315
317
|
name, self._islamic_calendar.isra_and_miraj_dates(self._year)
|
|
316
318
|
)
|
|
317
319
|
|
|
@@ -322,7 +324,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
322
324
|
The Night of Power.
|
|
323
325
|
https://en.wikipedia.org/wiki/Night_of_Power
|
|
324
326
|
"""
|
|
325
|
-
return self.
|
|
327
|
+
return self._add_islamic_calendar_holiday_set(
|
|
326
328
|
name, self._islamic_calendar.laylat_al_qadr_dates(self._year)
|
|
327
329
|
)
|
|
328
330
|
|
|
@@ -332,7 +334,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
332
334
|
|
|
333
335
|
https://en.wikipedia.org/wiki/Islam_in_Maldives
|
|
334
336
|
"""
|
|
335
|
-
return self.
|
|
337
|
+
return self._add_islamic_calendar_holiday_set(
|
|
336
338
|
name, self._islamic_calendar.maldives_embraced_islam_day_dates(self._year)
|
|
337
339
|
)
|
|
338
340
|
|
|
@@ -344,7 +346,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
344
346
|
Muhammad.
|
|
345
347
|
https://en.wikipedia.org/wiki/Mawlid
|
|
346
348
|
"""
|
|
347
|
-
return self.
|
|
349
|
+
return self._add_islamic_calendar_holiday_set(
|
|
348
350
|
name, self._islamic_calendar.mawlid_dates(self._year)
|
|
349
351
|
)
|
|
350
352
|
|
|
@@ -356,7 +358,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
356
358
|
Muhammad.
|
|
357
359
|
https://en.wikipedia.org/wiki/Mawlid
|
|
358
360
|
"""
|
|
359
|
-
return self.
|
|
361
|
+
return self._add_islamic_calendar_holiday_set(
|
|
360
362
|
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+1
|
|
361
363
|
)
|
|
362
364
|
|
|
@@ -369,7 +371,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
369
371
|
the holy Quran.
|
|
370
372
|
https://web.archive.org/web/20241012115752/https://zamzam.com/blog/nuzul-al-quran/
|
|
371
373
|
"""
|
|
372
|
-
return self.
|
|
374
|
+
return self._add_islamic_calendar_holiday_set(
|
|
373
375
|
name, self._islamic_calendar.nuzul_al_quran_dates(self._year)
|
|
374
376
|
)
|
|
375
377
|
|
|
@@ -386,7 +388,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
386
388
|
ritual akin to Christian baptism.
|
|
387
389
|
https://web.archive.org/web/20240722052111/https://www.officeholidays.com/holidays/mali/prophets-baptism
|
|
388
390
|
"""
|
|
389
|
-
return self.
|
|
391
|
+
return self._add_islamic_calendar_holiday_set(
|
|
390
392
|
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+7
|
|
391
393
|
)
|
|
392
394
|
|
|
@@ -396,7 +398,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
396
398
|
|
|
397
399
|
https://en.wikipedia.org/wiki/Hasan_ibn_Ali
|
|
398
400
|
"""
|
|
399
|
-
return self.
|
|
401
|
+
return self._add_islamic_calendar_holiday_set(
|
|
400
402
|
name, self._islamic_calendar.prophet_death_dates(self._year)
|
|
401
403
|
)
|
|
402
404
|
|
|
@@ -406,7 +408,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
406
408
|
|
|
407
409
|
https://en.wikipedia.org/wiki/Qaumee_Dhuvas_(Maldives_National_Day)
|
|
408
410
|
"""
|
|
409
|
-
return self.
|
|
411
|
+
return self._add_islamic_calendar_holiday_set(
|
|
410
412
|
name, self._islamic_calendar.quamee_dhuvas_dates(self._year)
|
|
411
413
|
)
|
|
412
414
|
|
|
@@ -418,7 +420,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
418
420
|
worldwide as a month of fasting, prayer, reflection, and community
|
|
419
421
|
https://en.wikipedia.org/wiki/Ramadan
|
|
420
422
|
"""
|
|
421
|
-
return self.
|
|
423
|
+
return self._add_islamic_calendar_holiday_set(
|
|
422
424
|
name, self._islamic_calendar.ramadan_beginning_dates(self._year)
|
|
423
425
|
)
|
|
424
426
|
|
|
@@ -428,7 +430,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
428
430
|
|
|
429
431
|
https://en.wikipedia.org/wiki/Ja'far_al-Sadiq
|
|
430
432
|
"""
|
|
431
|
-
return self.
|
|
433
|
+
return self._add_islamic_calendar_holiday_set(
|
|
432
434
|
name, self._islamic_calendar.sadiq_birthday_dates(self._year)
|
|
433
435
|
)
|
|
434
436
|
|
|
@@ -438,7 +440,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
438
440
|
|
|
439
441
|
https://en.wikipedia.org/wiki/Ja'far_al-Sadiq
|
|
440
442
|
"""
|
|
441
|
-
return self.
|
|
443
|
+
return self._add_islamic_calendar_holiday_set(
|
|
442
444
|
name, self._islamic_calendar.sadiq_death_dates(self._year)
|
|
443
445
|
)
|
|
444
446
|
|
|
@@ -448,6 +450,6 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
448
450
|
|
|
449
451
|
https://en.wikipedia.org/wiki/Tasua
|
|
450
452
|
"""
|
|
451
|
-
return self.
|
|
453
|
+
return self._add_islamic_calendar_holiday_set(
|
|
452
454
|
name, self._islamic_calendar.tasua_dates(self._year)
|
|
453
455
|
)
|
holidays/groups/mongolian.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 _MongolianLunisolar
|
|
16
|
+
from holidays.calendars.mongolian import _MongolianLunisolar
|
|
17
17
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
18
18
|
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@ class MongolianCalendarHolidays(EasternCalendarHolidays):
|
|
|
22
22
|
Mongolian 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._mongolian_calendar = cls() if cls else _MongolianLunisolar()
|
|
27
27
|
self._mongolian_calendar_show_estimated = show_estimated
|
|
28
28
|
|
|
@@ -37,7 +37,10 @@ class MongolianCalendarHolidays(EasternCalendarHolidays):
|
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
return self._add_eastern_calendar_holiday(
|
|
40
|
-
name,
|
|
40
|
+
name,
|
|
41
|
+
dt_estimated,
|
|
42
|
+
show_estimated=self._mongolian_calendar_show_estimated,
|
|
43
|
+
days_delta=days_delta,
|
|
41
44
|
)
|
|
42
45
|
|
|
43
46
|
def _add_buddha_day(self, name) -> Optional[date]:
|
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
|
|
|
@@ -32,7 +32,7 @@ class SinhalaCalendarHolidays(EasternCalendarHolidays):
|
|
|
32
32
|
Adhi month dates are instead hardcoded in Sri Lanka country implementation.
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
|
-
def __init__(self, cls=None, show_estimated=False) -> None:
|
|
35
|
+
def __init__(self, cls=None, *, show_estimated=False) -> None:
|
|
36
36
|
self._sinhala_calendar = cls() if cls else _SinhalaLunar()
|
|
37
37
|
self._sinhala_calendar_show_estimated = show_estimated
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@ class SinhalaCalendarHolidays(EasternCalendarHolidays):
|
|
|
46
46
|
is an estimation.
|
|
47
47
|
"""
|
|
48
48
|
return self._add_eastern_calendar_holiday(
|
|
49
|
-
name, dt_estimated, self._sinhala_calendar_show_estimated
|
|
49
|
+
name, dt_estimated, show_estimated=self._sinhala_calendar_show_estimated
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
def _add_sinhala_calendar_holiday_set(
|
|
@@ -58,14 +58,12 @@ 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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return added_dates
|
|
61
|
+
return self._add_eastern_calendar_holiday_set(
|
|
62
|
+
name,
|
|
63
|
+
dts_estimated,
|
|
64
|
+
show_estimated=self._sinhala_calendar_show_estimated,
|
|
65
|
+
days_delta=days_delta,
|
|
66
|
+
)
|
|
69
67
|
|
|
70
68
|
def _add_bak_poya(self, name) -> Optional[date]:
|
|
71
69
|
"""
|
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
|
|
|
@@ -22,7 +22,7 @@ class TibetanCalendarHolidays(EasternCalendarHolidays):
|
|
|
22
22
|
Tibetan 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._tibetan_calendar = cls() if cls else _TibetanLunisolar()
|
|
27
27
|
self._tibetan_calendar_show_estimated = show_estimated
|
|
28
28
|
|
|
@@ -36,7 +36,10 @@ class TibetanCalendarHolidays(EasternCalendarHolidays):
|
|
|
36
36
|
is an estimation.
|
|
37
37
|
"""
|
|
38
38
|
return self._add_eastern_calendar_holiday(
|
|
39
|
-
name,
|
|
39
|
+
name,
|
|
40
|
+
dt_estimated,
|
|
41
|
+
show_estimated=self._tibetan_calendar_show_estimated,
|
|
42
|
+
days_delta=days_delta,
|
|
40
43
|
)
|
|
41
44
|
|
|
42
45
|
def _add_blessed_rainy_day(self, name) -> Optional[date]:
|
|
@@ -103,14 +106,13 @@ class TibetanCalendarHolidays(EasternCalendarHolidays):
|
|
|
103
106
|
name, self._tibetan_calendar.losar_date(self._year)
|
|
104
107
|
)
|
|
105
108
|
|
|
106
|
-
def _add_losar_day_two(self, name) ->
|
|
109
|
+
def _add_losar_day_two(self, name) -> Optional[date]:
|
|
107
110
|
"""
|
|
108
111
|
Add Losar Day Two.
|
|
109
112
|
"""
|
|
110
|
-
|
|
113
|
+
return self._add_tibetan_calendar_holiday(
|
|
111
114
|
name, self._tibetan_calendar.losar_date(self._year), days_delta=+1
|
|
112
115
|
)
|
|
113
|
-
return {dt} if dt is not None else set()
|
|
114
116
|
|
|
115
117
|
def _add_thimphu_drubchen_day(self, name) -> Optional[date]:
|
|
116
118
|
"""
|
holidays/holiday_base.py
CHANGED
|
@@ -808,7 +808,7 @@ class HolidayBase(dict[date, str]):
|
|
|
808
808
|
self[dt] = self.tr(name)
|
|
809
809
|
return dt
|
|
810
810
|
|
|
811
|
-
def _add_special_holidays(self, mapping_names, observed=False):
|
|
811
|
+
def _add_special_holidays(self, mapping_names, *, observed=False):
|
|
812
812
|
"""Add special holidays."""
|
|
813
813
|
for mapping_name in mapping_names:
|
|
814
814
|
for data in _normalize_tuple(getattr(self, mapping_name, {}).get(self._year, ())):
|
|
@@ -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
|
|
|
@@ -862,14 +865,21 @@ class HolidayBase(dict[date, str]):
|
|
|
862
865
|
def _is_sunday(self, *args) -> bool:
|
|
863
866
|
return self._check_weekday(SUN, *args)
|
|
864
867
|
|
|
865
|
-
def
|
|
868
|
+
def _is_weekday(self, *args) -> bool:
|
|
869
|
+
"""
|
|
870
|
+
Returns True if date's week day is not a weekend day.
|
|
871
|
+
Returns False otherwise.
|
|
872
|
+
"""
|
|
873
|
+
return not self._is_weekend(*args)
|
|
874
|
+
|
|
875
|
+
def _is_weekend(self, *args) -> bool:
|
|
866
876
|
"""
|
|
867
877
|
Returns True if date's week day is a weekend day.
|
|
868
878
|
Returns False otherwise.
|
|
869
879
|
"""
|
|
870
880
|
dt = args if len(args) > 1 else args[0]
|
|
871
881
|
dt = dt if isinstance(dt, date) else date(self._year, *dt)
|
|
872
|
-
return dt.weekday() in self.
|
|
882
|
+
return dt.weekday() in self._get_weekend(dt)
|
|
873
883
|
|
|
874
884
|
def _populate(self, year: int) -> None:
|
|
875
885
|
"""This is a private method that populates (generates and adds) holidays
|
|
@@ -1145,9 +1155,7 @@ class HolidayBase(dict[date, str]):
|
|
|
1145
1155
|
Returns:
|
|
1146
1156
|
True if the date's week day is a weekend day, False otherwise.
|
|
1147
1157
|
"""
|
|
1148
|
-
|
|
1149
|
-
# `HolidayBase._is_weekend` method and perform the check directly instead.
|
|
1150
|
-
return self.__keytransform__(key).weekday() in self.weekend
|
|
1158
|
+
return self._is_weekend(self.__keytransform__(key))
|
|
1151
1159
|
|
|
1152
1160
|
def is_working_day(self, key: DateLike) -> bool:
|
|
1153
1161
|
"""Check if the given date is considered a working day.
|
|
@@ -1360,11 +1368,12 @@ class HolidaySum(HolidayBase):
|
|
|
1360
1368
|
else:
|
|
1361
1369
|
self.holidays.append(operand)
|
|
1362
1370
|
|
|
1363
|
-
kwargs: dict[str, Any] = {}
|
|
1364
1371
|
# Join years, expand and observed.
|
|
1365
|
-
kwargs[
|
|
1366
|
-
|
|
1367
|
-
|
|
1372
|
+
kwargs: dict[str, Any] = {
|
|
1373
|
+
"expand": h1.expand or h2.expand,
|
|
1374
|
+
"observed": h1.observed or h2.observed,
|
|
1375
|
+
"years": h1.years | h2.years,
|
|
1376
|
+
}
|
|
1368
1377
|
# Join country and subdivisions data.
|
|
1369
1378
|
# TODO: this way makes no sense: joining Italy Catania (IT, CA) with
|
|
1370
1379
|
# USA Mississippi (US, MS) and USA Michigan (US, MI) yields
|
|
@@ -1373,25 +1382,16 @@ class HolidaySum(HolidayBase):
|
|
|
1373
1382
|
# and Milano, or ... you get the picture.
|
|
1374
1383
|
# Same goes when countries and markets are being mixed (working, yet
|
|
1375
1384
|
# still nonsensical).
|
|
1385
|
+
value: Optional[Union[str, list[str]]]
|
|
1376
1386
|
for attr in ("country", "market", "subdiv"):
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
a1 = (
|
|
1383
|
-
getattr(h1, attr)
|
|
1384
|
-
if isinstance(getattr(h1, attr), list)
|
|
1385
|
-
else [getattr(h1, attr)]
|
|
1386
|
-
)
|
|
1387
|
-
a2 = (
|
|
1388
|
-
getattr(h2, attr)
|
|
1389
|
-
if isinstance(getattr(h2, attr), list)
|
|
1390
|
-
else [getattr(h2, attr)]
|
|
1391
|
-
)
|
|
1387
|
+
a1 = getattr(h1, attr, None)
|
|
1388
|
+
a2 = getattr(h2, attr, None)
|
|
1389
|
+
if a1 and a2 and a1 != a2:
|
|
1390
|
+
a1 = a1 if isinstance(a1, list) else [a1]
|
|
1391
|
+
a2 = a2 if isinstance(a2, list) else [a2]
|
|
1392
1392
|
value = a1 + a2
|
|
1393
1393
|
else:
|
|
1394
|
-
value =
|
|
1394
|
+
value = a1 or a2
|
|
1395
1395
|
|
|
1396
1396
|
if attr == "subdiv":
|
|
1397
1397
|
kwargs[attr] = value
|
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
|