holidays 0.82__py3-none-any.whl → 0.84__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/balinese_saka.py +2 -3
- holidays/calendars/buddhist.py +3 -4
- holidays/calendars/burmese.py +9 -10
- holidays/calendars/chinese.py +8 -9
- holidays/calendars/hebrew.py +10 -11
- holidays/calendars/hindu.py +27 -28
- holidays/calendars/islamic.py +26 -6
- holidays/calendars/mandaean.py +2 -3
- holidays/calendars/mongolian.py +4 -5
- holidays/calendars/persian.py +2 -3
- holidays/calendars/sinhala.py +25 -14
- holidays/calendars/thai.py +13 -14
- holidays/calendars/tibetan.py +12 -13
- holidays/countries/__init__.py +1 -0
- holidays/countries/angola.py +1 -2
- holidays/countries/austria.py +1 -1
- holidays/countries/azerbaijan.py +1 -1
- holidays/countries/canada.py +27 -13
- holidays/countries/denmark.py +18 -6
- holidays/countries/fiji.py +2 -3
- holidays/countries/finland.py +3 -6
- holidays/countries/guernsey.py +1 -2
- holidays/countries/guyana.py +24 -32
- holidays/countries/india.py +21 -78
- holidays/countries/iran.py +133 -269
- holidays/countries/ireland.py +1 -1
- holidays/countries/israel.py +1 -1
- holidays/countries/italy.py +2 -2
- holidays/countries/jersey.py +1 -2
- holidays/countries/macau.py +5 -8
- holidays/countries/malta.py +1 -1
- holidays/countries/mauritius.py +10 -9
- holidays/countries/montserrat.py +1 -1
- holidays/countries/myanmar.py +9 -10
- 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/norway.py +1 -1
- holidays/countries/portugal.py +6 -3
- holidays/countries/rwanda.py +2 -2
- holidays/countries/sint_maarten.py +1 -1
- holidays/countries/slovakia.py +23 -4
- holidays/countries/spain.py +418 -214
- holidays/countries/sri_lanka.py +58 -91
- holidays/countries/suriname.py +1 -2
- holidays/countries/sweden.py +1 -1
- holidays/countries/switzerland.py +86 -3
- holidays/countries/taiwan.py +3 -3
- holidays/countries/tanzania.py +19 -29
- holidays/countries/thailand.py +8 -7
- holidays/countries/trinidad_and_tobago.py +1 -1
- holidays/countries/ukraine.py +1 -1
- holidays/countries/united_kingdom.py +2 -3
- holidays/countries/united_states.py +3 -4
- holidays/countries/western_sahara.py +92 -0
- holidays/groups/balinese_saka.py +2 -3
- holidays/groups/buddhist.py +6 -7
- holidays/groups/burmese.py +11 -12
- holidays/groups/chinese.py +23 -21
- holidays/groups/christian.py +30 -0
- holidays/groups/eastern.py +5 -4
- holidays/groups/hebrew.py +7 -10
- holidays/groups/hindu.py +45 -40
- holidays/groups/international.py +1 -1
- holidays/groups/islamic.py +10 -3
- holidays/groups/mandaean.py +13 -14
- holidays/groups/mongolian.py +12 -10
- holidays/groups/persian.py +14 -15
- holidays/groups/sinhala.py +19 -17
- holidays/groups/thai.py +12 -13
- holidays/groups/tibetan.py +21 -19
- holidays/holiday_base.py +54 -54
- holidays/ical.py +1 -2
- 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_US/LC_MESSAGES/CH.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/LK.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/NL.mo +0 -0
- holidays/locale/es/LC_MESSAGES/EH.mo +0 -0
- holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/fr/LC_MESSAGES/CH.mo +0 -0
- holidays/locale/fr/LC_MESSAGES/EH.mo +0 -0
- holidays/locale/fy/LC_MESSAGES/NL.mo +0 -0
- holidays/locale/it/LC_MESSAGES/CH.mo +0 -0
- holidays/locale/nl/LC_MESSAGES/NL.mo +0 -0
- holidays/locale/si_LK/LC_MESSAGES/LK.mo +0 -0
- holidays/locale/ta_LK/LC_MESSAGES/LK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/CH.mo +0 -0
- holidays/locale/th/LC_MESSAGES/CN.mo +0 -0
- holidays/locale/th/LC_MESSAGES/DK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/KR.mo +0 -0
- holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/th/LC_MESSAGES/NL.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/mixins/child_entity.py +1 -3
- holidays/observed_holiday_base.py +25 -14
- holidays/registry.py +5 -3
- holidays/utils.py +13 -14
- holidays/version.py +1 -1
- {holidays-0.82.dist-info → holidays-0.84.dist-info}/METADATA +20 -19
- {holidays-0.82.dist-info → holidays-0.84.dist-info}/RECORD +113 -104
- {holidays-0.82.dist-info → holidays-0.84.dist-info}/WHEEL +0 -0
- {holidays-0.82.dist-info → holidays-0.84.dist-info}/licenses/CONTRIBUTORS +0 -0
- {holidays-0.82.dist-info → holidays-0.84.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.82.dist-info → holidays-0.84.dist-info}/top_level.txt +0 -0
holidays/calendars/sinhala.py
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
from collections.abc import Iterable
|
|
14
14
|
from datetime import date
|
|
15
|
-
from typing import Optional
|
|
16
15
|
|
|
17
16
|
from holidays.calendars.custom import _CustomCalendar
|
|
18
17
|
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
|
|
@@ -47,7 +46,7 @@ class _SinhalaLunar:
|
|
|
47
46
|
"""
|
|
48
47
|
|
|
49
48
|
START_YEAR = 2003
|
|
50
|
-
END_YEAR =
|
|
49
|
+
END_YEAR = 2026
|
|
51
50
|
|
|
52
51
|
BAK_POYA_DATES = {
|
|
53
52
|
2003: (APR, 16),
|
|
@@ -73,6 +72,7 @@ class _SinhalaLunar:
|
|
|
73
72
|
2023: (APR, 5),
|
|
74
73
|
2024: (APR, 23),
|
|
75
74
|
2025: (APR, 12),
|
|
75
|
+
2026: (APR, 1),
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
BINARA_POYA_DATES = {
|
|
@@ -99,6 +99,7 @@ class _SinhalaLunar:
|
|
|
99
99
|
2023: (SEP, 29),
|
|
100
100
|
2024: (SEP, 17),
|
|
101
101
|
2025: (SEP, 7),
|
|
102
|
+
2026: (SEP, 26),
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
DURUTHU_POYA_DATES = {
|
|
@@ -124,6 +125,7 @@ class _SinhalaLunar:
|
|
|
124
125
|
2023: (JAN, 6),
|
|
125
126
|
2024: (JAN, 25),
|
|
126
127
|
2025: (JAN, 13),
|
|
128
|
+
2026: (JAN, 3),
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
ESALA_POYA_DATES = {
|
|
@@ -150,6 +152,7 @@ class _SinhalaLunar:
|
|
|
150
152
|
2023: (AUG, 1),
|
|
151
153
|
2024: (JUL, 20),
|
|
152
154
|
2025: (JUL, 10),
|
|
155
|
+
2026: (JUL, 29),
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
IL_POYA_DATES = {
|
|
@@ -176,6 +179,7 @@ class _SinhalaLunar:
|
|
|
176
179
|
2023: (NOV, 26),
|
|
177
180
|
2024: (NOV, 15),
|
|
178
181
|
2025: (NOV, 5),
|
|
182
|
+
2026: (NOV, 24),
|
|
179
183
|
}
|
|
180
184
|
|
|
181
185
|
MEDIN_POYA_DATES = {
|
|
@@ -202,6 +206,7 @@ class _SinhalaLunar:
|
|
|
202
206
|
2023: (MAR, 6),
|
|
203
207
|
2024: (MAR, 24),
|
|
204
208
|
2025: (MAR, 13),
|
|
209
|
+
2026: (MAR, 2),
|
|
205
210
|
}
|
|
206
211
|
|
|
207
212
|
NAWAM_POYA_DATES = {
|
|
@@ -228,6 +233,7 @@ class _SinhalaLunar:
|
|
|
228
233
|
2023: (FEB, 5),
|
|
229
234
|
2024: (FEB, 23),
|
|
230
235
|
2025: (FEB, 12),
|
|
236
|
+
2026: (FEB, 1),
|
|
231
237
|
}
|
|
232
238
|
|
|
233
239
|
NIKINI_POYA_DATES = {
|
|
@@ -254,6 +260,7 @@ class _SinhalaLunar:
|
|
|
254
260
|
2023: (AUG, 30),
|
|
255
261
|
2024: (AUG, 19),
|
|
256
262
|
2025: (AUG, 8),
|
|
263
|
+
2026: (AUG, 27),
|
|
257
264
|
}
|
|
258
265
|
|
|
259
266
|
POSON_POYA_DATES = {
|
|
@@ -280,6 +287,7 @@ class _SinhalaLunar:
|
|
|
280
287
|
2023: (JUN, 3),
|
|
281
288
|
2024: (JUN, 21),
|
|
282
289
|
2025: (JUN, 10),
|
|
290
|
+
2026: (JUN, 29),
|
|
283
291
|
}
|
|
284
292
|
|
|
285
293
|
UNDUVAP_POYA_DATES = {
|
|
@@ -306,6 +314,7 @@ class _SinhalaLunar:
|
|
|
306
314
|
2023: (DEC, 26),
|
|
307
315
|
2024: (DEC, 14),
|
|
308
316
|
2025: (DEC, 4),
|
|
317
|
+
2026: (DEC, 23),
|
|
309
318
|
}
|
|
310
319
|
|
|
311
320
|
VAP_POYA_DATES = {
|
|
@@ -332,6 +341,7 @@ class _SinhalaLunar:
|
|
|
332
341
|
2023: (OCT, 28),
|
|
333
342
|
2024: (OCT, 17),
|
|
334
343
|
2025: (OCT, 6),
|
|
344
|
+
2026: (OCT, 25),
|
|
335
345
|
}
|
|
336
346
|
|
|
337
347
|
VESAK_POYA_DATES = {
|
|
@@ -358,9 +368,10 @@ class _SinhalaLunar:
|
|
|
358
368
|
2023: (MAY, 5),
|
|
359
369
|
2024: (MAY, 23),
|
|
360
370
|
2025: (MAY, 12),
|
|
371
|
+
2026: (MAY, 1),
|
|
361
372
|
}
|
|
362
373
|
|
|
363
|
-
def _get_holiday(self, holiday: str, year: int) -> tuple[
|
|
374
|
+
def _get_holiday(self, holiday: str, year: int) -> tuple[date | None, bool]:
|
|
364
375
|
estimated_dates = getattr(self, f"{holiday}_DATES", {})
|
|
365
376
|
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
|
|
366
377
|
dt = exact_dates.get(year, estimated_dates.get(year, ()))
|
|
@@ -373,40 +384,40 @@ class _SinhalaLunar:
|
|
|
373
384
|
for dt in _normalize_tuple(exact_dates.get(year, estimated_dates.get(year, ()))):
|
|
374
385
|
yield date(year, *dt), year not in exact_dates
|
|
375
386
|
|
|
376
|
-
def bak_poya_date(self, year: int) -> tuple[
|
|
387
|
+
def bak_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
377
388
|
return self._get_holiday(BAK_POYA, year)
|
|
378
389
|
|
|
379
|
-
def binara_poya_date(self, year: int) -> tuple[
|
|
390
|
+
def binara_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
380
391
|
return self._get_holiday(BINARA_POYA, year)
|
|
381
392
|
|
|
382
393
|
def duruthu_poya_date(self, year: int) -> Iterable[tuple[date, bool]]:
|
|
383
394
|
return self._get_holiday_set(DURUTHU_POYA, year)
|
|
384
395
|
|
|
385
|
-
def esala_poya_date(self, year: int) -> tuple[
|
|
396
|
+
def esala_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
386
397
|
return self._get_holiday(ESALA_POYA, year)
|
|
387
398
|
|
|
388
|
-
def il_poya_date(self, year: int) -> tuple[
|
|
399
|
+
def il_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
389
400
|
return self._get_holiday(IL_POYA, year)
|
|
390
401
|
|
|
391
|
-
def medin_poya_date(self, year: int) -> tuple[
|
|
402
|
+
def medin_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
392
403
|
return self._get_holiday(MEDIN_POYA, year)
|
|
393
404
|
|
|
394
|
-
def nawam_poya_date(self, year: int) -> tuple[
|
|
405
|
+
def nawam_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
395
406
|
return self._get_holiday(NAWAM_POYA, year)
|
|
396
407
|
|
|
397
|
-
def nikini_poya_date(self, year: int) -> tuple[
|
|
408
|
+
def nikini_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
398
409
|
return self._get_holiday(NIKINI_POYA, year)
|
|
399
410
|
|
|
400
|
-
def poson_poya_date(self, year: int) -> tuple[
|
|
411
|
+
def poson_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
401
412
|
return self._get_holiday(POSON_POYA, year)
|
|
402
413
|
|
|
403
|
-
def unduvap_poya_date(self, year: int) -> tuple[
|
|
414
|
+
def unduvap_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
404
415
|
return self._get_holiday(UNDUVAP_POYA, year)
|
|
405
416
|
|
|
406
|
-
def vap_poya_date(self, year: int) -> tuple[
|
|
417
|
+
def vap_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
407
418
|
return self._get_holiday(VAP_POYA, year)
|
|
408
419
|
|
|
409
|
-
def vesak_poya_date(self, year: int) -> tuple[
|
|
420
|
+
def vesak_poya_date(self, year: int) -> tuple[date | None, bool]:
|
|
410
421
|
return self._get_holiday(VESAK_POYA, year)
|
|
411
422
|
|
|
412
423
|
|
holidays/calendars/thai.py
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
14
|
from functools import cache
|
|
15
|
-
from typing import Optional
|
|
16
15
|
|
|
17
16
|
from holidays.calendars.gregorian import _timedelta
|
|
18
17
|
|
|
@@ -296,7 +295,7 @@ class _ThaiLunisolar:
|
|
|
296
295
|
)
|
|
297
296
|
|
|
298
297
|
@cache
|
|
299
|
-
def _get_start_date(self, year: int) ->
|
|
298
|
+
def _get_start_date(self, year: int) -> date | None:
|
|
300
299
|
"""Calculate the start date of that particular Thai Lunar Calendar Year.
|
|
301
300
|
|
|
302
301
|
This usually falls in November or December of the previous Gregorian
|
|
@@ -367,7 +366,7 @@ class _ThaiLunisolar:
|
|
|
367
366
|
|
|
368
367
|
return buddhist_sabbaths
|
|
369
368
|
|
|
370
|
-
def makha_bucha_date(self, year: int, calendar=None) ->
|
|
369
|
+
def makha_bucha_date(self, year: int, calendar=None) -> date | None:
|
|
371
370
|
"""Calculate the estimated Gregorian date of Makha Bucha.
|
|
372
371
|
|
|
373
372
|
Also known as "Magha Puja", "Makha Buxha" and "Meak Bochea".
|
|
@@ -415,7 +414,7 @@ class _ThaiLunisolar:
|
|
|
415
414
|
else +73,
|
|
416
415
|
)
|
|
417
416
|
|
|
418
|
-
def visakha_bucha_date(self, year: int, calendar=None) ->
|
|
417
|
+
def visakha_bucha_date(self, year: int, calendar=None) -> date | None:
|
|
419
418
|
"""Calculate the estimated Gregorian date of Visakha Bucha.
|
|
420
419
|
|
|
421
420
|
Also known as "Vesak" and "Buddha Day". This coincides with
|
|
@@ -462,7 +461,7 @@ class _ThaiLunisolar:
|
|
|
462
461
|
else +161,
|
|
463
462
|
)
|
|
464
463
|
|
|
465
|
-
def preah_neangkoal_date(self, year: int) ->
|
|
464
|
+
def preah_neangkoal_date(self, year: int) -> date | None:
|
|
466
465
|
"""Calculate the estimated Gregorian date of Preah Neangkoal.
|
|
467
466
|
|
|
468
467
|
Also known as "Cambodian Royal Ploughing Ceremony". This always
|
|
@@ -494,7 +493,7 @@ class _ThaiLunisolar:
|
|
|
494
493
|
|
|
495
494
|
return _timedelta(start_date, +165)
|
|
496
495
|
|
|
497
|
-
def atthami_bucha_date(self, year: int, calendar=None) ->
|
|
496
|
+
def atthami_bucha_date(self, year: int, calendar=None) -> date | None:
|
|
498
497
|
"""Calculate the estimated Gregorian date of Atthami Bucha.
|
|
499
498
|
|
|
500
499
|
Also known as "Buddha's Cremation Day". This coincides with
|
|
@@ -543,7 +542,7 @@ class _ThaiLunisolar:
|
|
|
543
542
|
else +169,
|
|
544
543
|
)
|
|
545
544
|
|
|
546
|
-
def asarnha_bucha_date(self, year: int) ->
|
|
545
|
+
def asarnha_bucha_date(self, year: int) -> date | None:
|
|
547
546
|
"""Calculate the estimated Gregorian date of Asarnha Bucha.
|
|
548
547
|
|
|
549
548
|
Also known as "Asalha Puja". This coincides with
|
|
@@ -583,7 +582,7 @@ class _ThaiLunisolar:
|
|
|
583
582
|
delta_days = +220
|
|
584
583
|
return _timedelta(start_date, delta_days)
|
|
585
584
|
|
|
586
|
-
def khao_phansa_date(self, year: int) ->
|
|
585
|
+
def khao_phansa_date(self, year: int) -> date | None:
|
|
587
586
|
"""Calculate the estimated Gregorian date of Khao Phansa.
|
|
588
587
|
|
|
589
588
|
Also known as "(Start of) Buddhist Lent" and "Start of Vassa".
|
|
@@ -623,7 +622,7 @@ class _ThaiLunisolar:
|
|
|
623
622
|
delta_days = +221
|
|
624
623
|
return _timedelta(start_date, delta_days)
|
|
625
624
|
|
|
626
|
-
def boun_haw_khao_padapdin_date(self, year: int) ->
|
|
625
|
+
def boun_haw_khao_padapdin_date(self, year: int) -> date | None:
|
|
627
626
|
"""Calculate the estimated Gregorian date of Boun Haw Khao Padapdin.
|
|
628
627
|
|
|
629
628
|
Also known as "Boon Khao Padap Din".
|
|
@@ -660,7 +659,7 @@ class _ThaiLunisolar:
|
|
|
660
659
|
delta_days = +264
|
|
661
660
|
return _timedelta(start_date, delta_days)
|
|
662
661
|
|
|
663
|
-
def boun_haw_khao_salark_date(self, year: int) ->
|
|
662
|
+
def boun_haw_khao_salark_date(self, year: int) -> date | None:
|
|
664
663
|
"""Calculate the estimated Gregorian date of Boun Haw Khao Salark.
|
|
665
664
|
|
|
666
665
|
Also known as "Boon Khao Sak".
|
|
@@ -697,7 +696,7 @@ class _ThaiLunisolar:
|
|
|
697
696
|
delta_days = +279
|
|
698
697
|
return _timedelta(start_date, delta_days)
|
|
699
698
|
|
|
700
|
-
def pchum_ben_date(self, year: int) ->
|
|
699
|
+
def pchum_ben_date(self, year: int) -> date | None:
|
|
701
700
|
"""Calculate the estimated Gregorian date of Pchum Ben.
|
|
702
701
|
|
|
703
702
|
Also known as "Prachum Bandar".
|
|
@@ -734,7 +733,7 @@ class _ThaiLunisolar:
|
|
|
734
733
|
delta_days = +294
|
|
735
734
|
return _timedelta(start_date, delta_days)
|
|
736
735
|
|
|
737
|
-
def ok_phansa_date(self, year: int) ->
|
|
736
|
+
def ok_phansa_date(self, year: int) -> date | None:
|
|
738
737
|
"""Calculate the estimated Gregorian date of Ok Phansa.
|
|
739
738
|
|
|
740
739
|
Also known as "End of Buddhist Lent" and "End of Vassa".
|
|
@@ -771,7 +770,7 @@ class _ThaiLunisolar:
|
|
|
771
770
|
delta_days = +309
|
|
772
771
|
return _timedelta(start_date, delta_days)
|
|
773
772
|
|
|
774
|
-
def boun_suang_heua_date(self, year: int) ->
|
|
773
|
+
def boun_suang_heua_date(self, year: int) -> date | None:
|
|
775
774
|
"""Calculate the estimated Gregorian date of Ok Boun Suang Huea.
|
|
776
775
|
|
|
777
776
|
Boun Suang Huea Nakhone Luang Prabang, also known as "Vientiane Boat Racing Festival".
|
|
@@ -808,7 +807,7 @@ class _ThaiLunisolar:
|
|
|
808
807
|
delta_days = +310
|
|
809
808
|
return _timedelta(start_date, delta_days)
|
|
810
809
|
|
|
811
|
-
def loy_krathong_date(self, year: int) ->
|
|
810
|
+
def loy_krathong_date(self, year: int) -> date | None:
|
|
812
811
|
"""Calculate the estimated Gregorian date of Loy Krathong.
|
|
813
812
|
|
|
814
813
|
Also known as "Boun That Louang" and "Bon Om Touk".
|
holidays/calendars/tibetan.py
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from typing import Optional
|
|
15
14
|
|
|
16
15
|
from holidays.calendars.custom import _CustomCalendar
|
|
17
16
|
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV
|
|
@@ -1422,43 +1421,43 @@ class _TibetanLunisolar:
|
|
|
1422
1421
|
2099: (JAN, 2),
|
|
1423
1422
|
}
|
|
1424
1423
|
|
|
1425
|
-
def _get_holiday(self, holiday: str, year: int) -> tuple[
|
|
1424
|
+
def _get_holiday(self, holiday: str, year: int) -> tuple[date | None, bool]:
|
|
1426
1425
|
estimated_dates = getattr(self, f"{holiday}_DATES", {})
|
|
1427
1426
|
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
|
|
1428
1427
|
dt = exact_dates.get(year, estimated_dates.get(year, ()))
|
|
1429
1428
|
return date(year, *dt) if dt else None, year not in exact_dates
|
|
1430
1429
|
|
|
1431
|
-
def blessed_rainy_day_date(self, year: int) -> tuple[
|
|
1430
|
+
def blessed_rainy_day_date(self, year: int) -> tuple[date | None, bool]:
|
|
1432
1431
|
return self._get_holiday(BLESSED_RAINY_DAY, year)
|
|
1433
1432
|
|
|
1434
|
-
def birth_of_guru_rinpoche_date(self, year: int) -> tuple[
|
|
1433
|
+
def birth_of_guru_rinpoche_date(self, year: int) -> tuple[date | None, bool]:
|
|
1435
1434
|
return self._get_holiday(BIRTH_OF_GURU_RINPOCHE, year)
|
|
1436
1435
|
|
|
1437
|
-
def buddha_first_sermon_date(self, year: int) -> tuple[
|
|
1436
|
+
def buddha_first_sermon_date(self, year: int) -> tuple[date | None, bool]:
|
|
1438
1437
|
return self._get_holiday(BUDDHA_FIRST_SERMON, year)
|
|
1439
1438
|
|
|
1440
|
-
def buddha_parinirvana_date(self, year: int) -> tuple[
|
|
1439
|
+
def buddha_parinirvana_date(self, year: int) -> tuple[date | None, bool]:
|
|
1441
1440
|
return self._get_holiday(BUDDHA_PARINIRVANA, year)
|
|
1442
1441
|
|
|
1443
|
-
def day_of_offering_date(self, year: int) -> tuple[
|
|
1442
|
+
def day_of_offering_date(self, year: int) -> tuple[date | None, bool]:
|
|
1444
1443
|
return self._get_holiday(DAY_OF_OFFERING, year)
|
|
1445
1444
|
|
|
1446
|
-
def death_of_zhabdrung_date(self, year: int) -> tuple[
|
|
1445
|
+
def death_of_zhabdrung_date(self, year: int) -> tuple[date | None, bool]:
|
|
1447
1446
|
return self._get_holiday(DEATH_OF_ZHABDRUNG, year)
|
|
1448
1447
|
|
|
1449
|
-
def descending_day_of_lord_buddha_date(self, year: int) -> tuple[
|
|
1448
|
+
def descending_day_of_lord_buddha_date(self, year: int) -> tuple[date | None, bool]:
|
|
1450
1449
|
return self._get_holiday(DESCENDING_DAY_OF_LORD_BUDDHA, year)
|
|
1451
1450
|
|
|
1452
|
-
def losar_date(self, year: int) -> tuple[
|
|
1451
|
+
def losar_date(self, year: int) -> tuple[date | None, bool]:
|
|
1453
1452
|
return self._get_holiday(LOSAR, year)
|
|
1454
1453
|
|
|
1455
|
-
def thimphu_drubchen_date(self, year: int) -> tuple[
|
|
1454
|
+
def thimphu_drubchen_date(self, year: int) -> tuple[date | None, bool]:
|
|
1456
1455
|
return self._get_holiday(THIMPHU_DRUBCHEN, year)
|
|
1457
1456
|
|
|
1458
|
-
def thimphu_tshechu_date(self, year: int) -> tuple[
|
|
1457
|
+
def thimphu_tshechu_date(self, year: int) -> tuple[date | None, bool]:
|
|
1459
1458
|
return self._get_holiday(THIMPHU_TSHECHU, year)
|
|
1460
1459
|
|
|
1461
|
-
def tibetan_winter_solstice_date(self, year: int) -> tuple[
|
|
1460
|
+
def tibetan_winter_solstice_date(self, year: int) -> tuple[date | None, bool]:
|
|
1462
1461
|
return self._get_holiday(WINTER_SOLSTICE, year)
|
|
1463
1462
|
|
|
1464
1463
|
|
holidays/countries/__init__.py
CHANGED
|
@@ -293,6 +293,7 @@ from holidays.countries.vatican_city import VaticanCity, VA, VAT
|
|
|
293
293
|
from holidays.countries.venezuela import Venezuela, VE, VEN
|
|
294
294
|
from holidays.countries.vietnam import Vietnam, VN, VNM
|
|
295
295
|
from holidays.countries.wallis_and_futuna import WallisAndFutuna, WF, WLF, HolidaysWF
|
|
296
|
+
from holidays.countries.western_sahara import WesternSahara, EH, ESH
|
|
296
297
|
from holidays.countries.yemen import Yemen, YE, YEM
|
|
297
298
|
from holidays.countries.zambia import Zambia, ZM, ZMB
|
|
298
299
|
from holidays.countries.zimbabwe import Zimbabwe, ZW, ZWE
|
holidays/countries/angola.py
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
14
|
from gettext import gettext as tr
|
|
15
|
-
from typing import Optional
|
|
16
15
|
|
|
17
16
|
from holidays.calendars.gregorian import AUG, SEP
|
|
18
17
|
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
@@ -62,7 +61,7 @@ class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
|
|
|
62
61
|
# it rolls over to the following Monday.
|
|
63
62
|
return dt >= date(1996, SEP, 27)
|
|
64
63
|
|
|
65
|
-
def _add_observed(self, dt: date, **kwargs) -> tuple[bool,
|
|
64
|
+
def _add_observed(self, dt: date, **kwargs) -> tuple[bool, date | None]:
|
|
66
65
|
# As per Law # #11/18, from 2018/9/10, when public holiday falls on Tuesday or Thursday,
|
|
67
66
|
# the Monday or Friday is also a holiday.
|
|
68
67
|
kwargs.setdefault(
|
holidays/countries/austria.py
CHANGED
|
@@ -124,7 +124,7 @@ class Austria(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
124
124
|
|
|
125
125
|
def _populate_subdiv_1_bank_holidays(self):
|
|
126
126
|
# Saint Martin's Day.
|
|
127
|
-
self.
|
|
127
|
+
self._add_saint_martins_day(tr("Hl. Martin"))
|
|
128
128
|
|
|
129
129
|
def _populate_subdiv_2_bank_holidays(self):
|
|
130
130
|
# Saint Joseph's Day.
|
holidays/countries/azerbaijan.py
CHANGED
|
@@ -172,7 +172,7 @@ class Azerbaijan(ObservedHolidayBase, InternationalHolidays, IslamicHolidays, St
|
|
|
172
172
|
continue
|
|
173
173
|
for holiday_name in dt_holidays:
|
|
174
174
|
if any(bayrami_name in holiday_name for bayrami_name in bayrami_names):
|
|
175
|
-
self._add_observed(dt_observed, holiday_name, WORKDAY_TO_NEXT_WORKDAY)
|
|
175
|
+
self._add_observed(dt_observed, holiday_name, rule=WORKDAY_TO_NEXT_WORKDAY)
|
|
176
176
|
|
|
177
177
|
def _populate_workday_holidays(self):
|
|
178
178
|
if self._year >= 2021:
|
holidays/countries/canada.py
CHANGED
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
14
|
from gettext import gettext as tr
|
|
15
|
-
from typing import Optional
|
|
16
15
|
|
|
17
|
-
from holidays.calendars.gregorian import
|
|
16
|
+
from holidays.calendars.gregorian import APR, SEP
|
|
18
17
|
from holidays.constants import GOVERNMENT, OPTIONAL, PUBLIC
|
|
19
18
|
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
20
19
|
from holidays.observed_holiday_base import (
|
|
@@ -101,9 +100,6 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
|
|
|
101
100
|
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
|
|
102
101
|
super().__init__(*args, **kwargs)
|
|
103
102
|
|
|
104
|
-
def _get_nearest_monday(self, *args) -> Optional[date]:
|
|
105
|
-
return self._get_observed_date(date(self._year, *args), rule=ALL_TO_NEAREST_MON)
|
|
106
|
-
|
|
107
103
|
def _add_statutory_holidays(self):
|
|
108
104
|
"""Nationwide statutory holidays."""
|
|
109
105
|
|
|
@@ -336,24 +332,42 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
|
|
|
336
332
|
|
|
337
333
|
def _populate_subdiv_nl_optional_holidays(self):
|
|
338
334
|
if self._year >= 1900:
|
|
339
|
-
|
|
340
|
-
|
|
335
|
+
self._move_holiday_forced(
|
|
336
|
+
# Saint Patrick's Day.
|
|
337
|
+
self._add_saint_patricks_day(tr("Saint Patrick's Day")),
|
|
338
|
+
rule=ALL_TO_NEAREST_MON,
|
|
339
|
+
)
|
|
341
340
|
|
|
342
341
|
if self._year >= 1990:
|
|
343
342
|
# Nearest Monday to April 23
|
|
344
343
|
# 4/26 is the Monday closer to 4/23 in 2010
|
|
345
344
|
# but the holiday was observed on 4/19? Crazy Newfies!
|
|
346
|
-
|
|
345
|
+
|
|
347
346
|
# Saint George's Day.
|
|
348
|
-
|
|
347
|
+
name = tr("Saint George's Day")
|
|
348
|
+
|
|
349
|
+
if self._year == 2010:
|
|
350
|
+
self._add_holiday_apr_19(name)
|
|
351
|
+
else:
|
|
352
|
+
# Prevents overlap with Good Friday.
|
|
353
|
+
self._add_holiday(
|
|
354
|
+
name,
|
|
355
|
+
self._get_observed_date(date(self._year, APR, 23), rule=ALL_TO_NEAREST_MON),
|
|
356
|
+
)
|
|
349
357
|
|
|
350
358
|
if self._year >= 1997:
|
|
351
|
-
|
|
352
|
-
|
|
359
|
+
self._move_holiday_forced(
|
|
360
|
+
# Discovery Day.
|
|
361
|
+
self._add_holiday_jun_24(tr("Discovery Day")),
|
|
362
|
+
rule=ALL_TO_NEAREST_MON,
|
|
363
|
+
)
|
|
353
364
|
|
|
354
365
|
if self._year >= 1900:
|
|
355
|
-
|
|
356
|
-
|
|
366
|
+
self._move_holiday_forced(
|
|
367
|
+
# Orangemen's Day.
|
|
368
|
+
self._add_holiday_jul_12(tr("Orangemen's Day")),
|
|
369
|
+
rule=ALL_TO_NEAREST_MON,
|
|
370
|
+
)
|
|
357
371
|
|
|
358
372
|
self._add_thanksgiving_day()
|
|
359
373
|
|
holidays/countries/denmark.py
CHANGED
|
@@ -22,14 +22,21 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
22
22
|
|
|
23
23
|
References:
|
|
24
24
|
* <https://en.wikipedia.org/wiki/Public_holidays_in_Denmark>
|
|
25
|
+
* <https://da.wikipedia.org/wiki/Danske_helligdage>
|
|
26
|
+
* <https://da.wikipedia.org/wiki/Helligdagsreformen_af_1770>
|
|
25
27
|
* <https://web.archive.org/web/20250422010005/https://www.norden.org/en/info-norden/public-holidays-denmark>
|
|
26
28
|
* <https://web.archive.org/web/20231219155820/http://www.ft.dk/samling/20222/lovforslag/l13/index.htm>
|
|
29
|
+
* <https://web.archive.org/web/20250119084025/https://www.retsinformation.dk/eli/lta/2023/214>
|
|
30
|
+
* <https://web.archive.org/web/20251016080453/https://cphpost.dk/2025-05-01/life-in-denmark/what-happens-on-the-1st-of-may/>
|
|
31
|
+
* <https://web.archive.org/web/20140202200655/https://bibliotek.kk.dk/biblioteker/blog/grundlovsdag-dens-traditioner>
|
|
27
32
|
"""
|
|
28
33
|
|
|
29
34
|
country = "DK"
|
|
30
35
|
default_language = "da"
|
|
36
|
+
# The Helligdagsreformen af 1770 was in effect from October 16th, 1770 onwards.
|
|
37
|
+
start_year = 1771
|
|
31
38
|
supported_categories = (OPTIONAL, PUBLIC)
|
|
32
|
-
supported_languages = ("da", "en_US", "uk")
|
|
39
|
+
supported_languages = ("da", "en_US", "th", "uk")
|
|
33
40
|
|
|
34
41
|
def __init__(self, *args, **kwargs):
|
|
35
42
|
ChristianHolidays.__init__(self)
|
|
@@ -52,6 +59,7 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
52
59
|
# Easter Monday.
|
|
53
60
|
self._add_easter_monday(tr("Anden påskedag"))
|
|
54
61
|
|
|
62
|
+
# Removed via Act no. 214 of 06/03/2023, in effect January 1st, 2024.
|
|
55
63
|
if self._year <= 2023:
|
|
56
64
|
# Great Day of Prayers.
|
|
57
65
|
self._add_holiday_26_days_past_easter(tr("Store bededag"))
|
|
@@ -72,11 +80,15 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
72
80
|
self._add_christmas_day_two(tr("Anden juledag"))
|
|
73
81
|
|
|
74
82
|
def _populate_optional_holidays(self):
|
|
75
|
-
#
|
|
76
|
-
self.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
# First observance in 1890.
|
|
84
|
+
if self._year >= 1890:
|
|
85
|
+
# Workers' Day.
|
|
86
|
+
self._add_labor_day(tr("Arbejdernes kampdag"))
|
|
87
|
+
|
|
88
|
+
# Gained its statutory day-off status in 1891.
|
|
89
|
+
if self._year >= 1891:
|
|
90
|
+
# Constitution Day.
|
|
91
|
+
self._add_holiday_jun_5(tr("Grundlovsdag"))
|
|
80
92
|
|
|
81
93
|
# Christmas Eve.
|
|
82
94
|
self._add_christmas_eve(tr("Juleaftensdag"))
|
holidays/countries/fiji.py
CHANGED
|
@@ -108,11 +108,10 @@ class Fiji(
|
|
|
108
108
|
self._add_observed(self._add_holiday_sep_7("Constitution Day"))
|
|
109
109
|
|
|
110
110
|
if self._year >= 2023:
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
self._move_holiday_forced(
|
|
112
|
+
# Girmit Day.
|
|
113
113
|
self._add_holiday_may_14("Girmit Day"),
|
|
114
114
|
rule=ALL_TO_NEAREST_MON,
|
|
115
|
-
show_observed_label=False,
|
|
116
115
|
)
|
|
117
116
|
|
|
118
117
|
# Ratu Sir Lala Sukuna Day.
|
holidays/countries/finland.py
CHANGED
|
@@ -215,14 +215,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
215
215
|
# Become a Flag Day in 1952.
|
|
216
216
|
# Also considered the "Day of Finnish Heritage" from 1978 onward.
|
|
217
217
|
if self._year >= 1952:
|
|
218
|
-
|
|
218
|
+
self._add_holiday_may_12(
|
|
219
219
|
# J. V. Snellman Day, Day of Finnish Heritage.
|
|
220
220
|
tr("J.V. Snellmanin päivä, suomalaisuuden päivä")
|
|
221
221
|
if self._year >= 1978
|
|
222
222
|
# J. V. Snellman Day.
|
|
223
223
|
else tr("J.V. Snellmanin päivä")
|
|
224
224
|
)
|
|
225
|
-
self._add_holiday_may_12(name)
|
|
226
225
|
|
|
227
226
|
# Become a Flag Day in 1977.
|
|
228
227
|
if self._year >= 1977:
|
|
@@ -248,14 +247,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
248
247
|
# Become a Flag Day in 1950.
|
|
249
248
|
# Also considered the "Day of Finnish Literature" from 1978 onward.
|
|
250
249
|
if self._year >= 1950:
|
|
251
|
-
|
|
250
|
+
self._add_holiday_oct_10(
|
|
252
251
|
# Aleksis Kivi Day, Day of Finnish Literature.
|
|
253
252
|
tr("Aleksis Kiven päivä, suomalaisen kirjallisuuden päivä")
|
|
254
253
|
if self._year >= 1978
|
|
255
254
|
# Aleksis Kivi Day.
|
|
256
255
|
else tr("Aleksis Kiven päivä")
|
|
257
256
|
)
|
|
258
|
-
self._add_holiday_oct_10(name)
|
|
259
257
|
|
|
260
258
|
# Become a Flag Day in 1987.
|
|
261
259
|
if self._year >= 1987:
|
|
@@ -310,14 +308,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
310
308
|
# Become a Flag Day in 1942.
|
|
311
309
|
# Got its current name in 1950.
|
|
312
310
|
if self._year >= 1942:
|
|
313
|
-
|
|
311
|
+
self._add_holiday_jun_6(
|
|
314
312
|
# Flag Day of the Finnish Defense Forces.
|
|
315
313
|
tr("Puolustusvoimain lippujuhlan päivä")
|
|
316
314
|
if self._year >= 1950
|
|
317
315
|
# Birthday of the Marshal of Finland.
|
|
318
316
|
else tr("Suomen marsalkan syntymäpäivä")
|
|
319
317
|
)
|
|
320
|
-
self._add_holiday_jun_6(name)
|
|
321
318
|
|
|
322
319
|
# Day of the Finnish Flag was first created in 1934.
|
|
323
320
|
# This coincides with Midsummer Day.
|
holidays/countries/guernsey.py
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from typing import Optional
|
|
15
14
|
|
|
16
15
|
from holidays.calendars.gregorian import JAN, APR, MAY, JUN, JUL, SEP, OCT, DEC
|
|
17
16
|
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
@@ -53,7 +52,7 @@ class Guernsey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
|
|
|
53
52
|
kwargs.setdefault("observed_since", 1955)
|
|
54
53
|
ObservedHolidayBase.__init__(self, *args, **kwargs)
|
|
55
54
|
|
|
56
|
-
def _add_observed(self, dt: date, **kwargs) -> tuple[bool,
|
|
55
|
+
def _add_observed(self, dt: date, **kwargs) -> tuple[bool, date | None]:
|
|
57
56
|
# Prior to 2009, in-lieu are only given for Sundays.
|
|
58
57
|
# https://web.archive.org/web/20230930101652/https://guernseylegalresources.gg/CHttpHandler.ashx?documentid=55179
|
|
59
58
|
kwargs.setdefault(
|