holidays 0.80__py3-none-any.whl → 0.82__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- holidays/calendars/__init__.py +1 -0
- holidays/calendars/burmese.py +319 -0
- holidays/calendars/chinese.py +39 -1
- holidays/calendars/hebrew.py +2 -2
- holidays/calendars/thai.py +49 -2
- holidays/countries/__init__.py +16 -0
- holidays/countries/afghanistan.py +7 -5
- holidays/countries/algeria.py +89 -24
- holidays/countries/antarctica.py +58 -0
- holidays/countries/bouvet_island.py +31 -0
- holidays/countries/brazil.py +1 -1
- holidays/countries/british_indian_ocean_territory.py +31 -0
- holidays/countries/bulgaria.py +6 -1
- holidays/countries/chile.py +9 -8
- holidays/countries/china.py +4 -0
- holidays/countries/cuba.py +3 -4
- holidays/countries/djibouti.py +1 -1
- holidays/countries/heard_island_and_mcdonald_islands.py +31 -0
- holidays/countries/hongkong.py +5 -1
- holidays/countries/hungary.py +4 -5
- holidays/countries/india.py +6 -0
- holidays/countries/japan.py +22 -18
- holidays/countries/jordan.py +6 -3
- holidays/countries/kuwait.py +6 -3
- holidays/countries/macau.py +9 -0
- holidays/countries/malaysia.py +14 -3
- holidays/countries/mongolia.py +2 -0
- holidays/countries/myanmar.py +195 -0
- holidays/countries/north_korea.py +161 -0
- holidays/countries/norway.py +23 -8
- holidays/countries/oman.py +6 -2
- holidays/countries/paraguay.py +70 -23
- holidays/countries/philippines.py +11 -2
- holidays/countries/portugal.py +5 -6
- holidays/countries/qatar.py +5 -2
- holidays/countries/rwanda.py +6 -1
- holidays/countries/saint_helena_ascension_and_tristan_da_cunha.py +197 -0
- holidays/countries/saudi_arabia.py +6 -5
- holidays/countries/serbia.py +5 -0
- holidays/countries/south_africa.py +96 -53
- holidays/countries/south_korea.py +10 -1
- holidays/countries/spain.py +26 -4
- holidays/countries/sudan.py +118 -0
- holidays/countries/switzerland.py +169 -3
- holidays/countries/taiwan.py +27 -3
- holidays/countries/tajikistan.py +1 -1
- holidays/countries/tanzania.py +6 -1
- holidays/countries/thailand.py +21 -0
- holidays/countries/tonga.py +6 -1
- holidays/countries/trinidad_and_tobago.py +6 -1
- holidays/countries/united_arab_emirates.py +9 -2
- holidays/countries/united_states.py +16 -0
- holidays/countries/uruguay.py +6 -1
- holidays/countries/vietnam.py +10 -1
- holidays/countries/yemen.py +6 -3
- holidays/groups/__init__.py +1 -0
- holidays/groups/balinese_saka.py +1 -1
- holidays/groups/buddhist.py +1 -1
- holidays/groups/burmese.py +273 -0
- holidays/groups/chinese.py +27 -14
- holidays/groups/custom.py +8 -2
- holidays/groups/eastern.py +25 -3
- holidays/groups/hebrew.py +16 -14
- holidays/groups/hindu.py +15 -13
- holidays/groups/islamic.py +52 -47
- holidays/groups/mongolian.py +1 -1
- holidays/groups/sinhala.py +4 -9
- holidays/groups/tibetan.py +3 -4
- holidays/holiday_base.py +5 -4
- holidays/ical.py +6 -4
- holidays/locale/ar/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/ar_SD/LC_MESSAGES/SD.mo +0 -0
- holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_GB/LC_MESSAGES/SH.mo +0 -0
- holidays/locale/en_HK/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/en_MO/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/en_PH/LC_MESSAGES/PH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KP.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/PH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/PY.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/SD.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/SH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/VN.mo +0 -0
- holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/es/LC_MESSAGES/PY.mo +0 -0
- holidays/locale/fil/LC_MESSAGES/PH.mo +0 -0
- holidays/locale/fr/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/ja/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/ko/LC_MESSAGES/KR.mo +0 -0
- holidays/locale/ko_KP/LC_MESSAGES/KP.mo +0 -0
- holidays/locale/mn/LC_MESSAGES/MN.mo +0 -0
- holidays/locale/my/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/pt_BR/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/pt_MO/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/th/LC_MESSAGES/CN.mo +0 -0
- holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/th/LC_MESSAGES/KR.mo +0 -0
- holidays/locale/th/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/th/LC_MESSAGES/PH.mo +0 -0
- holidays/locale/th/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/th/LC_MESSAGES/US.mo +0 -0
- holidays/locale/th/LC_MESSAGES/VN.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/PY.mo +0 -0
- holidays/locale/vi/LC_MESSAGES/VN.mo +0 -0
- holidays/locale/zh_CN/LC_MESSAGES/CN.mo +0 -0
- holidays/locale/zh_CN/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/zh_CN/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/zh_CN/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/zh_HK/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/zh_MO/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/zh_TW/LC_MESSAGES/CN.mo +0 -0
- holidays/locale/zh_TW/LC_MESSAGES/TW.mo +0 -0
- holidays/no_holiday_base.py +21 -0
- holidays/observed_holiday_base.py +1 -1
- holidays/registry.py +12 -0
- holidays/utils.py +5 -5
- holidays/version.py +1 -1
- {holidays-0.80.dist-info → holidays-0.82.dist-info}/METADATA +61 -5
- {holidays-0.80.dist-info → holidays-0.82.dist-info}/RECORD +142 -121
- {holidays-0.80.dist-info → holidays-0.82.dist-info}/licenses/CONTRIBUTORS +2 -0
- {holidays-0.80.dist-info → holidays-0.82.dist-info}/WHEEL +0 -0
- {holidays-0.80.dist-info → holidays-0.82.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.80.dist-info → holidays-0.82.dist-info}/top_level.txt +0 -0
holidays/groups/hebrew.py
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
from collections.abc import Iterable
|
|
14
14
|
from datetime import date
|
|
15
|
-
from typing import
|
|
15
|
+
from typing import Union
|
|
16
16
|
|
|
17
|
-
from holidays.calendars import _HebrewLunisolar
|
|
18
17
|
from holidays.calendars.gregorian import _timedelta
|
|
18
|
+
from holidays.calendars.hebrew import _HebrewLunisolar
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class HebrewCalendarHolidays:
|
|
@@ -29,15 +29,16 @@ class HebrewCalendarHolidays:
|
|
|
29
29
|
def _add_hebrew_calendar_holiday(
|
|
30
30
|
self, name: str, holiday_date: date, days_delta: Union[int, Iterable[int]] = 0
|
|
31
31
|
) -> set[date]:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
"""
|
|
33
|
+
Add Hebrew calendar holiday.
|
|
34
|
+
"""
|
|
35
|
+
return {
|
|
36
|
+
dt
|
|
37
|
+
for delta in ((days_delta,) if isinstance(days_delta, int) else days_delta)
|
|
38
|
+
if (dt := self._add_holiday(name, _timedelta(holiday_date, delta)))
|
|
39
|
+
}
|
|
37
40
|
|
|
38
|
-
def _add_hanukkah(
|
|
39
|
-
self, name: str, days_delta: Union[int, Iterable[int]] = 0
|
|
40
|
-
) -> set[Optional[date]]:
|
|
41
|
+
def _add_hanukkah(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
|
|
41
42
|
"""
|
|
42
43
|
Add Hanukkah.
|
|
43
44
|
In some Gregorian years, there may be two Hanukkah dates.
|
|
@@ -46,10 +47,11 @@ class HebrewCalendarHolidays:
|
|
|
46
47
|
and subsequent rededication of the Second Temple.
|
|
47
48
|
https://en.wikipedia.org/wiki/Hanukkah
|
|
48
49
|
"""
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
self.
|
|
52
|
-
|
|
50
|
+
return {
|
|
51
|
+
dt
|
|
52
|
+
for hanukkah_dt in self._hebrew_calendar.hanukkah_date(self._year)
|
|
53
|
+
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: Union[int, Iterable[int]] = 0) -> set[date]:
|
|
55
57
|
"""
|
holidays/groups/hindu.py
CHANGED
|
@@ -14,7 +14,7 @@ from collections.abc import Iterable
|
|
|
14
14
|
from datetime import date
|
|
15
15
|
from typing import Optional
|
|
16
16
|
|
|
17
|
-
from holidays.calendars import _HinduLunisolar
|
|
17
|
+
from holidays.calendars.hindu import _HinduLunisolar
|
|
18
18
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
19
19
|
|
|
20
20
|
|
|
@@ -50,14 +50,9 @@ class HinduCalendarHolidays(EasternCalendarHolidays):
|
|
|
50
50
|
Adds customizable estimation label to holiday name if holiday date
|
|
51
51
|
is an estimation.
|
|
52
52
|
"""
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
name, dt_estimated, self._hindu_calendar_show_estimated, days_delta=days_delta
|
|
57
|
-
):
|
|
58
|
-
added_dates.add(dt)
|
|
59
|
-
|
|
60
|
-
return added_dates
|
|
53
|
+
return self._add_eastern_calendar_holiday_set(
|
|
54
|
+
name, dts_estimated, self._hindu_calendar_show_estimated, days_delta
|
|
55
|
+
)
|
|
61
56
|
|
|
62
57
|
def _add_bhai_dooj(self, name) -> Optional[date]:
|
|
63
58
|
"""
|
|
@@ -162,11 +157,18 @@ class HinduCalendarHolidays(EasternCalendarHolidays):
|
|
|
162
157
|
|
|
163
158
|
def _add_gudi_padwa(self, name) -> Optional[date]:
|
|
164
159
|
"""
|
|
165
|
-
Add Gudi Padwa.
|
|
160
|
+
Add Gudi Padwa / Ugadi.
|
|
161
|
+
|
|
162
|
+
Gudi Padwa is the traditional New Year festival celebrated in
|
|
163
|
+
Maharashtra. On the same day, the festival is also observed as
|
|
164
|
+
Ugadi in Karnataka, Telangana, and Andhra Pradesh.
|
|
165
|
+
|
|
166
|
+
It falls on the first day of Chaitra (March–April) according to
|
|
167
|
+
the Hindu lunisolar calendar.
|
|
166
168
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
References:
|
|
170
|
+
* https://en.wikipedia.org/wiki/Gudi_Padwa
|
|
171
|
+
* https://en.wikipedia.org/wiki/Ugadi
|
|
170
172
|
"""
|
|
171
173
|
return self._add_hindu_calendar_holiday(
|
|
172
174
|
name, self._hindu_calendar.gudi_padwa_date(self._year)
|
holidays/groups/islamic.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
from collections.abc import Iterable
|
|
14
14
|
from datetime import date
|
|
15
15
|
|
|
16
|
-
from holidays.calendars import _IslamicLunar
|
|
16
|
+
from holidays.calendars.islamic import _IslamicLunar
|
|
17
17
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
18
18
|
|
|
19
19
|
|
|
@@ -35,7 +35,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
35
35
|
|
|
36
36
|
https://en.wikipedia.org/wiki/Ali_al-Rida
|
|
37
37
|
"""
|
|
38
|
-
return self.
|
|
38
|
+
return self._add_islamic_calendar_holiday_set(
|
|
39
39
|
name, self._islamic_calendar.ali_al_rida_death_dates(self._year)
|
|
40
40
|
)
|
|
41
41
|
|
|
@@ -45,7 +45,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
45
45
|
|
|
46
46
|
https://en.wikipedia.org/wiki/Ali
|
|
47
47
|
"""
|
|
48
|
-
return self.
|
|
48
|
+
return self._add_islamic_calendar_holiday_set(
|
|
49
49
|
name, self._islamic_calendar.ali_birthday_dates(self._year)
|
|
50
50
|
)
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
55
55
|
|
|
56
56
|
https://en.wikipedia.org/wiki/Ali
|
|
57
57
|
"""
|
|
58
|
-
return self.
|
|
58
|
+
return self._add_islamic_calendar_holiday_set(
|
|
59
59
|
name, self._islamic_calendar.ali_death_dates(self._year)
|
|
60
60
|
)
|
|
61
61
|
|
|
@@ -65,7 +65,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
65
65
|
|
|
66
66
|
https://en.wikipedia.org/wiki/Arbaeen
|
|
67
67
|
"""
|
|
68
|
-
return self.
|
|
68
|
+
return self._add_islamic_calendar_holiday_set(
|
|
69
69
|
name, self._islamic_calendar.arbaeen_dates(self._year)
|
|
70
70
|
)
|
|
71
71
|
|
|
@@ -78,7 +78,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
78
78
|
Arafat.
|
|
79
79
|
https://en.wikipedia.org/wiki/Day_of_Arafah
|
|
80
80
|
"""
|
|
81
|
-
return self.
|
|
81
|
+
return self._add_islamic_calendar_holiday_set(
|
|
82
82
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=-1
|
|
83
83
|
)
|
|
84
84
|
|
|
@@ -90,7 +90,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
90
90
|
10th of Muharram, the first month of the Islamic calendar.
|
|
91
91
|
https://en.wikipedia.org/wiki/Ashura
|
|
92
92
|
"""
|
|
93
|
-
return self.
|
|
93
|
+
return self._add_islamic_calendar_holiday_set(
|
|
94
94
|
name, self._islamic_calendar.ashura_dates(self._year)
|
|
95
95
|
)
|
|
96
96
|
|
|
@@ -102,7 +102,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
102
102
|
10th of Muharram, the first month of the Islamic calendar.
|
|
103
103
|
https://en.wikipedia.org/wiki/Ashura
|
|
104
104
|
"""
|
|
105
|
-
return self.
|
|
105
|
+
return self._add_islamic_calendar_holiday_set(
|
|
106
106
|
name, self._islamic_calendar.ashura_dates(self._year), days_delta=-1
|
|
107
107
|
)
|
|
108
108
|
|
|
@@ -115,7 +115,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
115
115
|
to Allah's command.
|
|
116
116
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
117
117
|
"""
|
|
118
|
-
return self.
|
|
118
|
+
return self._add_islamic_calendar_holiday_set(
|
|
119
119
|
name, self._islamic_calendar.eid_al_adha_dates(self._year)
|
|
120
120
|
)
|
|
121
121
|
|
|
@@ -125,7 +125,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
125
125
|
|
|
126
126
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
127
127
|
"""
|
|
128
|
-
return self.
|
|
128
|
+
return self._add_islamic_calendar_holiday_set(
|
|
129
129
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+1
|
|
130
130
|
)
|
|
131
131
|
|
|
@@ -135,7 +135,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
135
135
|
|
|
136
136
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
137
137
|
"""
|
|
138
|
-
return self.
|
|
138
|
+
return self._add_islamic_calendar_holiday_set(
|
|
139
139
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+2
|
|
140
140
|
)
|
|
141
141
|
|
|
@@ -145,7 +145,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
145
145
|
|
|
146
146
|
https://en.wikipedia.org/wiki/Eid_al-Adha
|
|
147
147
|
"""
|
|
148
|
-
return self.
|
|
148
|
+
return self._add_islamic_calendar_holiday_set(
|
|
149
149
|
name, self._islamic_calendar.eid_al_adha_dates(self._year), days_delta=+3
|
|
150
150
|
)
|
|
151
151
|
|
|
@@ -158,7 +158,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
158
158
|
dawn-to-sunset fasting of Ramadan.
|
|
159
159
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
160
160
|
"""
|
|
161
|
-
return self.
|
|
161
|
+
return self._add_islamic_calendar_holiday_set(
|
|
162
162
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year)
|
|
163
163
|
)
|
|
164
164
|
|
|
@@ -168,7 +168,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
168
168
|
|
|
169
169
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
170
170
|
"""
|
|
171
|
-
return self.
|
|
171
|
+
return self._add_islamic_calendar_holiday_set(
|
|
172
172
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+1
|
|
173
173
|
)
|
|
174
174
|
|
|
@@ -178,17 +178,27 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
178
178
|
|
|
179
179
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
180
180
|
"""
|
|
181
|
-
return self.
|
|
181
|
+
return self._add_islamic_calendar_holiday_set(
|
|
182
182
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+2
|
|
183
183
|
)
|
|
184
184
|
|
|
185
|
+
def _add_eid_al_fitr_day_four(self, name) -> set[date]:
|
|
186
|
+
"""
|
|
187
|
+
Add Eid al-Fitr Day Four.
|
|
188
|
+
|
|
189
|
+
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
190
|
+
"""
|
|
191
|
+
return self._add_islamic_calendar_holiday_set(
|
|
192
|
+
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=+3
|
|
193
|
+
)
|
|
194
|
+
|
|
185
195
|
def _add_eid_al_fitr_eve(self, name) -> set[date]:
|
|
186
196
|
"""
|
|
187
197
|
Add Eid al-Fitr Eve (last day of 9th month of Islamic calendar).
|
|
188
198
|
|
|
189
199
|
https://en.wikipedia.org/wiki/Eid_al-Fitr
|
|
190
200
|
"""
|
|
191
|
-
return self.
|
|
201
|
+
return self._add_islamic_calendar_holiday_set(
|
|
192
202
|
name, self._islamic_calendar.eid_al_fitr_dates(self._year), days_delta=-1
|
|
193
203
|
)
|
|
194
204
|
|
|
@@ -198,7 +208,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
198
208
|
|
|
199
209
|
https://en.wikipedia.org/wiki/Eid_al-Ghadeer
|
|
200
210
|
"""
|
|
201
|
-
return self.
|
|
211
|
+
return self._add_islamic_calendar_holiday_set(
|
|
202
212
|
name, self._islamic_calendar.eid_al_ghadir_dates(self._year)
|
|
203
213
|
)
|
|
204
214
|
|
|
@@ -208,7 +218,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
208
218
|
|
|
209
219
|
https://en.wikipedia.org/wiki/Fatima
|
|
210
220
|
"""
|
|
211
|
-
return self.
|
|
221
|
+
return self._add_islamic_calendar_holiday_set(
|
|
212
222
|
name, self._islamic_calendar.fatima_death_dates(self._year)
|
|
213
223
|
)
|
|
214
224
|
|
|
@@ -218,7 +228,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
218
228
|
|
|
219
229
|
https://en.wikipedia.org/wiki/Grand_Magal_of_Touba
|
|
220
230
|
"""
|
|
221
|
-
return self.
|
|
231
|
+
return self._add_islamic_calendar_holiday_set(
|
|
222
232
|
name, self._islamic_calendar.grand_magal_of_touba_dates(self._year)
|
|
223
233
|
)
|
|
224
234
|
|
|
@@ -228,7 +238,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
228
238
|
|
|
229
239
|
https://web.archive.org/web/20241202170507/https://publicholidays.com.my/hari-hol-almarhum-sultan-iskandar/
|
|
230
240
|
"""
|
|
231
|
-
return self.
|
|
241
|
+
return self._add_islamic_calendar_holiday_set(
|
|
232
242
|
name, self._islamic_calendar.hari_hol_johor_dates(self._year)
|
|
233
243
|
)
|
|
234
244
|
|
|
@@ -238,7 +248,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
238
248
|
|
|
239
249
|
https://en.wikipedia.org/wiki/Hasan_al-Askari
|
|
240
250
|
"""
|
|
241
|
-
return self.
|
|
251
|
+
return self._add_islamic_calendar_holiday_set(
|
|
242
252
|
name, self._islamic_calendar.hasan_al_askari_death_dates(self._year)
|
|
243
253
|
)
|
|
244
254
|
|
|
@@ -248,7 +258,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
248
258
|
|
|
249
259
|
https://web.archive.org/web/20250323065556/https://decree.om/2022/rd20220088/
|
|
250
260
|
"""
|
|
251
|
-
return self.
|
|
261
|
+
return self._add_islamic_calendar_holiday_set(
|
|
252
262
|
name, self._islamic_calendar.ramadan_beginning_dates(self._year), days_delta=+28
|
|
253
263
|
)
|
|
254
264
|
|
|
@@ -258,12 +268,12 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
258
268
|
|
|
259
269
|
https://en.wikipedia.org/wiki/Muhammad_al-Mahdi
|
|
260
270
|
"""
|
|
261
|
-
return self.
|
|
271
|
+
return self._add_islamic_calendar_holiday_set(
|
|
262
272
|
name, self._islamic_calendar.imam_mahdi_birthday_dates(self._year)
|
|
263
273
|
)
|
|
264
274
|
|
|
265
|
-
def
|
|
266
|
-
self, name: str,
|
|
275
|
+
def _add_islamic_calendar_holiday_set(
|
|
276
|
+
self, name: str, dts_estimated: Iterable[tuple[date, bool]], days_delta: int = 0
|
|
267
277
|
) -> set[date]:
|
|
268
278
|
"""
|
|
269
279
|
Add lunar calendar holiday.
|
|
@@ -271,14 +281,9 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
271
281
|
Appends customizable estimation label at the end of holiday name if
|
|
272
282
|
holiday date is an estimation.
|
|
273
283
|
"""
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
name, dts, self._islamic_calendar_show_estimated, days_delta
|
|
278
|
-
):
|
|
279
|
-
added_dates.add(dt)
|
|
280
|
-
|
|
281
|
-
return added_dates
|
|
284
|
+
return self._add_eastern_calendar_holiday_set(
|
|
285
|
+
name, dts_estimated, self._islamic_calendar_show_estimated, days_delta
|
|
286
|
+
)
|
|
282
287
|
|
|
283
288
|
def _add_islamic_new_year_day(self, name) -> set[date]:
|
|
284
289
|
"""
|
|
@@ -290,7 +295,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
290
295
|
observed by most Muslims on the first day of the month of Muharram.
|
|
291
296
|
https://en.wikipedia.org/wiki/Islamic_New_Year
|
|
292
297
|
"""
|
|
293
|
-
return self.
|
|
298
|
+
return self._add_islamic_calendar_holiday_set(
|
|
294
299
|
name, self._islamic_calendar.hijri_new_year_dates(self._year)
|
|
295
300
|
)
|
|
296
301
|
|
|
@@ -301,7 +306,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
301
306
|
The Prophet's Ascension.
|
|
302
307
|
https://en.wikipedia.org/wiki/Isra'_and_Mi'raj
|
|
303
308
|
"""
|
|
304
|
-
return self.
|
|
309
|
+
return self._add_islamic_calendar_holiday_set(
|
|
305
310
|
name, self._islamic_calendar.isra_and_miraj_dates(self._year)
|
|
306
311
|
)
|
|
307
312
|
|
|
@@ -312,7 +317,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
312
317
|
The Night of Power.
|
|
313
318
|
https://en.wikipedia.org/wiki/Night_of_Power
|
|
314
319
|
"""
|
|
315
|
-
return self.
|
|
320
|
+
return self._add_islamic_calendar_holiday_set(
|
|
316
321
|
name, self._islamic_calendar.laylat_al_qadr_dates(self._year)
|
|
317
322
|
)
|
|
318
323
|
|
|
@@ -322,7 +327,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
322
327
|
|
|
323
328
|
https://en.wikipedia.org/wiki/Islam_in_Maldives
|
|
324
329
|
"""
|
|
325
|
-
return self.
|
|
330
|
+
return self._add_islamic_calendar_holiday_set(
|
|
326
331
|
name, self._islamic_calendar.maldives_embraced_islam_day_dates(self._year)
|
|
327
332
|
)
|
|
328
333
|
|
|
@@ -334,7 +339,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
334
339
|
Muhammad.
|
|
335
340
|
https://en.wikipedia.org/wiki/Mawlid
|
|
336
341
|
"""
|
|
337
|
-
return self.
|
|
342
|
+
return self._add_islamic_calendar_holiday_set(
|
|
338
343
|
name, self._islamic_calendar.mawlid_dates(self._year)
|
|
339
344
|
)
|
|
340
345
|
|
|
@@ -346,7 +351,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
346
351
|
Muhammad.
|
|
347
352
|
https://en.wikipedia.org/wiki/Mawlid
|
|
348
353
|
"""
|
|
349
|
-
return self.
|
|
354
|
+
return self._add_islamic_calendar_holiday_set(
|
|
350
355
|
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+1
|
|
351
356
|
)
|
|
352
357
|
|
|
@@ -359,7 +364,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
359
364
|
the holy Quran.
|
|
360
365
|
https://web.archive.org/web/20241012115752/https://zamzam.com/blog/nuzul-al-quran/
|
|
361
366
|
"""
|
|
362
|
-
return self.
|
|
367
|
+
return self._add_islamic_calendar_holiday_set(
|
|
363
368
|
name, self._islamic_calendar.nuzul_al_quran_dates(self._year)
|
|
364
369
|
)
|
|
365
370
|
|
|
@@ -376,7 +381,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
376
381
|
ritual akin to Christian baptism.
|
|
377
382
|
https://web.archive.org/web/20240722052111/https://www.officeholidays.com/holidays/mali/prophets-baptism
|
|
378
383
|
"""
|
|
379
|
-
return self.
|
|
384
|
+
return self._add_islamic_calendar_holiday_set(
|
|
380
385
|
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+7
|
|
381
386
|
)
|
|
382
387
|
|
|
@@ -386,7 +391,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
386
391
|
|
|
387
392
|
https://en.wikipedia.org/wiki/Hasan_ibn_Ali
|
|
388
393
|
"""
|
|
389
|
-
return self.
|
|
394
|
+
return self._add_islamic_calendar_holiday_set(
|
|
390
395
|
name, self._islamic_calendar.prophet_death_dates(self._year)
|
|
391
396
|
)
|
|
392
397
|
|
|
@@ -396,7 +401,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
396
401
|
|
|
397
402
|
https://en.wikipedia.org/wiki/Qaumee_Dhuvas_(Maldives_National_Day)
|
|
398
403
|
"""
|
|
399
|
-
return self.
|
|
404
|
+
return self._add_islamic_calendar_holiday_set(
|
|
400
405
|
name, self._islamic_calendar.quamee_dhuvas_dates(self._year)
|
|
401
406
|
)
|
|
402
407
|
|
|
@@ -408,7 +413,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
408
413
|
worldwide as a month of fasting, prayer, reflection, and community
|
|
409
414
|
https://en.wikipedia.org/wiki/Ramadan
|
|
410
415
|
"""
|
|
411
|
-
return self.
|
|
416
|
+
return self._add_islamic_calendar_holiday_set(
|
|
412
417
|
name, self._islamic_calendar.ramadan_beginning_dates(self._year)
|
|
413
418
|
)
|
|
414
419
|
|
|
@@ -418,7 +423,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
418
423
|
|
|
419
424
|
https://en.wikipedia.org/wiki/Ja'far_al-Sadiq
|
|
420
425
|
"""
|
|
421
|
-
return self.
|
|
426
|
+
return self._add_islamic_calendar_holiday_set(
|
|
422
427
|
name, self._islamic_calendar.sadiq_birthday_dates(self._year)
|
|
423
428
|
)
|
|
424
429
|
|
|
@@ -428,7 +433,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
428
433
|
|
|
429
434
|
https://en.wikipedia.org/wiki/Ja'far_al-Sadiq
|
|
430
435
|
"""
|
|
431
|
-
return self.
|
|
436
|
+
return self._add_islamic_calendar_holiday_set(
|
|
432
437
|
name, self._islamic_calendar.sadiq_death_dates(self._year)
|
|
433
438
|
)
|
|
434
439
|
|
|
@@ -438,6 +443,6 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
438
443
|
|
|
439
444
|
https://en.wikipedia.org/wiki/Tasua
|
|
440
445
|
"""
|
|
441
|
-
return self.
|
|
446
|
+
return self._add_islamic_calendar_holiday_set(
|
|
442
447
|
name, self._islamic_calendar.tasua_dates(self._year)
|
|
443
448
|
)
|
holidays/groups/mongolian.py
CHANGED
holidays/groups/sinhala.py
CHANGED
|
@@ -14,7 +14,7 @@ from collections.abc import Iterable
|
|
|
14
14
|
from datetime import date
|
|
15
15
|
from typing import Optional
|
|
16
16
|
|
|
17
|
-
from holidays.calendars import _SinhalaLunar
|
|
17
|
+
from holidays.calendars.sinhala import _SinhalaLunar
|
|
18
18
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
19
19
|
|
|
20
20
|
|
|
@@ -58,14 +58,9 @@ class SinhalaCalendarHolidays(EasternCalendarHolidays):
|
|
|
58
58
|
Adds customizable estimation label to holiday name if holiday date
|
|
59
59
|
is an estimation.
|
|
60
60
|
"""
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
name, dt_estimated, self._sinhala_calendar_show_estimated, days_delta=days_delta
|
|
65
|
-
):
|
|
66
|
-
added_dates.add(dt)
|
|
67
|
-
|
|
68
|
-
return added_dates
|
|
61
|
+
return self._add_eastern_calendar_holiday_set(
|
|
62
|
+
name, dts_estimated, self._sinhala_calendar_show_estimated, days_delta
|
|
63
|
+
)
|
|
69
64
|
|
|
70
65
|
def _add_bak_poya(self, name) -> Optional[date]:
|
|
71
66
|
"""
|
holidays/groups/tibetan.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
from datetime import date
|
|
14
14
|
from typing import Optional
|
|
15
15
|
|
|
16
|
-
from holidays.calendars import _TibetanLunisolar
|
|
16
|
+
from holidays.calendars.tibetan import _TibetanLunisolar
|
|
17
17
|
from holidays.groups.eastern import EasternCalendarHolidays
|
|
18
18
|
|
|
19
19
|
|
|
@@ -103,14 +103,13 @@ class TibetanCalendarHolidays(EasternCalendarHolidays):
|
|
|
103
103
|
name, self._tibetan_calendar.losar_date(self._year)
|
|
104
104
|
)
|
|
105
105
|
|
|
106
|
-
def _add_losar_day_two(self, name) ->
|
|
106
|
+
def _add_losar_day_two(self, name) -> Optional[date]:
|
|
107
107
|
"""
|
|
108
108
|
Add Losar Day Two.
|
|
109
109
|
"""
|
|
110
|
-
|
|
110
|
+
return self._add_tibetan_calendar_holiday(
|
|
111
111
|
name, self._tibetan_calendar.losar_date(self._year), days_delta=+1
|
|
112
112
|
)
|
|
113
|
-
return {dt} if dt is not None else set()
|
|
114
113
|
|
|
115
114
|
def _add_thimphu_drubchen_day(self, name) -> Optional[date]:
|
|
116
115
|
"""
|
holidays/holiday_base.py
CHANGED
|
@@ -841,6 +841,9 @@ class HolidayBase(dict[date, str]):
|
|
|
841
841
|
dt = dt if isinstance(dt, date) else date(self._year, *dt)
|
|
842
842
|
return dt.weekday() == weekday
|
|
843
843
|
|
|
844
|
+
def _get_weekend(self, dt: date) -> set[int]:
|
|
845
|
+
return self.weekend
|
|
846
|
+
|
|
844
847
|
def _is_monday(self, *args) -> bool:
|
|
845
848
|
return self._check_weekday(MON, *args)
|
|
846
849
|
|
|
@@ -869,7 +872,7 @@ class HolidayBase(dict[date, str]):
|
|
|
869
872
|
"""
|
|
870
873
|
dt = args if len(args) > 1 else args[0]
|
|
871
874
|
dt = dt if isinstance(dt, date) else date(self._year, *dt)
|
|
872
|
-
return dt.weekday() in self.
|
|
875
|
+
return dt.weekday() in self._get_weekend(dt)
|
|
873
876
|
|
|
874
877
|
def _populate(self, year: int) -> None:
|
|
875
878
|
"""This is a private method that populates (generates and adds) holidays
|
|
@@ -1145,9 +1148,7 @@ class HolidayBase(dict[date, str]):
|
|
|
1145
1148
|
Returns:
|
|
1146
1149
|
True if the date's week day is a weekend day, False otherwise.
|
|
1147
1150
|
"""
|
|
1148
|
-
|
|
1149
|
-
# `HolidayBase._is_weekend` method and perform the check directly instead.
|
|
1150
|
-
return self.__keytransform__(key).weekday() in self.weekend
|
|
1151
|
+
return self._is_weekend(self.__keytransform__(key))
|
|
1151
1152
|
|
|
1152
1153
|
def is_working_day(self, key: DateLike) -> bool:
|
|
1153
1154
|
"""Check if the given date is considered a working day.
|
holidays/ical.py
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
import re
|
|
14
14
|
import uuid
|
|
15
|
-
from datetime import date, datetime,
|
|
15
|
+
from datetime import date, datetime, timezone
|
|
16
16
|
from typing import Union
|
|
17
17
|
|
|
18
|
+
from holidays.calendars.gregorian import _timedelta
|
|
18
19
|
from holidays.holiday_base import HolidayBase
|
|
19
20
|
from holidays.version import __version__
|
|
20
21
|
|
|
@@ -185,16 +186,17 @@ class ICalExporter:
|
|
|
185
186
|
|
|
186
187
|
sorted_dates = sorted(self.holidays.keys())
|
|
187
188
|
# Merged continuous holiday with the same name and use `DURATION` instead.
|
|
189
|
+
n = len(sorted_dates)
|
|
188
190
|
i = 0
|
|
189
|
-
while i <
|
|
191
|
+
while i < n:
|
|
190
192
|
dt = sorted_dates[i]
|
|
191
193
|
names = self.holidays.get_list(dt)
|
|
192
194
|
|
|
193
195
|
for name in names:
|
|
194
196
|
days = 1
|
|
195
197
|
while (
|
|
196
|
-
i + days <
|
|
197
|
-
and sorted_dates[i + days] == sorted_dates[i]
|
|
198
|
+
i + days < n
|
|
199
|
+
and sorted_dates[i + days] == _timedelta(sorted_dates[i], days)
|
|
198
200
|
and name in self.holidays.get_list(sorted_dates[i + days])
|
|
199
201
|
):
|
|
200
202
|
days += 1
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|