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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# holidays
|
|
2
|
+
# --------
|
|
3
|
+
# A fast, efficient Python library for generating country, province and state
|
|
4
|
+
# specific sets of holidays on the fly. It aims to make determining whether a
|
|
5
|
+
# specific date is a holiday as fast and flexible as possible.
|
|
6
|
+
#
|
|
7
|
+
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
|
|
8
|
+
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
|
|
9
|
+
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
|
|
10
|
+
# Website: https://github.com/vacanza/holidays
|
|
11
|
+
# License: MIT (see LICENSE file)
|
|
12
|
+
|
|
13
|
+
from gettext import gettext as tr
|
|
14
|
+
|
|
15
|
+
from holidays.groups import IslamicHolidays
|
|
16
|
+
from holidays.holiday_base import HolidayBase
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class WesternSahara(HolidayBase, IslamicHolidays):
|
|
20
|
+
"""Western Sahara holidays.
|
|
21
|
+
|
|
22
|
+
References:
|
|
23
|
+
* [1999 Constitution (es)](https://web.archive.org/web/20240210155831/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/Constitucion-RASD_1999_es.pdf)
|
|
24
|
+
* [1999 Constitution (fr)](https://web.archive.org/web/20250824061216/https://www.arso.org/03-const.99.htm)
|
|
25
|
+
* [2003 Constitution (ar)](https://web.archive.org/web/20240415014236/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/Constitucion-RASD_2003_ar.pdf)
|
|
26
|
+
* [2011 Constitution (es)](https://web.archive.org/web/20240415014236/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/RASD_Constitucion_2011_es.pdf)
|
|
27
|
+
* [2015 Constitution (en)](https://web.archive.org/web/20240605212800/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/RASD_Constitution-of-SADR-2015_en.pdf)
|
|
28
|
+
* [2019 Constitution (ar)](https://web.archive.org/web/20240415014236/https://www.usc.es/export9/sites/webinstitucional/gl/institutos/ceso/descargas/RASD_Const_2019_ar.pdf)
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
country = "EH"
|
|
32
|
+
default_language = "ar"
|
|
33
|
+
# %s (estimated).
|
|
34
|
+
estimated_label = tr("%s (المقدرة)")
|
|
35
|
+
# 1999 Constitution was adopted by the 10th Congress on September 4th, 1999.
|
|
36
|
+
start_year = 2000
|
|
37
|
+
supported_languages = ("ar", "en_US", "es", "fr")
|
|
38
|
+
|
|
39
|
+
def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
|
|
40
|
+
"""
|
|
41
|
+
Args:
|
|
42
|
+
islamic_show_estimated:
|
|
43
|
+
Whether to add "estimated" label to Islamic holidays name
|
|
44
|
+
if holiday date is estimated.
|
|
45
|
+
"""
|
|
46
|
+
IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
|
|
47
|
+
super().__init__(*args, **kwargs)
|
|
48
|
+
|
|
49
|
+
def _populate_public_holidays(self):
|
|
50
|
+
# Proclamation of the SADR.
|
|
51
|
+
self._add_holiday_feb_27(tr("إعلان الجمهورية العربية الصحراوية الديمقراطية"))
|
|
52
|
+
|
|
53
|
+
# First Martyr.
|
|
54
|
+
self._add_holiday_mar_8(tr("يوم الشهيد الأول"))
|
|
55
|
+
|
|
56
|
+
# Creation of the Polisario Front.
|
|
57
|
+
self._add_holiday_may_10(tr("تأسيس الجبهة الشعبية لتحرير الساقية الحمراء ووادي الذهب"))
|
|
58
|
+
|
|
59
|
+
# Commencement of the Armed Struggle.
|
|
60
|
+
self._add_holiday_may_20(tr("اندلاع الكفاح المسلح"))
|
|
61
|
+
|
|
62
|
+
# Martyrs' Day.
|
|
63
|
+
self._add_holiday_jun_9(tr("يوم الشهداء"))
|
|
64
|
+
|
|
65
|
+
# Uprising Day.
|
|
66
|
+
self._add_holiday_jun_17(tr("يوم الانتفاضة"))
|
|
67
|
+
|
|
68
|
+
# National Unity Day.
|
|
69
|
+
self._add_holiday_oct_12(tr("عيد الوحدة الوطنية"))
|
|
70
|
+
|
|
71
|
+
# Added in the 2003 Constitution on October 19th, 2003.
|
|
72
|
+
if self._year >= 2003:
|
|
73
|
+
# Eid al-Fitr.
|
|
74
|
+
self._add_eid_al_fitr_day(tr("عيد الفطر المبارك"))
|
|
75
|
+
|
|
76
|
+
if self._year >= 2004:
|
|
77
|
+
# Islamic New Year.
|
|
78
|
+
self._add_islamic_new_year_day(tr("رأس السنة الهجرية"))
|
|
79
|
+
|
|
80
|
+
# Prophet's Birthday.
|
|
81
|
+
self._add_mawlid_day(tr("المولد النبوي الشريف"))
|
|
82
|
+
|
|
83
|
+
# Eid al-Adha.
|
|
84
|
+
self._add_eid_al_adha_day(tr("عيد الأضحى المبارك"))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class EH(WesternSahara):
|
|
88
|
+
pass
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class ESH(WesternSahara):
|
|
92
|
+
pass
|
holidays/groups/balinese_saka.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.balinese_saka import _BalineseSakaLunar
|
|
17
16
|
|
|
@@ -24,7 +23,7 @@ class BalineseSakaCalendarHolidays:
|
|
|
24
23
|
def __init__(self) -> None:
|
|
25
24
|
self._balinese_saka_calendar = _BalineseSakaLunar()
|
|
26
25
|
|
|
27
|
-
def _add_balinese_saka_calendar_holiday(self, name: str, dt:
|
|
26
|
+
def _add_balinese_saka_calendar_holiday(self, name: str, dt: date | None) -> date | None:
|
|
28
27
|
"""
|
|
29
28
|
Add Balinese Saka calendar holiday.
|
|
30
29
|
"""
|
|
@@ -32,7 +31,7 @@ class BalineseSakaCalendarHolidays:
|
|
|
32
31
|
return None
|
|
33
32
|
return self._add_holiday(name, dt)
|
|
34
33
|
|
|
35
|
-
def _add_nyepi(self, name) ->
|
|
34
|
+
def _add_nyepi(self, name) -> date | None:
|
|
36
35
|
"""
|
|
37
36
|
Add Nyepi (Day following the 9th of Dark Moon (Tilem)).
|
|
38
37
|
|
holidays/groups/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.buddhist import _BuddhistLunisolar
|
|
17
16
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
@@ -22,13 +21,13 @@ class BuddhistCalendarHolidays(EasternCalendarHolidays):
|
|
|
22
21
|
Buddhist lunisolar calendar holidays.
|
|
23
22
|
"""
|
|
24
23
|
|
|
25
|
-
def __init__(self, cls=None, show_estimated=False) -> None:
|
|
24
|
+
def __init__(self, cls=None, *, show_estimated=False) -> None:
|
|
26
25
|
self._buddhist_calendar = cls() if cls else _BuddhistLunisolar()
|
|
27
26
|
self._buddhist_calendar_show_estimated = show_estimated
|
|
28
27
|
|
|
29
28
|
def _add_buddhist_calendar_holiday(
|
|
30
|
-
self, name: str, dt_estimated: tuple[
|
|
31
|
-
) ->
|
|
29
|
+
self, name: str, dt_estimated: tuple[date | None, bool]
|
|
30
|
+
) -> date | None:
|
|
32
31
|
"""
|
|
33
32
|
Add Buddhist calendar holiday.
|
|
34
33
|
|
|
@@ -36,10 +35,10 @@ class BuddhistCalendarHolidays(EasternCalendarHolidays):
|
|
|
36
35
|
is an estimation.
|
|
37
36
|
"""
|
|
38
37
|
return self._add_eastern_calendar_holiday(
|
|
39
|
-
name, dt_estimated, self._buddhist_calendar_show_estimated
|
|
38
|
+
name, dt_estimated, show_estimated=self._buddhist_calendar_show_estimated
|
|
40
39
|
)
|
|
41
40
|
|
|
42
|
-
def _add_vesak(self, name) ->
|
|
41
|
+
def _add_vesak(self, name) -> date | None:
|
|
43
42
|
"""
|
|
44
43
|
Add Vesak (15th day of the 4th lunar month).
|
|
45
44
|
|
|
@@ -50,7 +49,7 @@ class BuddhistCalendarHolidays(EasternCalendarHolidays):
|
|
|
50
49
|
name, self._buddhist_calendar.vesak_date(self._year)
|
|
51
50
|
)
|
|
52
51
|
|
|
53
|
-
def _add_vesak_may(self, name) ->
|
|
52
|
+
def _add_vesak_may(self, name) -> date | None:
|
|
54
53
|
"""
|
|
55
54
|
Add Vesak (on the day of the first full moon in May
|
|
56
55
|
in the Gregorian calendar).
|
holidays/groups/burmese.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.burmese import _BurmeseLunisolar
|
|
17
16
|
from holidays.calendars.gregorian import _timedelta
|
|
@@ -24,8 +23,8 @@ class BurmeseCalendarHolidays:
|
|
|
24
23
|
self._burmese_calendar = _BurmeseLunisolar()
|
|
25
24
|
|
|
26
25
|
def _add_burmese_calendar_holiday(
|
|
27
|
-
self, name: str, dt:
|
|
28
|
-
) ->
|
|
26
|
+
self, name: str, dt: date | None = None, days_delta: int = 0
|
|
27
|
+
) -> date | None:
|
|
29
28
|
"""Add Burmese calendar holiday."""
|
|
30
29
|
|
|
31
30
|
if dt is None:
|
|
@@ -61,7 +60,7 @@ class BurmeseCalendarHolidays:
|
|
|
61
60
|
)
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
def _add_kason_full_moon_day(self, name: str) ->
|
|
63
|
+
def _add_kason_full_moon_day(self, name: str) -> date | None:
|
|
65
64
|
"""Add Full Moon Day of Kason holiday.
|
|
66
65
|
|
|
67
66
|
Vesak is known as the Full Moon Day of Kason, which is the second month
|
|
@@ -79,7 +78,7 @@ class BurmeseCalendarHolidays:
|
|
|
79
78
|
name, self._burmese_calendar.kason_full_moon_date(self._year)
|
|
80
79
|
)
|
|
81
80
|
|
|
82
|
-
def _add_myanmar_diwali(self, name: str) ->
|
|
81
|
+
def _add_myanmar_diwali(self, name: str) -> date | None:
|
|
83
82
|
"""Add Myanmar Diwali holiday.
|
|
84
83
|
|
|
85
84
|
Diwali (Deepavali, Festival of Lights) is one of the most important festivals
|
|
@@ -98,7 +97,7 @@ class BurmeseCalendarHolidays:
|
|
|
98
97
|
name, self._burmese_calendar.tazaungmon_waxing_moon_date(self._year)
|
|
99
98
|
)
|
|
100
99
|
|
|
101
|
-
def _add_myanmar_national_day(self, name: str) ->
|
|
100
|
+
def _add_myanmar_national_day(self, name: str) -> date | None:
|
|
102
101
|
"""Add Myanmar National Day holiday.
|
|
103
102
|
|
|
104
103
|
National Day is a public holiday in Myanmar, marking the anniversary of the first
|
|
@@ -163,7 +162,7 @@ class BurmeseCalendarHolidays:
|
|
|
163
162
|
if (dt := self._add_holiday(name, _timedelta(akya, delta)))
|
|
164
163
|
}
|
|
165
164
|
|
|
166
|
-
def _add_tabaung_full_moon_day(self, name: str) ->
|
|
165
|
+
def _add_tabaung_full_moon_day(self, name: str) -> date | None:
|
|
167
166
|
"""Add Full Moon Day of Tabaung holiday.
|
|
168
167
|
|
|
169
168
|
Māgha Pūjā (also written as Makha Bucha Day, Meak Bochea) is a Buddhist festival
|
|
@@ -181,7 +180,7 @@ class BurmeseCalendarHolidays:
|
|
|
181
180
|
name, self._burmese_calendar.tabaung_full_moon_date(self._year - 1)
|
|
182
181
|
)
|
|
183
182
|
|
|
184
|
-
def _add_tazaungmon_full_moon_day(self, name: str) ->
|
|
183
|
+
def _add_tazaungmon_full_moon_day(self, name: str) -> date | None:
|
|
185
184
|
"""Add Full Moon Day of Tazaungmon holiday.
|
|
186
185
|
|
|
187
186
|
The Tazaungdaing Festival, also known as the Festival of Lights, held on the full moon day
|
|
@@ -199,7 +198,7 @@ class BurmeseCalendarHolidays:
|
|
|
199
198
|
name, self._burmese_calendar.tazaungmon_full_moon_date(self._year)
|
|
200
199
|
)
|
|
201
200
|
|
|
202
|
-
def _add_thadingyut_full_moon_eve(self, name: str) ->
|
|
201
|
+
def _add_thadingyut_full_moon_eve(self, name: str) -> date | None:
|
|
203
202
|
"""Add Pre-Full Moon Day of Thadingyut holiday.
|
|
204
203
|
|
|
205
204
|
The Thadingyut Festival, also known as the Lighting Festival of Myanmar, is held
|
|
@@ -217,7 +216,7 @@ class BurmeseCalendarHolidays:
|
|
|
217
216
|
name, self._burmese_calendar.thadingyut_full_moon_date(self._year), days_delta=-1
|
|
218
217
|
)
|
|
219
218
|
|
|
220
|
-
def _add_thadingyut_full_moon_day(self, name: str) ->
|
|
219
|
+
def _add_thadingyut_full_moon_day(self, name: str) -> date | None:
|
|
221
220
|
"""Add Full Moon Day of Thadingyut holiday.
|
|
222
221
|
|
|
223
222
|
The Thadingyut Festival, also known as the Lighting Festival of Myanmar, is held
|
|
@@ -235,7 +234,7 @@ class BurmeseCalendarHolidays:
|
|
|
235
234
|
name, self._burmese_calendar.thadingyut_full_moon_date(self._year)
|
|
236
235
|
)
|
|
237
236
|
|
|
238
|
-
def _add_thadingyut_full_moon_day_two(self, name: str) ->
|
|
237
|
+
def _add_thadingyut_full_moon_day_two(self, name: str) -> date | None:
|
|
239
238
|
"""Add Post-Full Moon Day of Thadingyut holiday.
|
|
240
239
|
|
|
241
240
|
The Thadingyut Festival, also known as the Lighting Festival of Myanmar, is held
|
|
@@ -253,7 +252,7 @@ class BurmeseCalendarHolidays:
|
|
|
253
252
|
name, self._burmese_calendar.thadingyut_full_moon_date(self._year), days_delta=+1
|
|
254
253
|
)
|
|
255
254
|
|
|
256
|
-
def _add_waso_full_moon_day(self, name: str) ->
|
|
255
|
+
def _add_waso_full_moon_day(self, name: str) -> date | None:
|
|
257
256
|
"""Add Full Moon Day of Waso holiday.
|
|
258
257
|
|
|
259
258
|
Vassa is the three-month annual retreat observed by Theravada Buddhists.
|
holidays/groups/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.chinese import _ChineseLunisolar, CHINESE_CALENDAR
|
|
17
16
|
from holidays.calendars.gregorian import APR
|
|
@@ -23,7 +22,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
23
22
|
Chinese lunisolar calendar holidays.
|
|
24
23
|
"""
|
|
25
24
|
|
|
26
|
-
def __init__(self, cls=None, show_estimated=False, calendar=CHINESE_CALENDAR) -> None:
|
|
25
|
+
def __init__(self, cls=None, *, show_estimated=False, calendar=CHINESE_CALENDAR) -> None:
|
|
27
26
|
self._chinese_calendar = (
|
|
28
27
|
cls(calendar=calendar) if cls else _ChineseLunisolar(calendar=calendar)
|
|
29
28
|
)
|
|
@@ -83,8 +82,8 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
83
82
|
return self._chinese_calendar.winter_solstice_date(self._year)[0]
|
|
84
83
|
|
|
85
84
|
def _add_chinese_calendar_holiday(
|
|
86
|
-
self, name: str, dt_estimated: tuple[
|
|
87
|
-
) ->
|
|
85
|
+
self, name: str, dt_estimated: tuple[date | None, bool], days_delta: int = 0
|
|
86
|
+
) -> date | None:
|
|
88
87
|
"""
|
|
89
88
|
Add Chinese calendar holiday.
|
|
90
89
|
|
|
@@ -92,10 +91,13 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
92
91
|
is an estimation.
|
|
93
92
|
"""
|
|
94
93
|
return self._add_eastern_calendar_holiday(
|
|
95
|
-
name,
|
|
94
|
+
name,
|
|
95
|
+
dt_estimated,
|
|
96
|
+
show_estimated=self._chinese_calendar_show_estimated,
|
|
97
|
+
days_delta=days_delta,
|
|
96
98
|
)
|
|
97
99
|
|
|
98
|
-
def _add_chinese_birthday_of_buddha(self, name) ->
|
|
100
|
+
def _add_chinese_birthday_of_buddha(self, name) -> date | None:
|
|
99
101
|
"""
|
|
100
102
|
Add Birthday of the Buddha by Chinese lunar calendar (8th day of the
|
|
101
103
|
4th lunar month).
|
|
@@ -109,7 +111,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
109
111
|
name, self._chinese_calendar.buddha_birthday_date(self._year)
|
|
110
112
|
)
|
|
111
113
|
|
|
112
|
-
def _add_chinese_day_before_new_years_eve(self, name) ->
|
|
114
|
+
def _add_chinese_day_before_new_years_eve(self, name) -> date | None:
|
|
113
115
|
"""
|
|
114
116
|
Add day before Chinese New Year's Eve (second to last day of 12th lunar month).
|
|
115
117
|
|
|
@@ -120,7 +122,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
120
122
|
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=-2
|
|
121
123
|
)
|
|
122
124
|
|
|
123
|
-
def _add_chinese_new_years_eve(self, name) ->
|
|
125
|
+
def _add_chinese_new_years_eve(self, name) -> date | None:
|
|
124
126
|
"""
|
|
125
127
|
Add Chinese New Year's Eve (last day of 12th lunar month).
|
|
126
128
|
|
|
@@ -131,7 +133,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
131
133
|
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=-1
|
|
132
134
|
)
|
|
133
135
|
|
|
134
|
-
def _add_chinese_new_years_day(self, name) ->
|
|
136
|
+
def _add_chinese_new_years_day(self, name) -> date | None:
|
|
135
137
|
"""
|
|
136
138
|
Add Chinese New Year's Day (first day of the first lunar month).
|
|
137
139
|
|
|
@@ -143,7 +145,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
143
145
|
name, self._chinese_calendar.lunar_new_year_date(self._year)
|
|
144
146
|
)
|
|
145
147
|
|
|
146
|
-
def _add_chinese_new_years_day_two(self, name) ->
|
|
148
|
+
def _add_chinese_new_years_day_two(self, name) -> date | None:
|
|
147
149
|
"""
|
|
148
150
|
Add Chinese New Year's Day Two.
|
|
149
151
|
|
|
@@ -153,7 +155,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
153
155
|
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+1
|
|
154
156
|
)
|
|
155
157
|
|
|
156
|
-
def _add_chinese_new_years_day_three(self, name) ->
|
|
158
|
+
def _add_chinese_new_years_day_three(self, name) -> date | None:
|
|
157
159
|
"""
|
|
158
160
|
Add Chinese New Year's Day Three.
|
|
159
161
|
|
|
@@ -163,7 +165,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
163
165
|
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+2
|
|
164
166
|
)
|
|
165
167
|
|
|
166
|
-
def _add_chinese_new_years_day_four(self, name) ->
|
|
168
|
+
def _add_chinese_new_years_day_four(self, name) -> date | None:
|
|
167
169
|
"""
|
|
168
170
|
Add Chinese New Year's Day Four.
|
|
169
171
|
|
|
@@ -173,7 +175,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
173
175
|
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+3
|
|
174
176
|
)
|
|
175
177
|
|
|
176
|
-
def _add_chinese_new_years_day_five(self, name) ->
|
|
178
|
+
def _add_chinese_new_years_day_five(self, name) -> date | None:
|
|
177
179
|
"""
|
|
178
180
|
Add Chinese New Year's Day Five.
|
|
179
181
|
|
|
@@ -183,7 +185,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
183
185
|
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+4
|
|
184
186
|
)
|
|
185
187
|
|
|
186
|
-
def _add_daeboreum_day(self, name) ->
|
|
188
|
+
def _add_daeboreum_day(self, name) -> date | None:
|
|
187
189
|
"""
|
|
188
190
|
Add Daeboreum Day (15th day of 1st lunar month).
|
|
189
191
|
|
|
@@ -195,7 +197,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
195
197
|
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+14
|
|
196
198
|
)
|
|
197
199
|
|
|
198
|
-
def _add_dongzhi_festival(self, name) ->
|
|
200
|
+
def _add_dongzhi_festival(self, name) -> date | None:
|
|
199
201
|
"""
|
|
200
202
|
Add Dongzhi Festival (Chinese Winter Solstice).
|
|
201
203
|
|
|
@@ -206,7 +208,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
206
208
|
"""
|
|
207
209
|
return self._add_holiday(name, self._dongzhi_festival)
|
|
208
210
|
|
|
209
|
-
def _add_hanshi_festival(self, name) ->
|
|
211
|
+
def _add_hanshi_festival(self, name) -> date | None:
|
|
210
212
|
"""
|
|
211
213
|
Add Hanshi Festival (105 days after Winter Solstice).
|
|
212
214
|
|
|
@@ -229,7 +231,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
229
231
|
"""
|
|
230
232
|
return self._add_holiday(name, self._qingming_festival)
|
|
231
233
|
|
|
232
|
-
def _add_double_ninth_festival(self, name) ->
|
|
234
|
+
def _add_double_ninth_festival(self, name) -> date | None:
|
|
233
235
|
"""
|
|
234
236
|
Add Double Ninth Festival (9th day of 9th lunar month).
|
|
235
237
|
|
|
@@ -241,7 +243,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
241
243
|
name, self._chinese_calendar.double_ninth_date(self._year)
|
|
242
244
|
)
|
|
243
245
|
|
|
244
|
-
def _add_dragon_boat_festival(self, name) ->
|
|
246
|
+
def _add_dragon_boat_festival(self, name) -> date | None:
|
|
245
247
|
"""
|
|
246
248
|
Add Dragon Boat Festival (5th day of 5th lunar month).
|
|
247
249
|
|
|
@@ -253,7 +255,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
253
255
|
name, self._chinese_calendar.dragon_boat_date(self._year)
|
|
254
256
|
)
|
|
255
257
|
|
|
256
|
-
def _add_hung_kings_day(self, name) ->
|
|
258
|
+
def _add_hung_kings_day(self, name) -> date | None:
|
|
257
259
|
"""
|
|
258
260
|
Add Hùng Kings' Temple Festival (10th day of the 3rd lunar month).
|
|
259
261
|
|
|
@@ -265,7 +267,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
265
267
|
name, self._chinese_calendar.hung_kings_date(self._year)
|
|
266
268
|
)
|
|
267
269
|
|
|
268
|
-
def _add_mid_autumn_festival(self, name) ->
|
|
270
|
+
def _add_mid_autumn_festival(self, name) -> date | None:
|
|
269
271
|
"""
|
|
270
272
|
Add Mid Autumn Festival (15th day of the 8th lunar month).
|
|
271
273
|
|
|
@@ -277,7 +279,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
|
|
|
277
279
|
name, self._chinese_calendar.mid_autumn_date(self._year)
|
|
278
280
|
)
|
|
279
281
|
|
|
280
|
-
def _add_mid_autumn_festival_day_two(self, name) ->
|
|
282
|
+
def _add_mid_autumn_festival_day_two(self, name) -> date | None:
|
|
281
283
|
"""
|
|
282
284
|
Add Mid Autumn Festival Day Two (16th day of the 8th lunar month).
|
|
283
285
|
|
holidays/groups/christian.py
CHANGED
|
@@ -414,6 +414,16 @@ class ChristianHolidays:
|
|
|
414
414
|
"""
|
|
415
415
|
return self._add_holiday(name, _timedelta(self._easter_sunday, +9))
|
|
416
416
|
|
|
417
|
+
def _add_saint_anthonys_day(self, name) -> date:
|
|
418
|
+
"""
|
|
419
|
+
Add Saint Anthony of Padua's Day (June 13th).
|
|
420
|
+
|
|
421
|
+
Saint Anthony's Day is celebrated on 13 June, the traditionally
|
|
422
|
+
accepted date of the saint's death.
|
|
423
|
+
https://en.wikipedia.org/wiki/Anthony_of_Padua
|
|
424
|
+
"""
|
|
425
|
+
return self._add_holiday_jun_13(name)
|
|
426
|
+
|
|
417
427
|
def _add_saint_georges_day(self, name) -> date:
|
|
418
428
|
"""
|
|
419
429
|
Add Saint George's Day (April 23th).
|
|
@@ -455,6 +465,26 @@ class ChristianHolidays:
|
|
|
455
465
|
"""
|
|
456
466
|
return self._add_holiday_mar_19(name)
|
|
457
467
|
|
|
468
|
+
def _add_saint_martins_day(self, name) -> date:
|
|
469
|
+
"""
|
|
470
|
+
Add Saint Martin of Tours Day (November 11th).
|
|
471
|
+
|
|
472
|
+
Saint Martin of Tours is the patron saint of many communities and organizations
|
|
473
|
+
across Europe, including France's Third Republic.
|
|
474
|
+
https://en.wikipedia.org/wiki/Martin_of_Tours
|
|
475
|
+
"""
|
|
476
|
+
return self._add_holiday_nov_11(name)
|
|
477
|
+
|
|
478
|
+
def _add_saint_patricks_day(self, name) -> date:
|
|
479
|
+
"""
|
|
480
|
+
Add Saint Patrick's Day (March 17th).
|
|
481
|
+
|
|
482
|
+
Saint Patrick's Day is a religious and cultural holiday held on 17 March,
|
|
483
|
+
the traditional death date of Saint Patrick, the foremost patron saint of Ireland.
|
|
484
|
+
https://en.wikipedia.org/wiki/Saint_Patrick's_Day
|
|
485
|
+
"""
|
|
486
|
+
return self._add_holiday_mar_17(name)
|
|
487
|
+
|
|
458
488
|
def _add_saints_peter_and_paul_day(self, name) -> date:
|
|
459
489
|
"""
|
|
460
490
|
Add Feast of Saints Peter and Paul (June 29th).
|
holidays/groups/eastern.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.gregorian import _timedelta
|
|
18
17
|
|
|
@@ -25,10 +24,11 @@ class EasternCalendarHolidays:
|
|
|
25
24
|
def _add_eastern_calendar_holiday(
|
|
26
25
|
self,
|
|
27
26
|
name: str,
|
|
28
|
-
dt_estimated: tuple[
|
|
27
|
+
dt_estimated: tuple[date | None, bool],
|
|
28
|
+
*,
|
|
29
29
|
show_estimated: bool = True,
|
|
30
30
|
days_delta: int = 0,
|
|
31
|
-
) ->
|
|
31
|
+
) -> date | None:
|
|
32
32
|
"""
|
|
33
33
|
Add Eastern (Buddhist, Chinese, Hindu, Islamic, Mongolian) calendar holiday.
|
|
34
34
|
|
|
@@ -53,6 +53,7 @@ class EasternCalendarHolidays:
|
|
|
53
53
|
self,
|
|
54
54
|
name: str,
|
|
55
55
|
dts_estimated: Iterable[tuple[date, bool]],
|
|
56
|
+
*,
|
|
56
57
|
show_estimated: bool = True,
|
|
57
58
|
days_delta: int = 0,
|
|
58
59
|
) -> set[date]:
|
|
@@ -67,7 +68,7 @@ class EasternCalendarHolidays:
|
|
|
67
68
|
for dt_estimated in dts_estimated
|
|
68
69
|
if (
|
|
69
70
|
dt := self._add_eastern_calendar_holiday(
|
|
70
|
-
name, dt_estimated, show_estimated, days_delta
|
|
71
|
+
name, dt_estimated, show_estimated=show_estimated, days_delta=days_delta
|
|
71
72
|
)
|
|
72
73
|
)
|
|
73
74
|
}
|
holidays/groups/hebrew.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 Union
|
|
16
15
|
|
|
17
16
|
from holidays.calendars.gregorian import _timedelta
|
|
18
17
|
from holidays.calendars.hebrew import _HebrewLunisolar
|
|
@@ -27,7 +26,7 @@ class HebrewCalendarHolidays:
|
|
|
27
26
|
self._hebrew_calendar = _HebrewLunisolar()
|
|
28
27
|
|
|
29
28
|
def _add_hebrew_calendar_holiday(
|
|
30
|
-
self, name: str, holiday_date: date, days_delta:
|
|
29
|
+
self, name: str, holiday_date: date, days_delta: int | Iterable[int] = 0
|
|
31
30
|
) -> set[date]:
|
|
32
31
|
"""
|
|
33
32
|
Add Hebrew calendar holiday.
|
|
@@ -38,7 +37,7 @@ class HebrewCalendarHolidays:
|
|
|
38
37
|
if (dt := self._add_holiday(name, _timedelta(holiday_date, delta)))
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
def _add_hanukkah(self, name: str, days_delta:
|
|
40
|
+
def _add_hanukkah(self, name: str, days_delta: int | Iterable[int] = 0) -> set[date]:
|
|
42
41
|
"""
|
|
43
42
|
Add Hanukkah.
|
|
44
43
|
In some Gregorian years, there may be two Hanukkah dates.
|
|
@@ -53,7 +52,7 @@ class HebrewCalendarHolidays:
|
|
|
53
52
|
for dt in self._add_hebrew_calendar_holiday(name, hanukkah_dt, days_delta)
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
def _add_lag_baomer(self, name: str, days_delta:
|
|
55
|
+
def _add_lag_baomer(self, name: str, days_delta: int | Iterable[int] = 0) -> set[date]:
|
|
57
56
|
"""
|
|
58
57
|
Add Lag BaOmer.
|
|
59
58
|
|
|
@@ -68,7 +67,7 @@ class HebrewCalendarHolidays:
|
|
|
68
67
|
days_delta,
|
|
69
68
|
)
|
|
70
69
|
|
|
71
|
-
def _add_passover(self, name: str, days_delta:
|
|
70
|
+
def _add_passover(self, name: str, days_delta: int | Iterable[int] = 0) -> set[date]:
|
|
72
71
|
"""
|
|
73
72
|
Add Passover.
|
|
74
73
|
|
|
@@ -96,9 +95,7 @@ class HebrewCalendarHolidays:
|
|
|
96
95
|
self._hebrew_calendar.purim_date(self._year), # type: ignore[arg-type]
|
|
97
96
|
)
|
|
98
97
|
|
|
99
|
-
def _add_rosh_hashanah(
|
|
100
|
-
self, name: str, days_delta: Union[int, Iterable[int]] = 0
|
|
101
|
-
) -> set[date]:
|
|
98
|
+
def _add_rosh_hashanah(self, name: str, days_delta: int | Iterable[int] = 0) -> set[date]:
|
|
102
99
|
"""
|
|
103
100
|
Add Rosh Hashanah.
|
|
104
101
|
|
|
@@ -124,7 +121,7 @@ class HebrewCalendarHolidays:
|
|
|
124
121
|
self._hebrew_calendar.shavuot_date(self._year), # type: ignore[arg-type]
|
|
125
122
|
)
|
|
126
123
|
|
|
127
|
-
def _add_sukkot(self, name: str, days_delta:
|
|
124
|
+
def _add_sukkot(self, name: str, days_delta: int | Iterable[int] = 0) -> set[date]:
|
|
128
125
|
"""
|
|
129
126
|
Add Sukkot.
|
|
130
127
|
|
|
@@ -138,7 +135,7 @@ class HebrewCalendarHolidays:
|
|
|
138
135
|
days_delta,
|
|
139
136
|
)
|
|
140
137
|
|
|
141
|
-
def _add_yom_kippur(self, name: str, days_delta:
|
|
138
|
+
def _add_yom_kippur(self, name: str, days_delta: int | Iterable[int] = 0) -> set[date]:
|
|
142
139
|
"""
|
|
143
140
|
Add Yom Kippur.
|
|
144
141
|
|