holidays 0.83__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/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/angola.py +1 -2
- holidays/countries/austria.py +1 -1
- holidays/countries/guernsey.py +1 -2
- holidays/countries/italy.py +2 -2
- holidays/countries/jersey.py +1 -2
- holidays/countries/malta.py +1 -1
- holidays/countries/portugal.py +6 -3
- holidays/countries/sint_maarten.py +1 -1
- holidays/countries/spain.py +418 -214
- holidays/countries/sri_lanka.py +37 -33
- holidays/countries/taiwan.py +2 -2
- holidays/countries/united_kingdom.py +1 -2
- holidays/countries/united_states.py +1 -2
- holidays/groups/balinese_saka.py +2 -3
- holidays/groups/buddhist.py +4 -5
- holidays/groups/burmese.py +11 -12
- holidays/groups/chinese.py +18 -19
- holidays/groups/christian.py +20 -0
- holidays/groups/eastern.py +2 -3
- holidays/groups/hebrew.py +7 -10
- holidays/groups/hindu.py +36 -37
- holidays/groups/mandaean.py +13 -14
- holidays/groups/mongolian.py +7 -8
- holidays/groups/persian.py +14 -15
- holidays/groups/sinhala.py +13 -14
- holidays/groups/thai.py +12 -13
- holidays/groups/tibetan.py +16 -17
- holidays/holiday_base.py +34 -33
- holidays/ical.py +1 -2
- holidays/locale/ca/LC_MESSAGES/ES.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/es/LC_MESSAGES/ES.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/CN.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/uk/LC_MESSAGES/ES.mo +0 -0
- holidays/mixins/child_entity.py +1 -3
- holidays/observed_holiday_base.py +12 -13
- holidays/registry.py +3 -3
- holidays/utils.py +13 -14
- holidays/version.py +1 -1
- {holidays-0.83.dist-info → holidays-0.84.dist-info}/METADATA +3 -4
- {holidays-0.83.dist-info → holidays-0.84.dist-info}/RECORD +64 -63
- {holidays-0.83.dist-info → holidays-0.84.dist-info}/WHEEL +0 -0
- {holidays-0.83.dist-info → holidays-0.84.dist-info}/licenses/CONTRIBUTORS +0 -0
- {holidays-0.83.dist-info → holidays-0.84.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.83.dist-info → holidays-0.84.dist-info}/top_level.txt +0 -0
|
@@ -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 MAR, APR
|
|
17
16
|
|
|
@@ -99,11 +98,11 @@ class _BalineseSakaLunar:
|
|
|
99
98
|
2050: (MAR, 24),
|
|
100
99
|
}
|
|
101
100
|
|
|
102
|
-
def _get_holiday(self, holiday: str, year: int) ->
|
|
101
|
+
def _get_holiday(self, holiday: str, year: int) -> date | None:
|
|
103
102
|
dt = getattr(self, f"{holiday}_DATES", {}).get(year, ())
|
|
104
103
|
return date(year, *dt) if dt else None
|
|
105
104
|
|
|
106
|
-
def nyepi_date(self, year: int) ->
|
|
105
|
+
def nyepi_date(self, year: int) -> date | None:
|
|
107
106
|
"""
|
|
108
107
|
Data References:
|
|
109
108
|
* [1983-2025](https://id.wikipedia.org/wiki/Indonesia_dalam_tahun_1983)
|
holidays/calendars/buddhist.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 MAY, JUN
|
|
@@ -427,16 +426,16 @@ class _BuddhistLunisolar:
|
|
|
427
426
|
2100: (MAY, 23),
|
|
428
427
|
}
|
|
429
428
|
|
|
430
|
-
def _get_holiday(self, holiday: str, year: int) -> tuple[
|
|
429
|
+
def _get_holiday(self, holiday: str, year: int) -> tuple[date | None, bool]:
|
|
431
430
|
estimated_dates = getattr(self, f"{holiday}_DATES", {})
|
|
432
431
|
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
|
|
433
432
|
dt = exact_dates.get(year, estimated_dates.get(year, ()))
|
|
434
433
|
return date(year, *dt) if dt else None, year not in exact_dates
|
|
435
434
|
|
|
436
|
-
def vesak_date(self, year: int) -> tuple[
|
|
435
|
+
def vesak_date(self, year: int) -> tuple[date | None, bool]:
|
|
437
436
|
return self._get_holiday(VESAK, year)
|
|
438
437
|
|
|
439
|
-
def vesak_may_date(self, year: int) -> tuple[
|
|
438
|
+
def vesak_may_date(self, year: int) -> tuple[date | None, bool]:
|
|
440
439
|
return self._get_holiday(VESAK_MAY, year)
|
|
441
440
|
|
|
442
441
|
|
holidays/calendars/burmese.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
|
|
|
@@ -124,7 +123,7 @@ class _BurmeseLunisolar:
|
|
|
124
123
|
return date(y, m, d)
|
|
125
124
|
|
|
126
125
|
@cache
|
|
127
|
-
def _get_start_date(self, year: int) ->
|
|
126
|
+
def _get_start_date(self, year: int) -> date | None:
|
|
128
127
|
if year < self.START_YEAR or year > self.END_YEAR:
|
|
129
128
|
return None
|
|
130
129
|
|
|
@@ -137,7 +136,7 @@ class _BurmeseLunisolar:
|
|
|
137
136
|
|
|
138
137
|
return _timedelta(self.START_DATE, delta_days)
|
|
139
138
|
|
|
140
|
-
def thingyan_dates(self, year: int) -> tuple[
|
|
139
|
+
def thingyan_dates(self, year: int) -> tuple[date | None, date | None]:
|
|
141
140
|
"""Calculate key dates of Thingyan (Myanmar New Year festival) - Akya day
|
|
142
141
|
and Atat day.
|
|
143
142
|
|
|
@@ -157,7 +156,7 @@ class _BurmeseLunisolar:
|
|
|
157
156
|
|
|
158
157
|
return self.jdn_to_gregorian(round(jk)), self.jdn_to_gregorian(round(ja))
|
|
159
158
|
|
|
160
|
-
def kason_full_moon_date(self, year: int) ->
|
|
159
|
+
def kason_full_moon_date(self, year: int) -> date | None:
|
|
161
160
|
"""Calculate the Gregorian date of Full Moon Day of Kason.
|
|
162
161
|
|
|
163
162
|
15th day of 2nd month (Kason).
|
|
@@ -180,7 +179,7 @@ class _BurmeseLunisolar:
|
|
|
180
179
|
|
|
181
180
|
return _timedelta(start_date, +43)
|
|
182
181
|
|
|
183
|
-
def waso_full_moon_date(self, year: int) ->
|
|
182
|
+
def waso_full_moon_date(self, year: int) -> date | None:
|
|
184
183
|
"""Calculate the Gregorian date of Full Moon Day of Waso.
|
|
185
184
|
|
|
186
185
|
15th day of 4th month (Waso).
|
|
@@ -203,7 +202,7 @@ class _BurmeseLunisolar:
|
|
|
203
202
|
|
|
204
203
|
return _timedelta(next_year_start_date, -252)
|
|
205
204
|
|
|
206
|
-
def thadingyut_full_moon_date(self, year: int) ->
|
|
205
|
+
def thadingyut_full_moon_date(self, year: int) -> date | None:
|
|
207
206
|
"""Calculate the Gregorian date of Full Moon Day of Thadingyut.
|
|
208
207
|
|
|
209
208
|
15th day of 7th month (Thadingyut).
|
|
@@ -226,7 +225,7 @@ class _BurmeseLunisolar:
|
|
|
226
225
|
|
|
227
226
|
return _timedelta(next_year_start_date, -163)
|
|
228
227
|
|
|
229
|
-
def tazaungmon_waxing_moon_date(self, year: int) ->
|
|
228
|
+
def tazaungmon_waxing_moon_date(self, year: int) -> date | None:
|
|
230
229
|
"""Calculate the Gregorian date of 1st Waxing Day of Tazaungmon.
|
|
231
230
|
|
|
232
231
|
1st day of 8th month (Tazaungmon).
|
|
@@ -249,7 +248,7 @@ class _BurmeseLunisolar:
|
|
|
249
248
|
|
|
250
249
|
return _timedelta(next_year_start_date, -148)
|
|
251
250
|
|
|
252
|
-
def tazaungmon_full_moon_date(self, year: int) ->
|
|
251
|
+
def tazaungmon_full_moon_date(self, year: int) -> date | None:
|
|
253
252
|
"""Calculate the Gregorian date of Full Moon Day of Tazaungmon.
|
|
254
253
|
|
|
255
254
|
15th day of 8th month (Tazaungmon).
|
|
@@ -272,7 +271,7 @@ class _BurmeseLunisolar:
|
|
|
272
271
|
|
|
273
272
|
return _timedelta(next_year_start_date, -134)
|
|
274
273
|
|
|
275
|
-
def pyatho_waxing_moon_date(self, year: int) ->
|
|
274
|
+
def pyatho_waxing_moon_date(self, year: int) -> date | None:
|
|
276
275
|
"""Calculate the Gregorian date of 1st Waxing Day of Pyatho.
|
|
277
276
|
|
|
278
277
|
1st day of 10th month (Pyatho).
|
|
@@ -295,7 +294,7 @@ class _BurmeseLunisolar:
|
|
|
295
294
|
|
|
296
295
|
return _timedelta(next_year_start_date, -89)
|
|
297
296
|
|
|
298
|
-
def tabaung_full_moon_date(self, year: int) ->
|
|
297
|
+
def tabaung_full_moon_date(self, year: int) -> date | None:
|
|
299
298
|
"""Calculate the Gregorian date of Full Moon Day of Tabaung.
|
|
300
299
|
|
|
301
300
|
15th day of 12th month (Tabaung).
|
holidays/calendars/chinese.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, SEP, OCT, NOV, DEC
|
|
@@ -1340,7 +1339,7 @@ class _ChineseLunisolar:
|
|
|
1340
1339
|
f"Supported calendars: {', '.join(sorted(supported_calendars))}"
|
|
1341
1340
|
)
|
|
1342
1341
|
|
|
1343
|
-
def _get_holiday(self, holiday: str, year: int, calendar=None) -> tuple[
|
|
1342
|
+
def _get_holiday(self, holiday: str, year: int, calendar=None) -> tuple[date | None, bool]:
|
|
1344
1343
|
calendar = calendar or self.__calendar
|
|
1345
1344
|
self.__verify_calendar(calendar)
|
|
1346
1345
|
confirmed_dates = getattr(
|
|
@@ -1359,25 +1358,25 @@ class _ChineseLunisolar:
|
|
|
1359
1358
|
)
|
|
1360
1359
|
return date(year, *dt) if dt else None, not is_confirmed
|
|
1361
1360
|
|
|
1362
|
-
def buddha_birthday_date(self, year: int, calendar=None) -> tuple[
|
|
1361
|
+
def buddha_birthday_date(self, year: int, calendar=None) -> tuple[date | None, bool]:
|
|
1363
1362
|
return self._get_holiday(BUDDHA_BIRTHDAY, year, calendar)
|
|
1364
1363
|
|
|
1365
|
-
def double_ninth_date(self, year: int) -> tuple[
|
|
1364
|
+
def double_ninth_date(self, year: int) -> tuple[date | None, bool]:
|
|
1366
1365
|
return self._get_holiday(DOUBLE_NINTH, year)
|
|
1367
1366
|
|
|
1368
|
-
def dragon_boat_date(self, year: int) -> tuple[
|
|
1367
|
+
def dragon_boat_date(self, year: int) -> tuple[date | None, bool]:
|
|
1369
1368
|
return self._get_holiday(DRAGON_BOAT, year)
|
|
1370
1369
|
|
|
1371
|
-
def hung_kings_date(self, year: int, calendar=None) -> tuple[
|
|
1370
|
+
def hung_kings_date(self, year: int, calendar=None) -> tuple[date | None, bool]:
|
|
1372
1371
|
return self._get_holiday(HUNG_KINGS, year, calendar)
|
|
1373
1372
|
|
|
1374
|
-
def lunar_new_year_date(self, year: int, calendar=None) -> tuple[
|
|
1373
|
+
def lunar_new_year_date(self, year: int, calendar=None) -> tuple[date | None, bool]:
|
|
1375
1374
|
return self._get_holiday(LUNAR_NEW_YEAR, year, calendar)
|
|
1376
1375
|
|
|
1377
|
-
def mid_autumn_date(self, year: int, calendar=None) -> tuple[
|
|
1376
|
+
def mid_autumn_date(self, year: int, calendar=None) -> tuple[date | None, bool]:
|
|
1378
1377
|
return self._get_holiday(MID_AUTUMN, year, calendar)
|
|
1379
1378
|
|
|
1380
|
-
def winter_solstice_date(self, year: int, calendar=None) -> tuple[
|
|
1379
|
+
def winter_solstice_date(self, year: int, calendar=None) -> tuple[date | None, bool]:
|
|
1381
1380
|
"""Return Winter Solstice (22nd solar term in Chinese Lunisolar calendar) date.
|
|
1382
1381
|
|
|
1383
1382
|
!!! note "Note"
|
holidays/calendars/hebrew.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 FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
|
|
17
16
|
|
|
@@ -1598,36 +1597,36 @@ class _HebrewLunisolar:
|
|
|
1598
1597
|
2100: (OCT, 13),
|
|
1599
1598
|
}
|
|
1600
1599
|
|
|
1601
|
-
def _get_holiday(self, holiday: str, year: int) ->
|
|
1600
|
+
def _get_holiday(self, holiday: str, year: int) -> date | None:
|
|
1602
1601
|
dt = getattr(self, f"{holiday}_DATES", {}).get(year, ())
|
|
1603
1602
|
return date(year, *dt) if dt else None
|
|
1604
1603
|
|
|
1605
1604
|
def hanukkah_date(self, year: int) -> set[date]:
|
|
1606
1605
|
return {dt for y in (year - 1, year) if (dt := self._get_holiday(HANUKKAH, y)) is not None}
|
|
1607
1606
|
|
|
1608
|
-
def israel_independence_date(self, year: int) ->
|
|
1607
|
+
def israel_independence_date(self, year: int) -> date | None:
|
|
1609
1608
|
return self._get_holiday(INDEPENDENCE_DAY, year)
|
|
1610
1609
|
|
|
1611
|
-
def lag_baomer_date(self, year: int) ->
|
|
1610
|
+
def lag_baomer_date(self, year: int) -> date | None:
|
|
1612
1611
|
return self._get_holiday(LAG_BAOMER, year)
|
|
1613
1612
|
|
|
1614
|
-
def passover_date(self, year: int) ->
|
|
1613
|
+
def passover_date(self, year: int) -> date | None:
|
|
1615
1614
|
return self._get_holiday(PASSOVER, year)
|
|
1616
1615
|
|
|
1617
|
-
def purim_date(self, year: int) ->
|
|
1616
|
+
def purim_date(self, year: int) -> date | None:
|
|
1618
1617
|
return self._get_holiday(PURIM, year)
|
|
1619
1618
|
|
|
1620
|
-
def rosh_hashanah_date(self, year: int) ->
|
|
1619
|
+
def rosh_hashanah_date(self, year: int) -> date | None:
|
|
1621
1620
|
return self._get_holiday(ROSH_HASHANAH, year)
|
|
1622
1621
|
|
|
1623
|
-
def shavuot_date(self, year: int) ->
|
|
1622
|
+
def shavuot_date(self, year: int) -> date | None:
|
|
1624
1623
|
return self._get_holiday(SHAVUOT, year)
|
|
1625
1624
|
|
|
1626
|
-
def sukkot_date(self, year: int) ->
|
|
1625
|
+
def sukkot_date(self, year: int) -> date | None:
|
|
1627
1626
|
return self._get_holiday(SUKKOT, year)
|
|
1628
1627
|
|
|
1629
|
-
def tisha_bav_date(self, year: int) ->
|
|
1628
|
+
def tisha_bav_date(self, year: int) -> date | None:
|
|
1630
1629
|
return self._get_holiday(TISHA_BAV, year)
|
|
1631
1630
|
|
|
1632
|
-
def yom_kippur_date(self, year: int) ->
|
|
1631
|
+
def yom_kippur_date(self, year: int) -> date | None:
|
|
1633
1632
|
return self._get_holiday(YOM_KIPPUR, year)
|
holidays/calendars/hindu.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, AUG, SEP, OCT, NOV, DEC
|
|
@@ -1396,7 +1395,7 @@ class _HinduLunisolar:
|
|
|
1396
1395
|
2035: (APR, 14),
|
|
1397
1396
|
}
|
|
1398
1397
|
|
|
1399
|
-
def _get_holiday(self, holiday: str, year: int) -> tuple[
|
|
1398
|
+
def _get_holiday(self, holiday: str, year: int) -> tuple[date | None, bool]:
|
|
1400
1399
|
estimated_dates = getattr(self, f"{holiday}_DATES", {})
|
|
1401
1400
|
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
|
|
1402
1401
|
dt = exact_dates.get(year, estimated_dates.get(year, ()))
|
|
@@ -1409,85 +1408,85 @@ class _HinduLunisolar:
|
|
|
1409
1408
|
for dt in _normalize_tuple(exact_dates.get(year, estimated_dates.get(year, ()))):
|
|
1410
1409
|
yield date(year, *dt), year not in exact_dates
|
|
1411
1410
|
|
|
1412
|
-
def buddha_purnima_date(self, year: int) -> tuple[
|
|
1411
|
+
def buddha_purnima_date(self, year: int) -> tuple[date | None, bool]:
|
|
1413
1412
|
return self._get_holiday(BUDDHA_PURNIMA, year)
|
|
1414
1413
|
|
|
1415
|
-
def chhath_puja_date(self, year: int) -> tuple[
|
|
1414
|
+
def chhath_puja_date(self, year: int) -> tuple[date | None, bool]:
|
|
1416
1415
|
return self._get_holiday(CHHATH_PUJA, year)
|
|
1417
1416
|
|
|
1418
|
-
def diwali_date(self, year: int) -> tuple[
|
|
1417
|
+
def diwali_date(self, year: int) -> tuple[date | None, bool]:
|
|
1419
1418
|
return self._get_holiday(DIWALI, year)
|
|
1420
1419
|
|
|
1421
|
-
def diwali_india_date(self, year: int) -> tuple[
|
|
1420
|
+
def diwali_india_date(self, year: int) -> tuple[date | None, bool]:
|
|
1422
1421
|
return self._get_holiday(DIWALI_INDIA, year)
|
|
1423
1422
|
|
|
1424
|
-
def dussehra_date(self, year: int) -> tuple[
|
|
1423
|
+
def dussehra_date(self, year: int) -> tuple[date | None, bool]:
|
|
1425
1424
|
return self._get_holiday(DUSSEHRA, year)
|
|
1426
1425
|
|
|
1427
|
-
def ganesh_chaturthi_date(self, year: int) -> tuple[
|
|
1426
|
+
def ganesh_chaturthi_date(self, year: int) -> tuple[date | None, bool]:
|
|
1428
1427
|
return self._get_holiday(GANESH_CHATURTHI, year)
|
|
1429
1428
|
|
|
1430
|
-
def govardhan_puja_date(self, year: int) -> tuple[
|
|
1429
|
+
def govardhan_puja_date(self, year: int) -> tuple[date | None, bool]:
|
|
1431
1430
|
return self._get_holiday(GOVARDHAN_PUJA, year)
|
|
1432
1431
|
|
|
1433
|
-
def gudi_padwa_date(self, year: int) -> tuple[
|
|
1432
|
+
def gudi_padwa_date(self, year: int) -> tuple[date | None, bool]:
|
|
1434
1433
|
return self._get_holiday(GUDI_PADWA, year)
|
|
1435
1434
|
|
|
1436
1435
|
def guru_gobind_singh_jayanti_date(self, year: int) -> Iterable[tuple[date, bool]]:
|
|
1437
1436
|
return self._get_holiday_set(GURU_GOBIND_SINGH_JAYANTI, year)
|
|
1438
1437
|
|
|
1439
|
-
def guru_nanak_jayanti_date(self, year: int) -> tuple[
|
|
1438
|
+
def guru_nanak_jayanti_date(self, year: int) -> tuple[date | None, bool]:
|
|
1440
1439
|
return self._get_holiday(GURU_NANAK_JAYANTI, year)
|
|
1441
1440
|
|
|
1442
|
-
def gyalpo_losar_date(self, year: int) -> tuple[
|
|
1441
|
+
def gyalpo_losar_date(self, year: int) -> tuple[date | None, bool]:
|
|
1443
1442
|
return self._get_holiday(GYALPO_LOSAR, year)
|
|
1444
1443
|
|
|
1445
|
-
def holi_date(self, year: int) -> tuple[
|
|
1444
|
+
def holi_date(self, year: int) -> tuple[date | None, bool]:
|
|
1446
1445
|
return self._get_holiday(HOLI, year)
|
|
1447
1446
|
|
|
1448
|
-
def pongal_date(self, year: int) -> tuple[
|
|
1447
|
+
def pongal_date(self, year: int) -> tuple[date | None, bool]:
|
|
1449
1448
|
return self._get_holiday(PONGAL, year)
|
|
1450
1449
|
|
|
1451
|
-
def janmashtami_date(self, year: int) -> tuple[
|
|
1450
|
+
def janmashtami_date(self, year: int) -> tuple[date | None, bool]:
|
|
1452
1451
|
return self._get_holiday(JANMASHTAMI, year)
|
|
1453
1452
|
|
|
1454
|
-
def maha_ashtami_date(self, year: int) -> tuple[
|
|
1453
|
+
def maha_ashtami_date(self, year: int) -> tuple[date | None, bool]:
|
|
1455
1454
|
return self._get_holiday(MAHA_ASHTAMI, year)
|
|
1456
1455
|
|
|
1457
|
-
def maha_navami_date(self, year: int) -> tuple[
|
|
1456
|
+
def maha_navami_date(self, year: int) -> tuple[date | None, bool]:
|
|
1458
1457
|
return self._get_holiday(MAHA_NAVAMI, year)
|
|
1459
1458
|
|
|
1460
|
-
def maha_shivaratri_date(self, year: int) -> tuple[
|
|
1459
|
+
def maha_shivaratri_date(self, year: int) -> tuple[date | None, bool]:
|
|
1461
1460
|
return self._get_holiday(MAHA_SHIVARATRI, year)
|
|
1462
1461
|
|
|
1463
|
-
def mahavir_jayanti_date(self, year: int) -> tuple[
|
|
1462
|
+
def mahavir_jayanti_date(self, year: int) -> tuple[date | None, bool]:
|
|
1464
1463
|
return self._get_holiday(MAHAVIR_JAYANTI, year)
|
|
1465
1464
|
|
|
1466
|
-
def makar_sankranti_date(self, year: int) -> tuple[
|
|
1465
|
+
def makar_sankranti_date(self, year: int) -> tuple[date | None, bool]:
|
|
1467
1466
|
return self._get_holiday(MAKAR_SANKRANTI, year)
|
|
1468
1467
|
|
|
1469
|
-
def onam_date(self, year: int) -> tuple[
|
|
1468
|
+
def onam_date(self, year: int) -> tuple[date | None, bool]:
|
|
1470
1469
|
return self._get_holiday(ONAM, year)
|
|
1471
1470
|
|
|
1472
|
-
def raksha_bandhan_date(self, year: int) -> tuple[
|
|
1471
|
+
def raksha_bandhan_date(self, year: int) -> tuple[date | None, bool]:
|
|
1473
1472
|
return self._get_holiday(RAKSHA_BANDHAN, year)
|
|
1474
1473
|
|
|
1475
|
-
def ram_navami_date(self, year: int) -> tuple[
|
|
1474
|
+
def ram_navami_date(self, year: int) -> tuple[date | None, bool]:
|
|
1476
1475
|
return self._get_holiday(RAM_NAVAMI, year)
|
|
1477
1476
|
|
|
1478
|
-
def sharad_navratri_date(self, year: int) -> tuple[
|
|
1477
|
+
def sharad_navratri_date(self, year: int) -> tuple[date | None, bool]:
|
|
1479
1478
|
return self._get_holiday(SHARAD_NAVRATRI, year)
|
|
1480
1479
|
|
|
1481
|
-
def sonam_losar_date(self, year: int) -> tuple[
|
|
1480
|
+
def sonam_losar_date(self, year: int) -> tuple[date | None, bool]:
|
|
1482
1481
|
return self._get_holiday(SONAM_LOSAR, year)
|
|
1483
1482
|
|
|
1484
|
-
def tamu_losar_date(self, year: int) -> tuple[
|
|
1483
|
+
def tamu_losar_date(self, year: int) -> tuple[date | None, bool]:
|
|
1485
1484
|
return self._get_holiday(TAMU_LOSAR, year)
|
|
1486
1485
|
|
|
1487
|
-
def thaipusam_date(self, year: int) -> tuple[
|
|
1486
|
+
def thaipusam_date(self, year: int) -> tuple[date | None, bool]:
|
|
1488
1487
|
return self._get_holiday(THAIPUSAM, year)
|
|
1489
1488
|
|
|
1490
|
-
def vaisakhi_date(self, year: int) -> tuple[
|
|
1489
|
+
def vaisakhi_date(self, year: int) -> tuple[date | None, bool]:
|
|
1491
1490
|
return self._get_holiday(VAISAKHI, year)
|
|
1492
1491
|
|
|
1493
1492
|
|
holidays/calendars/mandaean.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 _timedelta
|
|
17
16
|
|
|
@@ -27,7 +26,7 @@ class _Mandaean:
|
|
|
27
26
|
START_YEAR = 1901
|
|
28
27
|
END_YEAR = 2100
|
|
29
28
|
|
|
30
|
-
def new_year_date(self, year: int) ->
|
|
29
|
+
def new_year_date(self, year: int) -> date | None:
|
|
31
30
|
"""
|
|
32
31
|
Return Gregorian date of Mandaean new year (1 Dowla) in a given Gregorian year.
|
|
33
32
|
"""
|
|
@@ -36,7 +35,7 @@ class _Mandaean:
|
|
|
36
35
|
|
|
37
36
|
return _timedelta(_Mandaean.START_DATE, 365 * (year - _Mandaean.START_YEAR))
|
|
38
37
|
|
|
39
|
-
def mandaean_to_gregorian(self, year: int, month: int, day: int) ->
|
|
38
|
+
def mandaean_to_gregorian(self, year: int, month: int, day: int) -> date | None:
|
|
40
39
|
"""
|
|
41
40
|
Return Gregorian date of Mandaean day and month of the year that begins in a given
|
|
42
41
|
Gregorian year.
|
holidays/calendars/mongolian.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, MAY, JUN, OCT, NOV, DEC
|
|
@@ -322,19 +321,19 @@ class _MongolianLunisolar:
|
|
|
322
321
|
2100: (FEB, 10),
|
|
323
322
|
}
|
|
324
323
|
|
|
325
|
-
def _get_holiday(self, holiday: str, year: int) -> tuple[
|
|
324
|
+
def _get_holiday(self, holiday: str, year: int) -> tuple[date | None, bool]:
|
|
326
325
|
estimated_dates = getattr(self, f"{holiday}_DATES", {})
|
|
327
326
|
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
|
|
328
327
|
dt = exact_dates.get(year, estimated_dates.get(year, ()))
|
|
329
328
|
return date(year, *dt) if dt else None, year not in exact_dates
|
|
330
329
|
|
|
331
|
-
def buddha_day_date(self, year: int) -> tuple[
|
|
330
|
+
def buddha_day_date(self, year: int) -> tuple[date | None, bool]:
|
|
332
331
|
return self._get_holiday(BUDDHA_DAY, year)
|
|
333
332
|
|
|
334
|
-
def genghis_khan_day_date(self, year: int) -> tuple[
|
|
333
|
+
def genghis_khan_day_date(self, year: int) -> tuple[date | None, bool]:
|
|
335
334
|
return self._get_holiday(GENGHIS_KHAN_DAY, year)
|
|
336
335
|
|
|
337
|
-
def tsagaan_sar_date(self, year: int) -> tuple[
|
|
336
|
+
def tsagaan_sar_date(self, year: int) -> tuple[date | None, bool]:
|
|
338
337
|
return self._get_holiday(TSAGAAN_SAR, year)
|
|
339
338
|
|
|
340
339
|
|
holidays/calendars/persian.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 _timedelta
|
|
17
16
|
|
|
@@ -32,7 +31,7 @@ class _Persian:
|
|
|
32
31
|
"""
|
|
33
32
|
return (year % 33) in {3, 7, 11, 16, 20, 24, 28, 32}
|
|
34
33
|
|
|
35
|
-
def new_year_date(self, year: int) ->
|
|
34
|
+
def new_year_date(self, year: int) -> date | None:
|
|
36
35
|
"""
|
|
37
36
|
Return Gregorian date of Persian new year (1 Farvardin) in a given Gregorian year.
|
|
38
37
|
"""
|
|
@@ -51,7 +50,7 @@ class _Persian:
|
|
|
51
50
|
day = 22
|
|
52
51
|
return date(year, 3, day)
|
|
53
52
|
|
|
54
|
-
def persian_to_gregorian(self, year: int, j_month: int, j_day: int) ->
|
|
53
|
+
def persian_to_gregorian(self, year: int, j_month: int, j_day: int) -> date | None:
|
|
55
54
|
"""
|
|
56
55
|
Return Gregorian date of Persian day and month in a given Gregorian year.
|
|
57
56
|
"""
|
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
|
|