holidays 0.78__py3-none-any.whl → 0.79__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/chinese.py +14 -4
- holidays/calendars/ethiopian.py +31 -0
- holidays/calendars/islamic.py +16 -4
- holidays/calendars/julian.py +14 -0
- holidays/calendars/mandaean.py +59 -0
- holidays/calendars/tibetan.py +1466 -0
- holidays/constants.py +2 -0
- holidays/countries/__init__.py +13 -0
- holidays/countries/afghanistan.py +6 -39
- holidays/countries/albania.py +3 -22
- holidays/countries/argentina.py +3 -18
- holidays/countries/azerbaijan.py +6 -39
- holidays/countries/bahrain.py +29 -38
- holidays/countries/bhutan.py +194 -0
- holidays/countries/bosnia_and_herzegovina.py +2 -27
- holidays/countries/brunei.py +7 -117
- holidays/countries/burkina_faso.py +4 -15
- holidays/countries/cameroon.py +3 -34
- holidays/countries/canada.py +2 -1
- holidays/countries/central_african_republic.py +3 -16
- holidays/countries/chad.py +4 -17
- holidays/countries/chile.py +20 -4
- holidays/countries/christmas_island.py +4 -15
- holidays/countries/cocos_islands.py +5 -24
- holidays/countries/egypt.py +5 -37
- holidays/countries/ethiopia.py +18 -47
- holidays/countries/fiji.py +1 -2
- holidays/countries/gabon.py +3 -23
- holidays/countries/gambia.py +168 -0
- holidays/countries/guinea.py +5 -27
- holidays/countries/guinea_bissau.py +100 -0
- holidays/countries/guyana.py +2 -17
- holidays/countries/india.py +12 -25
- holidays/countries/indonesia.py +6 -158
- holidays/countries/iran.py +16 -126
- holidays/countries/iraq.py +276 -0
- holidays/countries/kazakhstan.py +2 -18
- holidays/countries/kenya.py +2 -8
- holidays/countries/kiribati.py +124 -0
- holidays/countries/lebanon.py +5 -87
- holidays/countries/liberia.py +80 -0
- holidays/countries/libya.py +5 -37
- holidays/countries/malaysia.py +9 -130
- holidays/countries/mali.py +4 -9
- holidays/countries/mauritius.py +1 -2
- holidays/countries/montenegro.py +3 -18
- holidays/countries/nepal.py +42 -44
- holidays/countries/niger.py +14 -74
- holidays/countries/north_macedonia.py +3 -39
- holidays/countries/oman.py +6 -28
- holidays/countries/pakistan.py +5 -30
- holidays/countries/palestine.py +2 -5
- holidays/countries/philippines.py +3 -33
- holidays/countries/qatar.py +3 -45
- holidays/countries/saudi_arabia.py +3 -0
- holidays/countries/senegal.py +6 -16
- holidays/countries/sierra_leone.py +4 -20
- holidays/countries/singapore.py +3 -59
- holidays/countries/south_georgia_and_the_south_sandwich_islands.py +160 -0
- holidays/countries/spain.py +3 -10
- holidays/countries/sri_lanka.py +3 -14
- holidays/countries/suriname.py +11 -19
- holidays/countries/syrian_arab_republic.py +134 -0
- holidays/countries/tanzania.py +3 -9
- holidays/countries/timor_leste.py +2 -17
- holidays/countries/togo.py +4 -29
- holidays/countries/trinidad_and_tobago.py +2 -9
- holidays/countries/turkey.py +2 -116
- holidays/countries/turkmenistan.py +158 -0
- holidays/countries/united_arab_emirates.py +5 -29
- holidays/countries/uzbekistan.py +3 -31
- holidays/countries/yemen.py +8 -52
- holidays/groups/__init__.py +2 -0
- holidays/groups/christian.py +48 -12
- holidays/groups/international.py +17 -1
- holidays/groups/islamic.py +1 -1
- holidays/groups/mandaean.py +107 -0
- holidays/groups/tibetan.py +153 -0
- holidays/holiday_base.py +14 -0
- holidays/locale/ar/LC_MESSAGES/BH.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/IQ.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/SY.mo +0 -0
- holidays/locale/en_GM/LC_MESSAGES/GM.mo +0 -0
- holidays/locale/en_GS/LC_MESSAGES/GS.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CL.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GM.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GS.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/IQ.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/SY.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TM.mo +0 -0
- holidays/locale/pt_GW/LC_MESSAGES/GW.mo +0 -0
- holidays/locale/ru/LC_MESSAGES/TM.mo +0 -0
- holidays/locale/tk/LC_MESSAGES/TM.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CL.mo +0 -0
- holidays/registry.py +13 -0
- holidays/version.py +1 -1
- {holidays-0.78.dist-info → holidays-0.79.dist-info}/METADATA +68 -5
- {holidays-0.78.dist-info → holidays-0.79.dist-info}/RECORD +105 -78
- {holidays-0.78.dist-info → holidays-0.79.dist-info}/licenses/CONTRIBUTORS +2 -0
- {holidays-0.78.dist-info → holidays-0.79.dist-info}/WHEEL +0 -0
- {holidays-0.78.dist-info → holidays-0.79.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.78.dist-info → holidays-0.79.dist-info}/top_level.txt +0 -0
holidays/countries/yemen.py
CHANGED
|
@@ -13,22 +13,7 @@
|
|
|
13
13
|
from gettext import gettext as tr
|
|
14
14
|
|
|
15
15
|
from holidays.calendars import _CustomIslamicHolidays
|
|
16
|
-
from holidays.calendars.gregorian import
|
|
17
|
-
JAN,
|
|
18
|
-
FEB,
|
|
19
|
-
MAR,
|
|
20
|
-
APR,
|
|
21
|
-
MAY,
|
|
22
|
-
JUN,
|
|
23
|
-
JUL,
|
|
24
|
-
AUG,
|
|
25
|
-
SEP,
|
|
26
|
-
OCT,
|
|
27
|
-
THU,
|
|
28
|
-
FRI,
|
|
29
|
-
SAT,
|
|
30
|
-
_timedelta,
|
|
31
|
-
)
|
|
16
|
+
from holidays.calendars.gregorian import AUG, THU, FRI, SAT, _timedelta
|
|
32
17
|
from holidays.constants import PUBLIC, SCHOOL, WORKDAY
|
|
33
18
|
from holidays.groups import InternationalHolidays, IslamicHolidays
|
|
34
19
|
from holidays.observed_holiday_base import ObservedHolidayBase, FRI_TO_NEXT_WORKDAY
|
|
@@ -156,52 +141,23 @@ class YEM(Yemen):
|
|
|
156
141
|
|
|
157
142
|
class YemenIslamicHolidays(_CustomIslamicHolidays):
|
|
158
143
|
# https://web.archive.org/web/20250115070635/https://www.timeanddate.com/holidays/yemen/eid-al-adha-first-day
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
2021: (JUL, 20),
|
|
162
|
-
2022: (JUL, 9),
|
|
163
|
-
2023: (JUN, 28),
|
|
164
|
-
2024: (JUN, 16),
|
|
165
|
-
}
|
|
144
|
+
|
|
145
|
+
EID_AL_ADHA_DATES_CONFIRMED_YEARS = (2020, 2024)
|
|
166
146
|
|
|
167
147
|
# https://web.archive.org/web/20250218061345/https://www.timeanddate.com/holidays/yemen/eid-al-fitr-first-day
|
|
168
|
-
|
|
169
|
-
2020: (MAY, 24),
|
|
170
|
-
2021: (MAY, 13),
|
|
171
|
-
2022: (MAY, 2),
|
|
172
|
-
2023: (APR, 21),
|
|
173
|
-
2024: (APR, 10),
|
|
174
|
-
2025: (MAR, 30),
|
|
175
|
-
}
|
|
148
|
+
EID_AL_FITR_DATES_CONFIRMED_YEARS = (2020, 2025)
|
|
176
149
|
|
|
177
150
|
# https://web.archive.org/web/20241011200213/https://www.timeanddate.com/holidays/yemen/muharram-new-year
|
|
151
|
+
HIJRI_NEW_YEAR_DATES_CONFIRMED_YEARS = (2020, 2024)
|
|
178
152
|
HIJRI_NEW_YEAR_DATES = {
|
|
179
|
-
2020: (AUG, 20),
|
|
180
153
|
2021: (AUG, 10),
|
|
181
|
-
2022: (JUL, 30),
|
|
182
|
-
2023: (JUL, 19),
|
|
183
|
-
2024: (JUL, 7),
|
|
184
154
|
}
|
|
185
155
|
|
|
186
156
|
# https://web.archive.org/web/20241010083000/https://www.timeanddate.com/holidays/yemen/isra-miraj
|
|
187
|
-
|
|
188
|
-
2023: (FEB, 18),
|
|
189
|
-
2024: (FEB, 8),
|
|
190
|
-
2025: (JAN, 27),
|
|
191
|
-
}
|
|
157
|
+
ISRA_AND_MIRAJ_DATES_CONFIRMED_YEARS = (2023, 2025)
|
|
192
158
|
|
|
193
159
|
# https://web.archive.org/web/20241010222331/https://www.timeanddate.com/holidays/yemen/prophet-birthday
|
|
194
|
-
|
|
195
|
-
2020: (OCT, 29),
|
|
196
|
-
2021: (OCT, 18),
|
|
197
|
-
2022: (OCT, 8),
|
|
198
|
-
2023: (SEP, 27),
|
|
199
|
-
2024: (SEP, 15),
|
|
200
|
-
}
|
|
160
|
+
MAWLID_DATES_CONFIRMED_YEARS = (2020, 2024)
|
|
201
161
|
|
|
202
162
|
# https://web.archive.org/web/20250119111122/https://www.timeanddate.com/holidays/yemen/ramadan-begins
|
|
203
|
-
|
|
204
|
-
2023: (MAR, 23),
|
|
205
|
-
2024: (MAR, 11),
|
|
206
|
-
2025: (MAR, 1),
|
|
207
|
-
}
|
|
163
|
+
RAMADAN_BEGINNING_DATES_CONFIRMED_YEARS = (2023, 2025)
|
holidays/groups/__init__.py
CHANGED
|
@@ -22,7 +22,9 @@ from holidays.groups.hebrew import HebrewCalendarHolidays
|
|
|
22
22
|
from holidays.groups.hindu import HinduCalendarHolidays
|
|
23
23
|
from holidays.groups.international import InternationalHolidays
|
|
24
24
|
from holidays.groups.islamic import IslamicHolidays
|
|
25
|
+
from holidays.groups.mandaean import MandaeanHolidays
|
|
25
26
|
from holidays.groups.mongolian import MongolianCalendarHolidays
|
|
26
27
|
from holidays.groups.persian import PersianCalendarHolidays
|
|
27
28
|
from holidays.groups.sinhala import SinhalaCalendarHolidays
|
|
28
29
|
from holidays.groups.thai import ThaiCalendarHolidays
|
|
30
|
+
from holidays.groups.tibetan import TibetanCalendarHolidays
|
holidays/groups/christian.py
CHANGED
|
@@ -14,8 +14,9 @@ from datetime import date
|
|
|
14
14
|
|
|
15
15
|
from dateutil.easter import EASTER_ORTHODOX, EASTER_WESTERN, easter
|
|
16
16
|
|
|
17
|
-
from holidays.calendars.
|
|
18
|
-
from holidays.calendars.
|
|
17
|
+
from holidays.calendars.ethiopian import ETHIOPIAN_CALENDAR, is_ethiopian_leap_year
|
|
18
|
+
from holidays.calendars.gregorian import GREGORIAN_CALENDAR, JAN, AUG, SEP, DEC, _timedelta
|
|
19
|
+
from holidays.calendars.julian import JULIAN_CALENDAR, julian_calendar_drift
|
|
19
20
|
from holidays.calendars.julian_revised import JULIAN_REVISED_CALENDAR
|
|
20
21
|
|
|
21
22
|
|
|
@@ -36,8 +37,8 @@ class ChristianHolidays:
|
|
|
36
37
|
self.__verify_calendar(calendar)
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
|
-
date(self._year, JAN, 7)
|
|
40
|
-
if self.__is_julian_calendar(calendar)
|
|
40
|
+
_timedelta(date(self._year, JAN, 7), julian_calendar_drift(self._year - 1))
|
|
41
|
+
if self.__is_julian_calendar(calendar) or self.__is_ethiopian_calendar(calendar)
|
|
41
42
|
else date(self._year, DEC, 25)
|
|
42
43
|
)
|
|
43
44
|
|
|
@@ -53,6 +54,14 @@ class ChristianHolidays:
|
|
|
53
54
|
method=EASTER_WESTERN if self.__is_gregorian_calendar(calendar) else EASTER_ORTHODOX,
|
|
54
55
|
)
|
|
55
56
|
|
|
57
|
+
@staticmethod
|
|
58
|
+
def __is_ethiopian_calendar(calendar):
|
|
59
|
+
"""
|
|
60
|
+
Return True if `calendar` is Ethiopian calendar.
|
|
61
|
+
Return False otherwise.
|
|
62
|
+
"""
|
|
63
|
+
return calendar == ETHIOPIAN_CALENDAR
|
|
64
|
+
|
|
56
65
|
@staticmethod
|
|
57
66
|
def __is_gregorian_calendar(calendar):
|
|
58
67
|
"""
|
|
@@ -74,10 +83,15 @@ class ChristianHolidays:
|
|
|
74
83
|
"""
|
|
75
84
|
Verify calendar type.
|
|
76
85
|
"""
|
|
77
|
-
if calendar not in {
|
|
86
|
+
if calendar not in {
|
|
87
|
+
ETHIOPIAN_CALENDAR,
|
|
88
|
+
GREGORIAN_CALENDAR,
|
|
89
|
+
JULIAN_CALENDAR,
|
|
90
|
+
JULIAN_REVISED_CALENDAR,
|
|
91
|
+
}:
|
|
78
92
|
raise ValueError(
|
|
79
|
-
f"Unknown calendar name: {calendar}. "
|
|
80
|
-
f"
|
|
93
|
+
f"Unknown calendar name: {calendar}. Use `{ETHIOPIAN_CALENDAR}`, "
|
|
94
|
+
f"`{GREGORIAN_CALENDAR}`, `{JULIAN_CALENDAR}` or `{JULIAN_REVISED_CALENDAR}`."
|
|
81
95
|
)
|
|
82
96
|
|
|
83
97
|
@property
|
|
@@ -158,7 +172,9 @@ class ChristianHolidays:
|
|
|
158
172
|
self.__verify_calendar(calendar)
|
|
159
173
|
|
|
160
174
|
return (
|
|
161
|
-
self.
|
|
175
|
+
self._add_holiday(
|
|
176
|
+
name, _timedelta(date(self._year, AUG, 28), julian_calendar_drift(self._year))
|
|
177
|
+
)
|
|
162
178
|
if self.__is_julian_calendar(calendar)
|
|
163
179
|
else self._add_holiday_aug_15(name)
|
|
164
180
|
)
|
|
@@ -299,10 +315,30 @@ class ChristianHolidays:
|
|
|
299
315
|
calendar = calendar or self.__calendar
|
|
300
316
|
self.__verify_calendar(calendar)
|
|
301
317
|
|
|
302
|
-
|
|
303
|
-
self.
|
|
304
|
-
|
|
305
|
-
|
|
318
|
+
if self.__is_julian_calendar(calendar) or self.__is_ethiopian_calendar(calendar):
|
|
319
|
+
dt = _timedelta(date(self._year, JAN, 19), julian_calendar_drift(self._year - 1))
|
|
320
|
+
return self._add_holiday(
|
|
321
|
+
name,
|
|
322
|
+
_timedelta(dt, +1)
|
|
323
|
+
if self.__is_ethiopian_calendar(calendar)
|
|
324
|
+
and is_ethiopian_leap_year(self._year - 1)
|
|
325
|
+
else dt,
|
|
326
|
+
)
|
|
327
|
+
else:
|
|
328
|
+
return self._add_holiday_jan_6(name)
|
|
329
|
+
|
|
330
|
+
def _add_finding_of_true_cross(self, name) -> date:
|
|
331
|
+
"""
|
|
332
|
+
Add Finding of True Cross.
|
|
333
|
+
|
|
334
|
+
Finding of True Cross, also known as Meskel, is an Ethiopian and Eritrean Orthodox
|
|
335
|
+
Tewahedo Church holiday that commemorates the discovery of the True Cross by the
|
|
336
|
+
Roman Empress Saint Helena of Constantinople in the fourth century.
|
|
337
|
+
https://en.wikipedia.org/wiki/Meskel
|
|
338
|
+
"""
|
|
339
|
+
dt = _timedelta(date(self._year, SEP, 27), julian_calendar_drift(self._year))
|
|
340
|
+
return self._add_holiday(
|
|
341
|
+
name, _timedelta(dt, +1) if is_ethiopian_leap_year(self._year) else dt
|
|
306
342
|
)
|
|
307
343
|
|
|
308
344
|
def _add_good_friday(self, name, calendar=None) -> date:
|
holidays/groups/international.py
CHANGED
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
14
|
|
|
15
|
-
from holidays.calendars.
|
|
15
|
+
from holidays.calendars.ethiopian import is_ethiopian_leap_year
|
|
16
|
+
from holidays.calendars.gregorian import JAN, SEP, _timedelta
|
|
17
|
+
from holidays.calendars.julian import julian_calendar_drift
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
class InternationalHolidays:
|
|
@@ -85,6 +87,20 @@ class InternationalHolidays:
|
|
|
85
87
|
"""
|
|
86
88
|
return self._add_holiday_oct_12(name)
|
|
87
89
|
|
|
90
|
+
def _add_ethiopian_new_year(self, name) -> date:
|
|
91
|
+
"""
|
|
92
|
+
Add Ethiopian New Year.
|
|
93
|
+
|
|
94
|
+
Ethiopian New Year, also known as Enkutatash, is a public holiday celebrated
|
|
95
|
+
on Meskerem 1 in the Ethiopian calendar, marking the start of the year in
|
|
96
|
+
Ethiopia and Eritrea.
|
|
97
|
+
https://en.wikipedia.org/wiki/Enkutatash
|
|
98
|
+
"""
|
|
99
|
+
dt = _timedelta(date(self._year, SEP, 11), julian_calendar_drift(self._year))
|
|
100
|
+
return self._add_holiday(
|
|
101
|
+
name, _timedelta(dt, +1) if is_ethiopian_leap_year(self._year) else dt
|
|
102
|
+
)
|
|
103
|
+
|
|
88
104
|
def _add_europe_day(self, name):
|
|
89
105
|
"""
|
|
90
106
|
Add Europe Day (May 9th)
|
holidays/groups/islamic.py
CHANGED
|
@@ -374,7 +374,7 @@ class IslamicHolidays(EasternCalendarHolidays):
|
|
|
374
374
|
reflects the local interpretation and honor of the Prophet Muhammad.
|
|
375
375
|
The term "baptism" is symbolic and not literal - there's no Islamic
|
|
376
376
|
ritual akin to Christian baptism.
|
|
377
|
-
https://www.officeholidays.com/holidays/mali/prophets-baptism
|
|
377
|
+
https://web.archive.org/web/20240722052111/https://www.officeholidays.com/holidays/mali/prophets-baptism
|
|
378
378
|
"""
|
|
379
379
|
return self._add_islamic_calendar_holiday(
|
|
380
380
|
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+7
|
|
@@ -0,0 +1,107 @@
|
|
|
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 datetime import date
|
|
14
|
+
from typing import Optional
|
|
15
|
+
|
|
16
|
+
from holidays.calendars.gregorian import _timedelta
|
|
17
|
+
from holidays.calendars.mandaean import _Mandaean
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class MandaeanHolidays:
|
|
21
|
+
"""
|
|
22
|
+
Mandaean holidays.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
def __init__(self) -> None:
|
|
26
|
+
self._mandaean = _Mandaean()
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def _dehwa_hanina(self):
|
|
30
|
+
return self._mandaean.mandaean_to_gregorian(self._year - 1, 9, 23)
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def _great_feast(self):
|
|
34
|
+
return self._mandaean.mandaean_to_gregorian(self._year, 1, 6)
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def _parwanaya(self):
|
|
38
|
+
return self._mandaean.mandaean_to_gregorian(self._year - 1, 13, 1)
|
|
39
|
+
|
|
40
|
+
def _add_mandaean_holiday(self, name: str, dt: Optional[date]) -> Optional[date]:
|
|
41
|
+
"""
|
|
42
|
+
Add a Mandaean holiday.
|
|
43
|
+
"""
|
|
44
|
+
if dt is None:
|
|
45
|
+
return None
|
|
46
|
+
return self._add_holiday(name, dt)
|
|
47
|
+
|
|
48
|
+
def _add_parwanaya_day(self, name) -> Optional[date]:
|
|
49
|
+
"""
|
|
50
|
+
Add Parwanaya (Feast of Creation).
|
|
51
|
+
A major Mandaean holiday celebrated over five days after the 8th month.
|
|
52
|
+
The five intercalary days are considered as the 13th month.
|
|
53
|
+
Marks the creation of the world and renewal of life.
|
|
54
|
+
https://en.wikipedia.org/wiki/Parwanaya
|
|
55
|
+
"""
|
|
56
|
+
return self._add_mandaean_holiday(name, self._parwanaya)
|
|
57
|
+
|
|
58
|
+
def _add_parwanaya_day_two(self, name) -> Optional[date]:
|
|
59
|
+
return self._add_mandaean_holiday(name, _timedelta(self._parwanaya, +1))
|
|
60
|
+
|
|
61
|
+
def _add_parwanaya_day_three(self, name) -> Optional[date]:
|
|
62
|
+
return self._add_mandaean_holiday(name, _timedelta(self._parwanaya, +2))
|
|
63
|
+
|
|
64
|
+
def _add_parwanaya_day_four(self, name) -> Optional[date]:
|
|
65
|
+
return self._add_mandaean_holiday(name, _timedelta(self._parwanaya, +3))
|
|
66
|
+
|
|
67
|
+
def _add_parwanaya_day_five(self, name) -> Optional[date]:
|
|
68
|
+
return self._add_mandaean_holiday(name, _timedelta(self._parwanaya, +4))
|
|
69
|
+
|
|
70
|
+
def _add_dehwa_daimana_day(self, name) -> Optional[date]:
|
|
71
|
+
"""
|
|
72
|
+
Add Dehwa Daimana (Birthday of Prophet Yahya).
|
|
73
|
+
Celebrated on 1st day of Mandaean 11th month.
|
|
74
|
+
https://en.wikipedia.org/wiki/Dehwa_Daimana
|
|
75
|
+
"""
|
|
76
|
+
return self._add_mandaean_holiday(
|
|
77
|
+
name, self._mandaean.mandaean_to_gregorian(self._year - 1, 11, 1)
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def _add_dehwa_hanina_day(self, name) -> Optional[date]:
|
|
81
|
+
"""
|
|
82
|
+
Add Dehwa Hanina (Little Feast / Day of Victory).
|
|
83
|
+
Commemorates spiritual triumph and deliverance.
|
|
84
|
+
Celebrated on 23rd day of the 9th Mandaean month.
|
|
85
|
+
https://en.wikipedia.org/wiki/Dehwa_Hanina
|
|
86
|
+
"""
|
|
87
|
+
return self._add_mandaean_holiday(name, self._dehwa_hanina)
|
|
88
|
+
|
|
89
|
+
def _add_dehwa_hanina_day_two(self, name) -> Optional[date]:
|
|
90
|
+
return self._add_mandaean_holiday(name, _timedelta(self._dehwa_hanina, +1))
|
|
91
|
+
|
|
92
|
+
def _add_great_feast_day(self, name) -> Optional[date]:
|
|
93
|
+
"""
|
|
94
|
+
Add Great Feast (Feast of the Great Shishlam).
|
|
95
|
+
Celebrated on the 6th day of the first month of the Mandaean calendar.
|
|
96
|
+
https://en.wikipedia.org/wiki/Feast_of_the_Great_Shishlam
|
|
97
|
+
"""
|
|
98
|
+
return self._add_mandaean_holiday(name, self._great_feast)
|
|
99
|
+
|
|
100
|
+
def _add_great_feast_day_two(self, name) -> Optional[date]:
|
|
101
|
+
return self._add_mandaean_holiday(name, _timedelta(self._great_feast, +1))
|
|
102
|
+
|
|
103
|
+
def _add_great_feast_day_three(self, name) -> Optional[date]:
|
|
104
|
+
return self._add_mandaean_holiday(name, _timedelta(self._great_feast, +2))
|
|
105
|
+
|
|
106
|
+
def _add_great_feast_day_four(self, name) -> Optional[date]:
|
|
107
|
+
return self._add_mandaean_holiday(name, _timedelta(self._great_feast, +3))
|
|
@@ -0,0 +1,153 @@
|
|
|
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 datetime import date
|
|
14
|
+
from typing import Optional
|
|
15
|
+
|
|
16
|
+
from holidays.calendars import _TibetanLunisolar
|
|
17
|
+
from holidays.groups.eastern import EasternCalendarHolidays
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class TibetanCalendarHolidays(EasternCalendarHolidays):
|
|
21
|
+
"""
|
|
22
|
+
Tibetan lunisolar calendar holidays.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
def __init__(self, cls=None, show_estimated=False) -> None:
|
|
26
|
+
self._tibetan_calendar = cls() if cls else _TibetanLunisolar()
|
|
27
|
+
self._tibetan_calendar_show_estimated = show_estimated
|
|
28
|
+
|
|
29
|
+
def _add_tibetan_calendar_holiday(
|
|
30
|
+
self, name: str, dt_estimated: tuple[Optional[date], bool], days_delta: int = 0
|
|
31
|
+
) -> Optional[date]:
|
|
32
|
+
"""
|
|
33
|
+
Add Tibetan calendar holiday.
|
|
34
|
+
|
|
35
|
+
Adds customizable estimation label to holiday name if holiday date
|
|
36
|
+
is an estimation.
|
|
37
|
+
"""
|
|
38
|
+
return self._add_eastern_calendar_holiday(
|
|
39
|
+
name, dt_estimated, self._tibetan_calendar_show_estimated, days_delta
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def _add_blessed_rainy_day(self, name) -> Optional[date]:
|
|
43
|
+
"""
|
|
44
|
+
Add Blessed Rainy Day (September Equinox of Autumn Calendar).
|
|
45
|
+
"""
|
|
46
|
+
return self._add_tibetan_calendar_holiday(
|
|
47
|
+
name, self._tibetan_calendar.blessed_rainy_day_date(self._year)
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
def _add_birth_of_guru_rinpoche(self, name) -> Optional[date]:
|
|
51
|
+
"""
|
|
52
|
+
Add Birth of Guru Rinpoche (10th day of the 5th lunar month).
|
|
53
|
+
"""
|
|
54
|
+
return self._add_tibetan_calendar_holiday(
|
|
55
|
+
name, self._tibetan_calendar.birth_of_guru_rinpoche_date(self._year)
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
def _add_buddha_first_sermon(self, name) -> Optional[date]:
|
|
59
|
+
"""
|
|
60
|
+
Add Buddha First Sermon (4th day of the 6th lunar month).
|
|
61
|
+
"""
|
|
62
|
+
return self._add_tibetan_calendar_holiday(
|
|
63
|
+
name, self._tibetan_calendar.buddha_first_sermon_date(self._year)
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def _add_buddha_parinirvana(self, name) -> Optional[date]:
|
|
67
|
+
"""
|
|
68
|
+
Add Buddha Parinirvana (15th day of the 4th lunar month).
|
|
69
|
+
"""
|
|
70
|
+
return self._add_tibetan_calendar_holiday(
|
|
71
|
+
name, self._tibetan_calendar.buddha_parinirvana_date(self._year)
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
def _add_day_of_offering(self, name) -> Optional[date]:
|
|
75
|
+
"""
|
|
76
|
+
Add Day of Offering (1st day of the 12th lunar month).
|
|
77
|
+
"""
|
|
78
|
+
return self._add_tibetan_calendar_holiday(
|
|
79
|
+
name, self._tibetan_calendar.day_of_offering_date(self._year)
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
def _add_death_of_zhabdrung(self, name) -> Optional[date]:
|
|
83
|
+
"""
|
|
84
|
+
Add Death of Zhabdrung (10th day of the 3rd lunar month).
|
|
85
|
+
"""
|
|
86
|
+
return self._add_tibetan_calendar_holiday(
|
|
87
|
+
name, self._tibetan_calendar.death_of_zhabdrung_date(self._year)
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
def _add_descending_day_of_lord_buddha(self, name) -> Optional[date]:
|
|
91
|
+
"""
|
|
92
|
+
Add Descending Day of Lord Buddha (22nd day of the 9th lunar month).
|
|
93
|
+
"""
|
|
94
|
+
return self._add_tibetan_calendar_holiday(
|
|
95
|
+
name, self._tibetan_calendar.descending_day_of_lord_buddha_date(self._year)
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
def _add_losar(self, name) -> Optional[date]:
|
|
99
|
+
"""
|
|
100
|
+
Add Losar (1st day of the 1st lunar month).
|
|
101
|
+
"""
|
|
102
|
+
return self._add_tibetan_calendar_holiday(
|
|
103
|
+
name, self._tibetan_calendar.losar_date(self._year)
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
def _add_losar_day_two(self, name) -> set[date]:
|
|
107
|
+
"""
|
|
108
|
+
Add Losar Day Two.
|
|
109
|
+
"""
|
|
110
|
+
dt = self._add_tibetan_calendar_holiday(
|
|
111
|
+
name, self._tibetan_calendar.losar_date(self._year), days_delta=+1
|
|
112
|
+
)
|
|
113
|
+
return {dt} if dt is not None else set()
|
|
114
|
+
|
|
115
|
+
def _add_thimphu_drubchen_day(self, name) -> Optional[date]:
|
|
116
|
+
"""
|
|
117
|
+
Add Thimphu Drubchen (6th day of the 8th lunar month).
|
|
118
|
+
"""
|
|
119
|
+
return self._add_tibetan_calendar_holiday(
|
|
120
|
+
name, self._tibetan_calendar.thimphu_drubchen_date(self._year), days_delta=+1
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
def _add_thimphu_tshechu_day(self, name) -> Optional[date]:
|
|
124
|
+
"""
|
|
125
|
+
Add Thimphu Tshechu (10th day of the 8th lunar month).
|
|
126
|
+
"""
|
|
127
|
+
return self._add_tibetan_calendar_holiday(
|
|
128
|
+
name, self._tibetan_calendar.thimphu_tshechu_date(self._year)
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
def _add_thimphu_tshechu_day_two(self, name) -> Optional[date]:
|
|
132
|
+
"""
|
|
133
|
+
Add Thimphu Tshechu Day 2.
|
|
134
|
+
"""
|
|
135
|
+
return self._add_tibetan_calendar_holiday(
|
|
136
|
+
name, self._tibetan_calendar.thimphu_tshechu_date(self._year), days_delta=+1
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
def _add_thimphu_tshechu_day_three(self, name) -> Optional[date]:
|
|
140
|
+
"""
|
|
141
|
+
Add Thimphu Tshechu Day 3.
|
|
142
|
+
"""
|
|
143
|
+
return self._add_tibetan_calendar_holiday(
|
|
144
|
+
name, self._tibetan_calendar.thimphu_tshechu_date(self._year), days_delta=+2
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
def _add_tibetan_winter_solstice(self, name) -> Optional[date]:
|
|
148
|
+
"""
|
|
149
|
+
Add Winter Solstice Day.
|
|
150
|
+
"""
|
|
151
|
+
return self._add_tibetan_calendar_holiday(
|
|
152
|
+
name, self._tibetan_calendar.tibetan_winter_solstice_date(self._year)
|
|
153
|
+
)
|
holidays/holiday_base.py
CHANGED
|
@@ -1135,6 +1135,20 @@ class HolidayBase(dict[date, str]):
|
|
|
1135
1135
|
days = (dt2 - dt1).days + 1
|
|
1136
1136
|
return sum(self.is_working_day(_timedelta(dt1, n)) for n in range(days))
|
|
1137
1137
|
|
|
1138
|
+
def is_weekend(self, key: DateLike) -> bool:
|
|
1139
|
+
"""Check if the given date's week day is a weekend day.
|
|
1140
|
+
|
|
1141
|
+
Args:
|
|
1142
|
+
key:
|
|
1143
|
+
The date to check.
|
|
1144
|
+
|
|
1145
|
+
Returns:
|
|
1146
|
+
True if the date's week day is a weekend day, False otherwise.
|
|
1147
|
+
"""
|
|
1148
|
+
# To prioritize performance we avoid reusing the internal
|
|
1149
|
+
# `HolidayBase._is_weekend` method and perform the check directly instead.
|
|
1150
|
+
return self.__keytransform__(key).weekday() in self.weekend
|
|
1151
|
+
|
|
1138
1152
|
def is_working_day(self, key: DateLike) -> bool:
|
|
1139
1153
|
"""Check if the given date is considered a working day.
|
|
1140
1154
|
|
|
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
|
holidays/registry.py
CHANGED
|
@@ -44,6 +44,7 @@ COUNTRIES: RegistryDict = {
|
|
|
44
44
|
"belize": ("Belize", "BZ", "BLZ"),
|
|
45
45
|
"benin": ("Benin", "BJ", "BEN"),
|
|
46
46
|
"bermuda": ("Bermuda", "BM", "BMU"),
|
|
47
|
+
"bhutan": ("Bhutan", "BT", "BTN"),
|
|
47
48
|
"bolivia": ("Bolivia", "BO", "BOL"),
|
|
48
49
|
"bonaire_sint_eustatius_and_saba": ("BonaireSintEustatiusAndSaba", "BQ", "BES"),
|
|
49
50
|
"bosnia_and_herzegovina": ("BosniaAndHerzegovina", "BA", "BIH"),
|
|
@@ -96,6 +97,7 @@ COUNTRIES: RegistryDict = {
|
|
|
96
97
|
"french_polynesia": ("FrenchPolynesia", "PF", "PYF", "HolidaysPF"),
|
|
97
98
|
"french_southern_territories": ("FrenchSouthernTerritories", "TF", "ATF", "HolidaysTF"),
|
|
98
99
|
"gabon": ("Gabon", "GA", "GAB"),
|
|
100
|
+
"gambia": ("Gambia", "GM", "GMB"),
|
|
99
101
|
"georgia": ("Georgia", "GE", "GEO"),
|
|
100
102
|
"germany": ("Germany", "DE", "DEU"),
|
|
101
103
|
"ghana": ("Ghana", "GH", "GHA"),
|
|
@@ -108,6 +110,7 @@ COUNTRIES: RegistryDict = {
|
|
|
108
110
|
"guatemala": ("Guatemala", "GT", "GUA"),
|
|
109
111
|
"guernsey": ("Guernsey", "GG", "GGY"),
|
|
110
112
|
"guinea": ("Guinea", "GN", "GIN"),
|
|
113
|
+
"guinea_bissau": ("GuineaBissau", "GW", "GNB"),
|
|
111
114
|
"guyana": ("Guyana", "GY", "GUY"),
|
|
112
115
|
"haiti": ("Haiti", "HT", "HTI"),
|
|
113
116
|
"honduras": ("Honduras", "HN", "HND"),
|
|
@@ -117,6 +120,7 @@ COUNTRIES: RegistryDict = {
|
|
|
117
120
|
"india": ("India", "IN", "IND"),
|
|
118
121
|
"indonesia": ("Indonesia", "ID", "IDN"),
|
|
119
122
|
"iran": ("Iran", "IR", "IRN"),
|
|
123
|
+
"iraq": ("Iraq", "IQ", "IRQ"),
|
|
120
124
|
"ireland": ("Ireland", "IE", "IRL"),
|
|
121
125
|
"isle_of_man": ("IsleOfMan", "IM", "IMN"),
|
|
122
126
|
"israel": ("Israel", "IL", "ISR"),
|
|
@@ -127,12 +131,14 @@ COUNTRIES: RegistryDict = {
|
|
|
127
131
|
"jersey": ("Jersey", "JE", "JEY"),
|
|
128
132
|
"kazakhstan": ("Kazakhstan", "KZ", "KAZ"),
|
|
129
133
|
"kenya": ("Kenya", "KE", "KEN"),
|
|
134
|
+
"kiribati": ("Kiribati", "KI", "KIR"),
|
|
130
135
|
"kuwait": ("Kuwait", "KW", "KWT"),
|
|
131
136
|
"kyrgyzstan": ("Kyrgyzstan", "KG", "KGZ"),
|
|
132
137
|
"laos": ("Laos", "LA", "LAO"),
|
|
133
138
|
"latvia": ("Latvia", "LV", "LVA"),
|
|
134
139
|
"lebanon": ("Lebanon", "LB", "LBN"),
|
|
135
140
|
"lesotho": ("Lesotho", "LS", "LSO"),
|
|
141
|
+
"liberia": ("Liberia", "LR", "LBR"),
|
|
136
142
|
"libya": ("Libya", "LY", "LBY"),
|
|
137
143
|
"liechtenstein": ("Liechtenstein", "LI", "LIE"),
|
|
138
144
|
"lithuania": ("Lithuania", "LT", "LTU"),
|
|
@@ -209,6 +215,11 @@ COUNTRIES: RegistryDict = {
|
|
|
209
215
|
"slovenia": ("Slovenia", "SI", "SVN"),
|
|
210
216
|
"solomon_islands": ("SolomonIslands", "SB", "SLB"),
|
|
211
217
|
"south_africa": ("SouthAfrica", "ZA", "ZAF"),
|
|
218
|
+
"south_georgia_and_the_south_sandwich_islands": (
|
|
219
|
+
"SouthGeorgiaAndTheSouthSandwichIslands",
|
|
220
|
+
"GS",
|
|
221
|
+
"SGS",
|
|
222
|
+
),
|
|
212
223
|
"south_korea": ("SouthKorea", "KR", "KOR", "Korea"),
|
|
213
224
|
"spain": ("Spain", "ES", "ESP"),
|
|
214
225
|
"sri_lanka": ("SriLanka", "LK", "LKA"),
|
|
@@ -216,6 +227,7 @@ COUNTRIES: RegistryDict = {
|
|
|
216
227
|
"svalbard_and_jan_mayen": ("SvalbardAndJanMayen", "SJ", "SJM", "HolidaysSJ"),
|
|
217
228
|
"sweden": ("Sweden", "SE", "SWE"),
|
|
218
229
|
"switzerland": ("Switzerland", "CH", "CHE"),
|
|
230
|
+
"syrian_arab_republic": ("SyrianArabRepublic", "SY", "SYR"),
|
|
219
231
|
"taiwan": ("Taiwan", "TW", "TWN"),
|
|
220
232
|
"tanzania": ("Tanzania", "TZ", "TZA"),
|
|
221
233
|
"thailand": ("Thailand", "TH", "THA"),
|
|
@@ -226,6 +238,7 @@ COUNTRIES: RegistryDict = {
|
|
|
226
238
|
"trinidad_and_tobago": ("TrinidadAndTobago", "TT", "TTO"),
|
|
227
239
|
"tunisia": ("Tunisia", "TN", "TUN"),
|
|
228
240
|
"turkey": ("Turkey", "TR", "TUR"),
|
|
241
|
+
"turkmenistan": ("Turkmenistan", "TM", "TKM"),
|
|
229
242
|
"turks_and_caicos_islands": ("TurksAndCaicosIslands", "TC", "TCA"),
|
|
230
243
|
"tuvalu": ("Tuvalu", "TV", "TUV"),
|
|
231
244
|
"ukraine": ("Ukraine", "UA", "UKR"),
|
holidays/version.py
CHANGED