holidays 0.58__py3-none-any.whl → 0.59__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/__init__.py +1 -1
- holidays/calendars/buddhist.py +4 -4
- holidays/calendars/chinese.py +8 -8
- holidays/calendars/hindu.py +4 -4
- holidays/calendars/islamic.py +25 -25
- holidays/countries/angola.py +2 -2
- holidays/countries/armenia.py +5 -2
- holidays/countries/azerbaijan.py +7 -2
- holidays/countries/belarus.py +1 -1
- holidays/countries/bosnia_and_herzegovina.py +2 -2
- holidays/countries/bulgaria.py +1 -2
- holidays/countries/chile.py +1 -2
- holidays/countries/czechia.py +6 -3
- holidays/countries/egypt.py +0 -1
- holidays/countries/france.py +1 -1
- holidays/countries/georgia.py +1 -1
- holidays/countries/germany.py +10 -0
- holidays/countries/hongkong.py +1 -2
- holidays/countries/japan.py +3 -4
- holidays/countries/jersey.py +2 -2
- holidays/countries/jordan.py +1 -1
- holidays/countries/kazakhstan.py +1 -1
- holidays/countries/kuwait.py +1 -1
- holidays/countries/kyrgyzstan.py +1 -1
- holidays/countries/malaysia.py +7 -1
- holidays/countries/mauritania.py +0 -1
- holidays/countries/moldova.py +4 -3
- holidays/countries/russia.py +1 -1
- holidays/countries/saudi_arabia.py +1 -2
- holidays/countries/slovakia.py +1 -1
- holidays/countries/south_korea.py +1 -2
- holidays/countries/taiwan.py +1 -2
- holidays/countries/ukraine.py +1 -3
- holidays/countries/united_arab_emirates.py +5 -2
- holidays/countries/united_kingdom.py +2 -2
- holidays/countries/united_states.py +2 -2
- holidays/countries/uzbekistan.py +2 -1
- holidays/countries/vietnam.py +116 -25
- holidays/groups/__init__.py +1 -0
- holidays/groups/buddhist.py +6 -11
- holidays/groups/chinese.py +7 -25
- holidays/groups/eastern.py +51 -0
- holidays/groups/hindu.py +6 -11
- holidays/groups/international.py +8 -5
- holidays/groups/islamic.py +39 -46
- holidays/holiday_base.py +31 -30
- holidays/locale/de/LC_MESSAGES/DE.mo +0 -0
- holidays/locale/de/LC_MESSAGES/DE.po +11 -4
- holidays/locale/en_US/LC_MESSAGES/DE.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/DE.po +13 -4
- holidays/locale/en_US/LC_MESSAGES/VN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/VN.po +37 -19
- holidays/locale/th/LC_MESSAGES/DE.mo +0 -0
- holidays/locale/th/LC_MESSAGES/DE.po +11 -2
- holidays/locale/th/LC_MESSAGES/VN.mo +0 -0
- holidays/locale/th/LC_MESSAGES/VN.po +93 -0
- holidays/locale/uk/LC_MESSAGES/DE.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/DE.po +13 -4
- holidays/locale/vi/LC_MESSAGES/VN.mo +0 -0
- holidays/locale/vi/LC_MESSAGES/VN.po +32 -14
- holidays/mixins.py +1 -4
- holidays/observed_holiday_base.py +5 -5
- holidays/registry.py +4 -3
- holidays/utils.py +8 -7
- {holidays-0.58.dist-info → holidays-0.59.dist-info}/METADATA +22 -38
- {holidays-0.58.dist-info → holidays-0.59.dist-info}/RECORD +70 -67
- {holidays-0.58.dist-info → holidays-0.59.dist-info}/WHEEL +1 -1
- {holidays-0.58.dist-info → holidays-0.59.dist-info}/AUTHORS +0 -0
- {holidays-0.58.dist-info → holidays-0.59.dist-info}/LICENSE +0 -0
- {holidays-0.58.dist-info → holidays-0.59.dist-info}/top_level.txt +0 -0
holidays/groups/islamic.py
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
+
from collections.abc import Iterable
|
|
13
14
|
from datetime import date
|
|
14
|
-
from typing import Iterable, Set, Tuple
|
|
15
15
|
|
|
16
16
|
from holidays.calendars import _IslamicLunar
|
|
17
|
-
from holidays.
|
|
17
|
+
from holidays.groups.eastern import EasternCalendarHolidays
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class IslamicHolidays:
|
|
20
|
+
class IslamicHolidays(EasternCalendarHolidays):
|
|
21
21
|
"""
|
|
22
22
|
Islamic holidays.
|
|
23
23
|
|
|
@@ -28,7 +28,7 @@ class IslamicHolidays:
|
|
|
28
28
|
def __init__(self, cls=None) -> None:
|
|
29
29
|
self._islamic_calendar = cls() if cls else _IslamicLunar()
|
|
30
30
|
|
|
31
|
-
def _add_ali_al_rida_death_day(self, name) ->
|
|
31
|
+
def _add_ali_al_rida_death_day(self, name) -> set[date]:
|
|
32
32
|
"""
|
|
33
33
|
Add death of Ali al-Rida day (last (29th or 30th) day of 2nd month).
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@ class IslamicHolidays:
|
|
|
38
38
|
name, self._islamic_calendar.ali_al_rida_death_dates(self._year)
|
|
39
39
|
)
|
|
40
40
|
|
|
41
|
-
def _add_ali_birthday_day(self, name) ->
|
|
41
|
+
def _add_ali_birthday_day(self, name) -> set[date]:
|
|
42
42
|
"""
|
|
43
43
|
Add birthday of Ali ibn Abu Talib day (13th day of 7th month).
|
|
44
44
|
|
|
@@ -48,7 +48,7 @@ class IslamicHolidays:
|
|
|
48
48
|
name, self._islamic_calendar.ali_birthday_dates(self._year)
|
|
49
49
|
)
|
|
50
50
|
|
|
51
|
-
def _add_ali_death_day(self, name) ->
|
|
51
|
+
def _add_ali_death_day(self, name) -> set[date]:
|
|
52
52
|
"""
|
|
53
53
|
Add death of Ali ibn Abu Talib day (21st day of 9th month).
|
|
54
54
|
|
|
@@ -58,7 +58,7 @@ class IslamicHolidays:
|
|
|
58
58
|
name, self._islamic_calendar.ali_death_dates(self._year)
|
|
59
59
|
)
|
|
60
60
|
|
|
61
|
-
def _add_arbaeen_day(self, name) ->
|
|
61
|
+
def _add_arbaeen_day(self, name) -> set[date]:
|
|
62
62
|
"""
|
|
63
63
|
Add Arbaeen day (20th day of 2nd month).
|
|
64
64
|
|
|
@@ -68,7 +68,7 @@ class IslamicHolidays:
|
|
|
68
68
|
name, self._islamic_calendar.arbaeen_dates(self._year)
|
|
69
69
|
)
|
|
70
70
|
|
|
71
|
-
def _add_arafah_day(self, name) ->
|
|
71
|
+
def _add_arafah_day(self, name) -> set[date]:
|
|
72
72
|
"""
|
|
73
73
|
Add Day of Arafah (9th day of 12th month).
|
|
74
74
|
|
|
@@ -81,7 +81,7 @@ class IslamicHolidays:
|
|
|
81
81
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=-1
|
|
82
82
|
)
|
|
83
83
|
|
|
84
|
-
def _add_ashura_day(self, name) ->
|
|
84
|
+
def _add_ashura_day(self, name) -> set[date]:
|
|
85
85
|
"""
|
|
86
86
|
Add Ashura Day (10th day of 1st month).
|
|
87
87
|
|
|
@@ -93,7 +93,7 @@ class IslamicHolidays:
|
|
|
93
93
|
name, self._islamic_calendar.ashura_dates(self._year)
|
|
94
94
|
)
|
|
95
95
|
|
|
96
|
-
def _add_ashura_eve(self, name) ->
|
|
96
|
+
def _add_ashura_eve(self, name) -> set[date]:
|
|
97
97
|
"""
|
|
98
98
|
Add Ashura Eve (Day before the 10th day of 1st month).
|
|
99
99
|
|
|
@@ -105,7 +105,7 @@ class IslamicHolidays:
|
|
|
105
105
|
name, self._islamic_calendar.ashura_dates(self._year), days_delta=-1
|
|
106
106
|
)
|
|
107
107
|
|
|
108
|
-
def _add_eid_al_adha_day(self, name) ->
|
|
108
|
+
def _add_eid_al_adha_day(self, name) -> set[date]:
|
|
109
109
|
"""
|
|
110
110
|
Add Eid al-Adha Day (10th day of the 12th month of Islamic calendar).
|
|
111
111
|
|
|
@@ -118,7 +118,7 @@ class IslamicHolidays:
|
|
|
118
118
|
name, self._islamic_calendar.eid_al_adha_dates(self._year)
|
|
119
119
|
)
|
|
120
120
|
|
|
121
|
-
def _add_eid_al_adha_day_two(self, name) ->
|
|
121
|
+
def _add_eid_al_adha_day_two(self, name) -> set[date]:
|
|
122
122
|
"""
|
|
123
123
|
Add Eid al-Adha Day Two.
|
|
124
124
|
|
|
@@ -128,7 +128,7 @@ class IslamicHolidays:
|
|
|
128
128
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+1
|
|
129
129
|
)
|
|
130
130
|
|
|
131
|
-
def _add_eid_al_adha_day_three(self, name) ->
|
|
131
|
+
def _add_eid_al_adha_day_three(self, name) -> set[date]:
|
|
132
132
|
"""
|
|
133
133
|
Add Eid al-Adha Day Three.
|
|
134
134
|
|
|
@@ -138,7 +138,7 @@ class IslamicHolidays:
|
|
|
138
138
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+2
|
|
139
139
|
)
|
|
140
140
|
|
|
141
|
-
def _add_eid_al_adha_day_four(self, name) ->
|
|
141
|
+
def _add_eid_al_adha_day_four(self, name) -> set[date]:
|
|
142
142
|
"""
|
|
143
143
|
Add Eid al-Adha Day Four.
|
|
144
144
|
|
|
@@ -148,7 +148,7 @@ class IslamicHolidays:
|
|
|
148
148
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+3
|
|
149
149
|
)
|
|
150
150
|
|
|
151
|
-
def _add_eid_al_fitr_day(self, name) ->
|
|
151
|
+
def _add_eid_al_fitr_day(self, name) -> set[date]:
|
|
152
152
|
"""
|
|
153
153
|
Add Eid al-Fitr Day (1st day of 10th month of Islamic calendar).
|
|
154
154
|
|
|
@@ -161,7 +161,7 @@ class IslamicHolidays:
|
|
|
161
161
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year)
|
|
162
162
|
)
|
|
163
163
|
|
|
164
|
-
def _add_eid_al_fitr_day_two(self, name) ->
|
|
164
|
+
def _add_eid_al_fitr_day_two(self, name) -> set[date]:
|
|
165
165
|
"""
|
|
166
166
|
Add Eid al-Fitr Day Two.
|
|
167
167
|
|
|
@@ -171,7 +171,7 @@ class IslamicHolidays:
|
|
|
171
171
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+1
|
|
172
172
|
)
|
|
173
173
|
|
|
174
|
-
def _add_eid_al_fitr_day_three(self, name) ->
|
|
174
|
+
def _add_eid_al_fitr_day_three(self, name) -> set[date]:
|
|
175
175
|
"""
|
|
176
176
|
Add Eid al-Fitr Day Three.
|
|
177
177
|
|
|
@@ -181,7 +181,7 @@ class IslamicHolidays:
|
|
|
181
181
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+2
|
|
182
182
|
)
|
|
183
183
|
|
|
184
|
-
def _add_eid_al_fitr_day_four(self, name) ->
|
|
184
|
+
def _add_eid_al_fitr_day_four(self, name) -> set[date]:
|
|
185
185
|
"""
|
|
186
186
|
Add Eid al-Fitr Day Four.
|
|
187
187
|
|
|
@@ -191,7 +191,7 @@ class IslamicHolidays:
|
|
|
191
191
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+3
|
|
192
192
|
)
|
|
193
193
|
|
|
194
|
-
def _add_eid_al_fitr_eve(self, name) ->
|
|
194
|
+
def _add_eid_al_fitr_eve(self, name) -> set[date]:
|
|
195
195
|
"""
|
|
196
196
|
Add Eid al-Fitr Eve (last day of 9th month of Islamic calendar).
|
|
197
197
|
|
|
@@ -201,7 +201,7 @@ class IslamicHolidays:
|
|
|
201
201
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=-1
|
|
202
202
|
)
|
|
203
203
|
|
|
204
|
-
def _add_eid_al_ghadir_day(self, name) ->
|
|
204
|
+
def _add_eid_al_ghadir_day(self, name) -> set[date]:
|
|
205
205
|
"""
|
|
206
206
|
Add Eid al-Ghadir Day (18th day of 12th month).
|
|
207
207
|
|
|
@@ -211,7 +211,7 @@ class IslamicHolidays:
|
|
|
211
211
|
name, self._islamic_calendar.eid_al_ghadir_dates(self._year)
|
|
212
212
|
)
|
|
213
213
|
|
|
214
|
-
def _add_fatima_death_day(self, name) ->
|
|
214
|
+
def _add_fatima_death_day(self, name) -> set[date]:
|
|
215
215
|
"""
|
|
216
216
|
Add death of Fatima day (3rd day of 6th month).
|
|
217
217
|
|
|
@@ -221,7 +221,7 @@ class IslamicHolidays:
|
|
|
221
221
|
name, self._islamic_calendar.fatima_death_dates(self._year)
|
|
222
222
|
)
|
|
223
223
|
|
|
224
|
-
def _add_hari_hol_johor(self, name) ->
|
|
224
|
+
def _add_hari_hol_johor(self, name) -> set[date]:
|
|
225
225
|
"""
|
|
226
226
|
Hari Hol Johor.
|
|
227
227
|
|
|
@@ -231,7 +231,7 @@ class IslamicHolidays:
|
|
|
231
231
|
name, self._islamic_calendar.hari_hol_johor_dates(self._year)
|
|
232
232
|
)
|
|
233
233
|
|
|
234
|
-
def _add_hasan_al_askari_death_day(self, name) ->
|
|
234
|
+
def _add_hasan_al_askari_death_day(self, name) -> set[date]:
|
|
235
235
|
"""
|
|
236
236
|
Add death of Hasan_al-Askari day (8th day of 3rd month).
|
|
237
237
|
|
|
@@ -241,7 +241,7 @@ class IslamicHolidays:
|
|
|
241
241
|
name, self._islamic_calendar.hasan_al_askari_death_dates(self._year)
|
|
242
242
|
)
|
|
243
243
|
|
|
244
|
-
def _add_imam_mahdi_birthday_day(self, name) ->
|
|
244
|
+
def _add_imam_mahdi_birthday_day(self, name) -> set[date]:
|
|
245
245
|
"""
|
|
246
246
|
Add birthday of Muhammad al-Mahdi day (15th day of 8th month).
|
|
247
247
|
|
|
@@ -252,8 +252,8 @@ class IslamicHolidays:
|
|
|
252
252
|
)
|
|
253
253
|
|
|
254
254
|
def _add_islamic_calendar_holiday(
|
|
255
|
-
self, name: str, dates: Iterable[
|
|
256
|
-
) ->
|
|
255
|
+
self, name: str, dates: Iterable[tuple[date, bool]], days_delta: int = 0
|
|
256
|
+
) -> set[date]:
|
|
257
257
|
"""
|
|
258
258
|
Add lunar calendar holiday.
|
|
259
259
|
|
|
@@ -261,20 +261,13 @@ class IslamicHolidays:
|
|
|
261
261
|
holiday date is an estimation.
|
|
262
262
|
"""
|
|
263
263
|
added_dates = set()
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if days_delta != 0:
|
|
267
|
-
dt = _timedelta(dt, days_delta)
|
|
268
|
-
|
|
269
|
-
dt = self._add_holiday(
|
|
270
|
-
self.tr(estimated_label) % self.tr(name) if is_estimated else name, dt
|
|
271
|
-
)
|
|
272
|
-
if dt:
|
|
264
|
+
for dts in dates:
|
|
265
|
+
if dt := self._add_eastern_calendar_holiday(name, dts, days_delta=days_delta):
|
|
273
266
|
added_dates.add(dt)
|
|
274
267
|
|
|
275
268
|
return added_dates
|
|
276
269
|
|
|
277
|
-
def _add_islamic_new_year_day(self, name) ->
|
|
270
|
+
def _add_islamic_new_year_day(self, name) -> set[date]:
|
|
278
271
|
"""
|
|
279
272
|
Add Islamic New Year Day (last day of Dhu al-Hijjah).
|
|
280
273
|
|
|
@@ -299,7 +292,7 @@ class IslamicHolidays:
|
|
|
299
292
|
name, self._islamic_calendar.isra_and_miraj_dates(self._year)
|
|
300
293
|
)
|
|
301
294
|
|
|
302
|
-
def _add_maldives_embraced_islam_day(self, name) ->
|
|
295
|
+
def _add_maldives_embraced_islam_day(self, name) -> set[date]:
|
|
303
296
|
"""
|
|
304
297
|
Add Maldives Embraced Islam Day (1st day of 4th month).
|
|
305
298
|
|
|
@@ -309,7 +302,7 @@ class IslamicHolidays:
|
|
|
309
302
|
name, self._islamic_calendar.maldives_embraced_islam_day_dates(self._year)
|
|
310
303
|
)
|
|
311
304
|
|
|
312
|
-
def _add_mawlid_day(self, name) ->
|
|
305
|
+
def _add_mawlid_day(self, name) -> set[date]:
|
|
313
306
|
"""
|
|
314
307
|
Add Mawlid Day (12th day of 3rd month).
|
|
315
308
|
|
|
@@ -321,7 +314,7 @@ class IslamicHolidays:
|
|
|
321
314
|
name, self._islamic_calendar.mawlid_dates(self._year)
|
|
322
315
|
)
|
|
323
316
|
|
|
324
|
-
def _add_mawlid_day_two(self, name) ->
|
|
317
|
+
def _add_mawlid_day_two(self, name) -> set[date]:
|
|
325
318
|
"""
|
|
326
319
|
Add Mawlid Day Two.
|
|
327
320
|
|
|
@@ -333,7 +326,7 @@ class IslamicHolidays:
|
|
|
333
326
|
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+1
|
|
334
327
|
)
|
|
335
328
|
|
|
336
|
-
def _add_nuzul_al_quran_day(self, name) ->
|
|
329
|
+
def _add_nuzul_al_quran_day(self, name) -> set[date]:
|
|
337
330
|
"""
|
|
338
331
|
Add Nuzul Al Quran (17th day of 9th month).
|
|
339
332
|
|
|
@@ -346,7 +339,7 @@ class IslamicHolidays:
|
|
|
346
339
|
name, self._islamic_calendar.nuzul_al_quran_dates(self._year)
|
|
347
340
|
)
|
|
348
341
|
|
|
349
|
-
def _add_prophet_death_day(self, name) ->
|
|
342
|
+
def _add_prophet_death_day(self, name) -> set[date]:
|
|
350
343
|
"""
|
|
351
344
|
Add death of Prophet Muhammad and Hasan ibn Ali day (28th day of 2nd month).
|
|
352
345
|
|
|
@@ -356,7 +349,7 @@ class IslamicHolidays:
|
|
|
356
349
|
name, self._islamic_calendar.prophet_death_dates(self._year)
|
|
357
350
|
)
|
|
358
351
|
|
|
359
|
-
def _add_quamee_dhuvas_day(self, name) ->
|
|
352
|
+
def _add_quamee_dhuvas_day(self, name) -> set[date]:
|
|
360
353
|
"""
|
|
361
354
|
Add Quamee Dhuvas (1st day of 3rd month).
|
|
362
355
|
|
|
@@ -366,7 +359,7 @@ class IslamicHolidays:
|
|
|
366
359
|
name, self._islamic_calendar.quamee_dhuvas_dates(self._year)
|
|
367
360
|
)
|
|
368
361
|
|
|
369
|
-
def _add_ramadan_beginning_day(self, name) ->
|
|
362
|
+
def _add_ramadan_beginning_day(self, name) -> set[date]:
|
|
370
363
|
"""
|
|
371
364
|
Add First Day of Ramadan (1st day of 9th month).
|
|
372
365
|
|
|
@@ -378,7 +371,7 @@ class IslamicHolidays:
|
|
|
378
371
|
name, self._islamic_calendar.ramadan_beginning_dates(self._year)
|
|
379
372
|
)
|
|
380
373
|
|
|
381
|
-
def _add_sadiq_birthday_day(self, name) ->
|
|
374
|
+
def _add_sadiq_birthday_day(self, name) -> set[date]:
|
|
382
375
|
"""
|
|
383
376
|
Add birthday of Prophet Muhammad and Ja'far al-Sadiq day (17th day of 3rd month).
|
|
384
377
|
|
|
@@ -388,7 +381,7 @@ class IslamicHolidays:
|
|
|
388
381
|
name, self._islamic_calendar.sadiq_birthday_dates(self._year)
|
|
389
382
|
)
|
|
390
383
|
|
|
391
|
-
def _add_sadiq_death_day(self, name) ->
|
|
384
|
+
def _add_sadiq_death_day(self, name) -> set[date]:
|
|
392
385
|
"""
|
|
393
386
|
Add death of Ja'far al-Sadiq day (25th day of 10th month).
|
|
394
387
|
|
|
@@ -398,7 +391,7 @@ class IslamicHolidays:
|
|
|
398
391
|
name, self._islamic_calendar.sadiq_death_dates(self._year)
|
|
399
392
|
)
|
|
400
393
|
|
|
401
|
-
def _add_tasua_day(self, name) ->
|
|
394
|
+
def _add_tasua_day(self, name) -> set[date]:
|
|
402
395
|
"""
|
|
403
396
|
Add Tasua day (9th day of 1st month).
|
|
404
397
|
|
holidays/holiday_base.py
CHANGED
|
@@ -15,11 +15,12 @@ __all__ = ("DateLike", "HolidayBase", "HolidaySum")
|
|
|
15
15
|
import copy
|
|
16
16
|
import warnings
|
|
17
17
|
from calendar import isleap
|
|
18
|
+
from collections.abc import Iterable
|
|
18
19
|
from datetime import date, datetime, timedelta, timezone
|
|
19
20
|
from functools import cached_property
|
|
20
21
|
from gettext import gettext, translation
|
|
21
22
|
from pathlib import Path
|
|
22
|
-
from typing import Any, Dict,
|
|
23
|
+
from typing import Any, Dict, Optional, Union, cast
|
|
23
24
|
|
|
24
25
|
from dateutil.parser import parse
|
|
25
26
|
|
|
@@ -42,17 +43,17 @@ from holidays.constants import HOLIDAY_NAME_DELIMITER, PUBLIC
|
|
|
42
43
|
from holidays.helpers import _normalize_arguments, _normalize_tuple
|
|
43
44
|
|
|
44
45
|
CategoryArg = Union[str, Iterable[str]]
|
|
45
|
-
DateArg = Union[date,
|
|
46
|
+
DateArg = Union[date, tuple[int, int]]
|
|
46
47
|
DateLike = Union[date, datetime, str, float, int]
|
|
47
|
-
SpecialHoliday = Union[
|
|
48
|
+
SpecialHoliday = Union[tuple[int, int, str], tuple[tuple[int, int, str], ...]]
|
|
48
49
|
SubstitutedHoliday = Union[
|
|
49
|
-
Union[
|
|
50
|
-
|
|
50
|
+
Union[tuple[int, int, int, int], tuple[int, int, int, int, int]],
|
|
51
|
+
tuple[Union[tuple[int, int, int, int], tuple[int, int, int, int, int]], ...],
|
|
51
52
|
]
|
|
52
53
|
YearArg = Union[int, Iterable[int]]
|
|
53
54
|
|
|
54
55
|
|
|
55
|
-
class HolidayBase(
|
|
56
|
+
class HolidayBase(dict[date, str]):
|
|
56
57
|
"""
|
|
57
58
|
A dict-like object containing the holidays for a specific country (and
|
|
58
59
|
province or state if so initiated); inherits the dict class (so behaves
|
|
@@ -210,12 +211,12 @@ class HolidayBase(Dict[date, str]):
|
|
|
210
211
|
"""The country's ISO 3166-1 alpha-2 code."""
|
|
211
212
|
market: str
|
|
212
213
|
"""The market's ISO 3166-1 alpha-2 code."""
|
|
213
|
-
subdivisions:
|
|
214
|
+
subdivisions: tuple[str, ...] = ()
|
|
214
215
|
"""The subdivisions supported for this country (see documentation)."""
|
|
215
|
-
subdivisions_aliases:
|
|
216
|
+
subdivisions_aliases: dict[str, str] = {}
|
|
216
217
|
"""Aliases for the ISO 3166-2 subdivision codes with the key as alias and
|
|
217
218
|
the value the ISO 3166-2 subdivision code."""
|
|
218
|
-
years:
|
|
219
|
+
years: set[int]
|
|
219
220
|
"""The years calculated."""
|
|
220
221
|
expand: bool
|
|
221
222
|
"""Whether the entire year is calculated when one date from that year
|
|
@@ -224,25 +225,25 @@ class HolidayBase(Dict[date, str]):
|
|
|
224
225
|
"""Whether dates when public holiday are observed are included."""
|
|
225
226
|
subdiv: Optional[str] = None
|
|
226
227
|
"""The subdiv requested as ISO 3166-2 code or one of the aliases."""
|
|
227
|
-
special_holidays:
|
|
228
|
+
special_holidays: dict[int, Union[SpecialHoliday, SubstitutedHoliday]] = {}
|
|
228
229
|
"""A list of the country-wide special (as opposite to regular) holidays for
|
|
229
230
|
a specific year."""
|
|
230
|
-
_deprecated_subdivisions:
|
|
231
|
+
_deprecated_subdivisions: tuple[str, ...] = ()
|
|
231
232
|
"""Other subdivisions whose names are deprecated or aliases of the official
|
|
232
233
|
ones."""
|
|
233
|
-
weekend:
|
|
234
|
+
weekend: set[int] = {SAT, SUN}
|
|
234
235
|
"""Country weekend days."""
|
|
235
|
-
weekend_workdays:
|
|
236
|
+
weekend_workdays: set[date] = set()
|
|
236
237
|
"""Working days moved to weekends."""
|
|
237
238
|
default_category: str = PUBLIC
|
|
238
239
|
"""The entity category used by default."""
|
|
239
240
|
default_language: Optional[str] = None
|
|
240
241
|
"""The entity language used by default."""
|
|
241
|
-
categories:
|
|
242
|
+
categories: set[str] = set()
|
|
242
243
|
"""Requested holiday categories."""
|
|
243
|
-
supported_categories:
|
|
244
|
+
supported_categories: tuple[str, ...] = (PUBLIC,)
|
|
244
245
|
"""All holiday categories supported by this entity."""
|
|
245
|
-
supported_languages:
|
|
246
|
+
supported_languages: tuple[str, ...] = ()
|
|
246
247
|
"""All languages supported by this entity."""
|
|
247
248
|
|
|
248
249
|
def __init__(
|
|
@@ -630,7 +631,7 @@ class HolidayBase(Dict[date, str]):
|
|
|
630
631
|
def __radd__(self, other: Any) -> "HolidayBase":
|
|
631
632
|
return self.__add__(other)
|
|
632
633
|
|
|
633
|
-
def __reduce__(self) -> Union[str,
|
|
634
|
+
def __reduce__(self) -> Union[str, tuple[Any, ...]]:
|
|
634
635
|
return super().__reduce__()
|
|
635
636
|
|
|
636
637
|
def __repr__(self) -> str:
|
|
@@ -720,9 +721,9 @@ class HolidayBase(Dict[date, str]):
|
|
|
720
721
|
)
|
|
721
722
|
|
|
722
723
|
@classmethod
|
|
723
|
-
def get_subdivision_aliases(cls) ->
|
|
724
|
+
def get_subdivision_aliases(cls) -> dict[str, list]:
|
|
724
725
|
"""Get subdivision aliases."""
|
|
725
|
-
subdivision_aliases:
|
|
726
|
+
subdivision_aliases: dict[str, list[str]] = {s: [] for s in cls.subdivisions}
|
|
726
727
|
for alias, subdivision in cls.subdivisions_aliases.items():
|
|
727
728
|
subdivision_aliases[subdivision].append(alias)
|
|
728
729
|
|
|
@@ -862,7 +863,7 @@ class HolidayBase(Dict[date, str]):
|
|
|
862
863
|
for category in self._sorted_categories
|
|
863
864
|
)
|
|
864
865
|
|
|
865
|
-
def append(self, *args: Union[
|
|
866
|
+
def append(self, *args: Union[dict[DateLike, str], list[DateLike], DateLike]) -> None:
|
|
866
867
|
"""Alias for :meth:`update` to mimic list type."""
|
|
867
868
|
return self.update(*args)
|
|
868
869
|
|
|
@@ -891,7 +892,7 @@ class HolidayBase(Dict[date, str]):
|
|
|
891
892
|
"""
|
|
892
893
|
return dict.get(self, self.__keytransform__(key), default)
|
|
893
894
|
|
|
894
|
-
def get_list(self, key: DateLike) ->
|
|
895
|
+
def get_list(self, key: DateLike) -> list[str]:
|
|
895
896
|
"""Return a list of all holiday names for a date if date is a holiday,
|
|
896
897
|
else empty string.
|
|
897
898
|
|
|
@@ -909,7 +910,7 @@ class HolidayBase(Dict[date, str]):
|
|
|
909
910
|
|
|
910
911
|
def get_named(
|
|
911
912
|
self, holiday_name: str, lookup="icontains", split_multiple_names=True
|
|
912
|
-
) ->
|
|
913
|
+
) -> list[date]:
|
|
913
914
|
"""Return a list of all holiday dates matching the provided holiday
|
|
914
915
|
name. The match will be made case insensitively and partial matches
|
|
915
916
|
will be included by default.
|
|
@@ -1025,7 +1026,7 @@ class HolidayBase(Dict[date, str]):
|
|
|
1025
1026
|
|
|
1026
1027
|
return dict.pop(self, self.__keytransform__(key), default)
|
|
1027
1028
|
|
|
1028
|
-
def pop_named(self, name: str) ->
|
|
1029
|
+
def pop_named(self, name: str) -> list[date]:
|
|
1029
1030
|
"""Remove (no longer treat at as holiday) all dates matching the
|
|
1030
1031
|
provided holiday name. The match will be made case insensitively and
|
|
1031
1032
|
partial matches will be removed.
|
|
@@ -1065,7 +1066,7 @@ class HolidayBase(Dict[date, str]):
|
|
|
1065
1066
|
return popped
|
|
1066
1067
|
|
|
1067
1068
|
def update( # type: ignore[override]
|
|
1068
|
-
self, *args: Union[
|
|
1069
|
+
self, *args: Union[dict[DateLike, str], list[DateLike], DateLike]
|
|
1069
1070
|
) -> None:
|
|
1070
1071
|
# TODO: fix arguments; should not be *args (cannot properly Type hint)
|
|
1071
1072
|
"""Update the object, overwriting existing dates.
|
|
@@ -1105,15 +1106,15 @@ class HolidaySum(HolidayBase):
|
|
|
1105
1106
|
are merged. All years are calculated (expanded) for all operands.
|
|
1106
1107
|
"""
|
|
1107
1108
|
|
|
1108
|
-
country: Union[str,
|
|
1109
|
+
country: Union[str, list[str]] # type: ignore[assignment]
|
|
1109
1110
|
"""Countries included in the addition."""
|
|
1110
|
-
market: Union[str,
|
|
1111
|
+
market: Union[str, list[str]] # type: ignore[assignment]
|
|
1111
1112
|
"""Markets included in the addition."""
|
|
1112
|
-
subdiv: Optional[Union[str,
|
|
1113
|
+
subdiv: Optional[Union[str, list[str]]] # type: ignore[assignment]
|
|
1113
1114
|
"""Subdivisions included in the addition."""
|
|
1114
|
-
holidays:
|
|
1115
|
+
holidays: list[HolidayBase]
|
|
1115
1116
|
"""The original HolidayBase objects included in the addition."""
|
|
1116
|
-
years:
|
|
1117
|
+
years: set[int]
|
|
1117
1118
|
"""The years calculated."""
|
|
1118
1119
|
|
|
1119
1120
|
def __init__(
|
|
@@ -1153,7 +1154,7 @@ country_holidays('CA') + country_holidays('MX')
|
|
|
1153
1154
|
else:
|
|
1154
1155
|
self.holidays.append(operand)
|
|
1155
1156
|
|
|
1156
|
-
kwargs:
|
|
1157
|
+
kwargs: dict[str, Any] = {}
|
|
1157
1158
|
# Join years, expand and observed.
|
|
1158
1159
|
kwargs["years"] = h1.years | h2.years
|
|
1159
1160
|
kwargs["expand"] = h1.expand or h2.expand
|
|
Binary file
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
# Germany holidays.
|
|
14
14
|
msgid ""
|
|
15
15
|
msgstr ""
|
|
16
|
-
"Project-Id-Version: Holidays 0.
|
|
16
|
+
"Project-Id-Version: Holidays 0.59\n"
|
|
17
17
|
"POT-Creation-Date: 2023-04-04 16:13+0300\n"
|
|
18
|
-
"PO-Revision-Date:
|
|
19
|
-
"Last-Translator:
|
|
18
|
+
"PO-Revision-Date: 2024-10-17 11:43+0700\n"
|
|
19
|
+
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
|
|
20
20
|
"Language-Team: Holidays localization team\n"
|
|
21
21
|
"Language: de\n"
|
|
22
22
|
"MIME-Version: 1.0\n"
|
|
@@ -24,7 +24,7 @@ msgstr ""
|
|
|
24
24
|
"Content-Transfer-Encoding: 8bit\n"
|
|
25
25
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
26
26
|
"Generated-By: pygettext.py 1.5\n"
|
|
27
|
-
"X-Generator: Poedit 3.
|
|
27
|
+
"X-Generator: Poedit 3.5\n"
|
|
28
28
|
|
|
29
29
|
#. New Year's Day.
|
|
30
30
|
msgid "Neujahr"
|
|
@@ -89,6 +89,13 @@ msgid ""
|
|
|
89
89
|
"Zweiten Weltkriegs in Europa"
|
|
90
90
|
msgstr ""
|
|
91
91
|
|
|
92
|
+
#. 80th anniversary of the liberation from Nazism and the end of the Second
|
|
93
|
+
#. World War in Europe.
|
|
94
|
+
msgid ""
|
|
95
|
+
"80. Jahrestag der Befreiung vom Nationalsozialismus und der Beendigung des "
|
|
96
|
+
"Zweiten Weltkriegs in Europa"
|
|
97
|
+
msgstr ""
|
|
98
|
+
|
|
92
99
|
#. Epiphany.
|
|
93
100
|
msgid "Heilige Drei Könige"
|
|
94
101
|
msgstr ""
|
|
Binary file
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
#
|
|
15
15
|
msgid ""
|
|
16
16
|
msgstr ""
|
|
17
|
-
"Project-Id-Version: Holidays 0.
|
|
17
|
+
"Project-Id-Version: Holidays 0.59\n"
|
|
18
18
|
"POT-Creation-Date: 2023-04-04 16:13+0300\n"
|
|
19
|
-
"PO-Revision-Date:
|
|
20
|
-
"Last-Translator:
|
|
19
|
+
"PO-Revision-Date: 2024-10-17 11:43+0700\n"
|
|
20
|
+
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
|
|
21
21
|
"Language-Team: Holidays localization team\n"
|
|
22
22
|
"Language: en_US\n"
|
|
23
23
|
"MIME-Version: 1.0\n"
|
|
@@ -25,7 +25,7 @@ msgstr ""
|
|
|
25
25
|
"Content-Transfer-Encoding: 8bit\n"
|
|
26
26
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
27
27
|
"Generated-By: pygettext.py 1.5\n"
|
|
28
|
-
"X-Generator: Poedit 3.
|
|
28
|
+
"X-Generator: Poedit 3.5\n"
|
|
29
29
|
|
|
30
30
|
#. New Year's Day.
|
|
31
31
|
msgid "Neujahr"
|
|
@@ -92,6 +92,15 @@ msgstr ""
|
|
|
92
92
|
"75th anniversary of the liberation from Nazism and the end of the Second "
|
|
93
93
|
"World War in Europe"
|
|
94
94
|
|
|
95
|
+
#. 80th anniversary of the liberation from Nazism and the end of the Second
|
|
96
|
+
#. World War in Europe.
|
|
97
|
+
msgid ""
|
|
98
|
+
"80. Jahrestag der Befreiung vom Nationalsozialismus und der Beendigung des "
|
|
99
|
+
"Zweiten Weltkriegs in Europa"
|
|
100
|
+
msgstr ""
|
|
101
|
+
"80th anniversary of the liberation from Nazism and the end of the Second "
|
|
102
|
+
"World War in Europe"
|
|
103
|
+
|
|
95
104
|
#. Epiphany.
|
|
96
105
|
msgid "Heilige Drei Könige"
|
|
97
106
|
msgstr "Epiphany"
|
|
Binary file
|