holidays 0.25__py3-none-any.whl → 0.27__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/__init__.py +1 -1
- holidays/calendars/__init__.py +9 -7
- holidays/calendars/buddhist.py +445 -0
- holidays/calendars/chinese.py +1238 -431
- holidays/calendars/custom.py +1 -3
- holidays/calendars/hebrew.py +2 -2
- holidays/calendars/hindu.py +445 -0
- holidays/calendars/islamic.py +1347 -1347
- holidays/calendars/thai.py +229 -38
- holidays/countries/__init__.py +8 -0
- holidays/countries/albania.py +6 -17
- holidays/countries/andorra.py +2 -6
- holidays/countries/angola.py +53 -39
- holidays/countries/argentina.py +25 -35
- holidays/countries/armenia.py +1 -0
- holidays/countries/aruba.py +109 -48
- holidays/countries/australia.py +31 -69
- holidays/countries/austria.py +1 -0
- holidays/countries/azerbaijan.py +44 -71
- holidays/countries/bahrain.py +7 -7
- holidays/countries/bangladesh.py +1 -3
- holidays/countries/belarus.py +2 -3
- holidays/countries/belize.py +128 -0
- holidays/countries/bolivia.py +2 -6
- holidays/countries/bosnia_and_herzegovina.py +5 -17
- holidays/countries/botswana.py +37 -44
- holidays/countries/brazil.py +4 -7
- holidays/countries/brunei.py +427 -0
- holidays/countries/bulgaria.py +3 -6
- holidays/countries/burkina_faso.py +141 -0
- holidays/countries/burundi.py +2 -5
- holidays/countries/cambodia.py +323 -0
- holidays/countries/cameroon.py +183 -0
- holidays/countries/canada.py +20 -28
- holidays/countries/chad.py +133 -0
- holidays/countries/chile.py +6 -13
- holidays/countries/china.py +21 -25
- holidays/countries/colombia.py +18 -15
- holidays/countries/costa_rica.py +25 -27
- holidays/countries/cuba.py +28 -15
- holidays/countries/curacao.py +100 -46
- holidays/countries/cyprus.py +3 -6
- holidays/countries/czechia.py +4 -12
- holidays/countries/denmark.py +2 -3
- holidays/countries/dominican_republic.py +2 -3
- holidays/countries/ecuador.py +55 -54
- holidays/countries/egypt.py +2 -5
- holidays/countries/el_salvador.py +101 -0
- holidays/countries/eswatini.py +34 -44
- holidays/countries/ethiopia.py +7 -14
- holidays/countries/finland.py +2 -3
- holidays/countries/france.py +1 -0
- holidays/countries/gabon.py +139 -0
- holidays/countries/georgia.py +1 -0
- holidays/countries/germany.py +1 -0
- holidays/countries/greece.py +7 -6
- holidays/countries/honduras.py +17 -13
- holidays/countries/hongkong.py +117 -126
- holidays/countries/hungary.py +93 -92
- holidays/countries/iceland.py +1 -0
- holidays/countries/india.py +4 -11
- holidays/countries/indonesia.py +178 -142
- holidays/countries/ireland.py +5 -15
- holidays/countries/isle_of_man.py +23 -5
- holidays/countries/israel.py +12 -24
- holidays/countries/italy.py +6 -7
- holidays/countries/jamaica.py +10 -18
- holidays/countries/japan.py +11 -16
- holidays/countries/kazakhstan.py +7 -22
- holidays/countries/kenya.py +44 -26
- holidays/countries/kyrgyzstan.py +2 -5
- holidays/countries/latvia.py +2 -6
- holidays/countries/lesotho.py +52 -32
- holidays/countries/liechtenstein.py +1 -0
- holidays/countries/lithuania.py +4 -12
- holidays/countries/madagascar.py +3 -9
- holidays/countries/malawi.py +34 -26
- holidays/countries/malaysia.py +335 -343
- holidays/countries/marshall_islands.py +4 -9
- holidays/countries/mexico.py +2 -3
- holidays/countries/moldova.py +4 -6
- holidays/countries/monaco.py +17 -26
- holidays/countries/montenegro.py +34 -24
- holidays/countries/morocco.py +8 -5
- holidays/countries/mozambique.py +35 -31
- holidays/countries/namibia.py +54 -35
- holidays/countries/netherlands.py +1 -0
- holidays/countries/new_zealand.py +166 -134
- holidays/countries/nicaragua.py +27 -22
- holidays/countries/nigeria.py +6 -17
- holidays/countries/north_macedonia.py +3 -8
- holidays/countries/norway.py +2 -3
- holidays/countries/pakistan.py +73 -75
- holidays/countries/panama.py +25 -24
- holidays/countries/paraguay.py +55 -47
- holidays/countries/peru.py +1 -0
- holidays/countries/philippines.py +6 -2
- holidays/countries/poland.py +4 -9
- holidays/countries/portugal.py +4 -11
- holidays/countries/romania.py +4 -5
- holidays/countries/russia.py +1 -0
- holidays/countries/san_marino.py +26 -27
- holidays/countries/saudi_arabia.py +8 -22
- holidays/countries/serbia.py +22 -31
- holidays/countries/singapore.py +181 -189
- holidays/countries/slovakia.py +2 -4
- holidays/countries/south_africa.py +60 -62
- holidays/countries/south_korea.py +59 -26
- holidays/countries/spain.py +7 -10
- holidays/countries/sweden.py +2 -3
- holidays/countries/switzerland.py +1 -0
- holidays/countries/taiwan.py +20 -20
- holidays/countries/thailand.py +36 -82
- holidays/countries/turkey.py +1 -3
- holidays/countries/ukraine.py +7 -18
- holidays/countries/united_arab_emirates.py +23 -31
- holidays/countries/united_kingdom.py +124 -116
- holidays/countries/united_states.py +42 -72
- holidays/countries/uruguay.py +1 -0
- holidays/countries/vatican_city.py +64 -32
- holidays/countries/venezuela.py +9 -6
- holidays/countries/vietnam.py +6 -20
- holidays/countries/zambia.py +63 -33
- holidays/countries/zimbabwe.py +56 -37
- holidays/financial/european_central_bank.py +15 -16
- holidays/financial/ny_stock_exchange.py +80 -86
- holidays/groups/__init__.py +18 -0
- holidays/groups/buddhist.py +71 -0
- holidays/groups/chinese.py +235 -0
- holidays/groups/christian.py +483 -0
- holidays/groups/hindu.py +71 -0
- holidays/groups/international.py +157 -0
- holidays/groups/islamic.py +288 -0
- holidays/groups/thai.py +157 -0
- holidays/helpers.py +20 -0
- holidays/holiday_base.py +54 -76
- holidays/holiday_groups.py +11 -1053
- holidays/locale/am/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/am/LC_MESSAGES/ET.po +20 -15
- holidays/locale/ar/LC_MESSAGES/CA.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/CA.po +184 -0
- holidays/locale/ar/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/ET.po +92 -0
- holidays/locale/ar/LC_MESSAGES/UA.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/UA.po +97 -0
- holidays/locale/be/LC_MESSAGES/BY.po +11 -13
- holidays/locale/bg/LC_MESSAGES/BG.po +13 -15
- holidays/locale/da/LC_MESSAGES/DK.po +13 -12
- holidays/locale/de/LC_MESSAGES/AT.po +14 -14
- holidays/locale/de/LC_MESSAGES/CH.po +91 -56
- holidays/locale/de/LC_MESSAGES/DE.po +32 -32
- holidays/locale/de/LC_MESSAGES/LI.po +23 -23
- holidays/locale/el/LC_MESSAGES/CY.po +16 -16
- holidays/locale/el/LC_MESSAGES/GR.mo +0 -0
- holidays/locale/el/LC_MESSAGES/GR.po +21 -17
- holidays/locale/en/LC_MESSAGES/CA.po +43 -43
- holidays/locale/en_US/LC_MESSAGES/AM.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AM.po +20 -20
- holidays/locale/en_US/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AR.po +34 -33
- holidays/locale/en_US/LC_MESSAGES/AT.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AW.po +87 -0
- holidays/locale/en_US/LC_MESSAGES/BG.po +13 -15
- holidays/locale/en_US/LC_MESSAGES/BN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BN.po +96 -0
- holidays/locale/en_US/LC_MESSAGES/BY.po +11 -13
- holidays/locale/en_US/LC_MESSAGES/CA.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CA.po +70 -37
- holidays/locale/en_US/LC_MESSAGES/CH.po +91 -56
- holidays/locale/en_US/LC_MESSAGES/CL.po +39 -38
- holidays/locale/en_US/LC_MESSAGES/CO.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CO.po +27 -27
- holidays/locale/en_US/LC_MESSAGES/CR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CR.po +19 -19
- holidays/locale/en_US/LC_MESSAGES/CU.po +10 -10
- holidays/locale/en_US/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CW.po +82 -0
- holidays/locale/en_US/LC_MESSAGES/CY.po +16 -16
- holidays/locale/en_US/LC_MESSAGES/DE.po +30 -30
- holidays/locale/en_US/LC_MESSAGES/DK.po +12 -11
- holidays/locale/en_US/LC_MESSAGES/DO.po +12 -12
- holidays/locale/en_US/LC_MESSAGES/EC.po +11 -12
- holidays/locale/en_US/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ET.po +20 -15
- holidays/locale/en_US/LC_MESSAGES/FI.po +15 -15
- holidays/locale/en_US/LC_MESSAGES/FR.po +27 -24
- holidays/locale/en_US/LC_MESSAGES/GE.po +23 -27
- holidays/locale/en_US/LC_MESSAGES/GR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GR.po +21 -17
- holidays/locale/en_US/LC_MESSAGES/HN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/HN.po +17 -12
- holidays/locale/en_US/LC_MESSAGES/HU.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/HU.po +109 -0
- holidays/locale/en_US/LC_MESSAGES/IS.po +17 -17
- holidays/locale/en_US/LC_MESSAGES/JP.po +25 -25
- holidays/locale/en_US/LC_MESSAGES/KH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KH.po +139 -0
- holidays/locale/en_US/LC_MESSAGES/LI.po +22 -22
- holidays/locale/en_US/LC_MESSAGES/MC.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MC.po +27 -27
- holidays/locale/en_US/LC_MESSAGES/MD.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/MX.po +9 -12
- holidays/locale/en_US/LC_MESSAGES/NI.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/NI.po +15 -15
- holidays/locale/en_US/LC_MESSAGES/NL.po +12 -12
- holidays/locale/en_US/LC_MESSAGES/NO.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/PE.po +30 -30
- holidays/locale/en_US/LC_MESSAGES/PL.po +38 -21
- holidays/locale/en_US/LC_MESSAGES/PT.po +39 -36
- holidays/locale/en_US/LC_MESSAGES/PY.po +16 -16
- holidays/locale/en_US/LC_MESSAGES/RO.po +12 -12
- holidays/locale/en_US/LC_MESSAGES/RS.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/RS.po +17 -19
- holidays/locale/en_US/LC_MESSAGES/RU.po +11 -10
- holidays/locale/en_US/LC_MESSAGES/SE.po +19 -19
- holidays/locale/en_US/LC_MESSAGES/SK.po +17 -18
- holidays/locale/en_US/LC_MESSAGES/TH.po +41 -41
- holidays/locale/en_US/LC_MESSAGES/UA.po +18 -19
- holidays/locale/en_US/LC_MESSAGES/UY.po +15 -15
- holidays/locale/en_US/LC_MESSAGES/VE.po +16 -16
- holidays/locale/es/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/es/LC_MESSAGES/AR.po +34 -33
- holidays/locale/es/LC_MESSAGES/CL.po +39 -38
- holidays/locale/es/LC_MESSAGES/CO.mo +0 -0
- holidays/locale/es/LC_MESSAGES/CO.po +24 -24
- holidays/locale/es/LC_MESSAGES/CR.mo +0 -0
- holidays/locale/es/LC_MESSAGES/CR.po +19 -19
- holidays/locale/es/LC_MESSAGES/CU.po +10 -10
- holidays/locale/es/LC_MESSAGES/DO.po +12 -12
- holidays/locale/es/LC_MESSAGES/EC.po +11 -12
- holidays/locale/es/LC_MESSAGES/HN.mo +0 -0
- holidays/locale/es/LC_MESSAGES/HN.po +17 -12
- holidays/locale/es/LC_MESSAGES/MX.po +9 -12
- holidays/locale/es/LC_MESSAGES/NI.po +12 -12
- holidays/locale/es/LC_MESSAGES/PE.po +30 -30
- holidays/locale/es/LC_MESSAGES/PY.po +16 -16
- holidays/locale/es/LC_MESSAGES/UY.po +15 -15
- holidays/locale/es/LC_MESSAGES/VE.po +16 -16
- holidays/locale/fi/LC_MESSAGES/FI.po +16 -16
- holidays/locale/fr/LC_MESSAGES/CA.po +43 -43
- holidays/locale/fr/LC_MESSAGES/CH.po +91 -56
- holidays/locale/fr/LC_MESSAGES/FR.po +27 -24
- holidays/locale/fr/LC_MESSAGES/MC.po +23 -23
- holidays/locale/hu/LC_MESSAGES/HU.mo +0 -0
- holidays/locale/hu/LC_MESSAGES/HU.po +109 -0
- holidays/locale/hy/LC_MESSAGES/AM.po +16 -16
- holidays/locale/is/LC_MESSAGES/IS.po +18 -18
- holidays/locale/it/LC_MESSAGES/CH.po +91 -56
- holidays/locale/ja/LC_MESSAGES/JP.po +25 -25
- holidays/locale/ka/LC_MESSAGES/GE.po +23 -27
- holidays/locale/km/LC_MESSAGES/KH.mo +0 -0
- holidays/locale/km/LC_MESSAGES/KH.po +139 -0
- holidays/locale/ms/LC_MESSAGES/BN.mo +0 -0
- holidays/locale/ms/LC_MESSAGES/BN.po +96 -0
- holidays/locale/nl/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/nl/LC_MESSAGES/AW.po +87 -0
- holidays/locale/nl/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/nl/LC_MESSAGES/CW.po +82 -0
- holidays/locale/nl/LC_MESSAGES/NL.po +13 -13
- holidays/locale/no/LC_MESSAGES/NO.po +14 -14
- holidays/locale/pap/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/pap/LC_MESSAGES/AW.po +87 -0
- holidays/locale/pap/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/pap/LC_MESSAGES/CW.po +82 -0
- holidays/locale/pl/LC_MESSAGES/PL.po +38 -21
- holidays/locale/pt_PT/LC_MESSAGES/PT.po +39 -36
- holidays/locale/ro/LC_MESSAGES/MD.po +14 -15
- holidays/locale/ro/LC_MESSAGES/RO.po +13 -14
- holidays/locale/ru/LC_MESSAGES/RU.po +11 -9
- holidays/locale/sk/LC_MESSAGES/SK.po +17 -18
- holidays/locale/sr/LC_MESSAGES/RS.mo +0 -0
- holidays/locale/sr/LC_MESSAGES/RS.po +15 -17
- holidays/locale/sv/LC_MESSAGES/FI.po +16 -16
- holidays/locale/sv/LC_MESSAGES/SE.po +20 -20
- holidays/locale/th/LC_MESSAGES/BN.mo +0 -0
- holidays/locale/th/LC_MESSAGES/BN.po +96 -0
- holidays/locale/th/LC_MESSAGES/CA.po +42 -42
- holidays/locale/th/LC_MESSAGES/KH.mo +0 -0
- holidays/locale/th/LC_MESSAGES/KH.po +145 -0
- holidays/locale/th/LC_MESSAGES/TH.po +41 -41
- holidays/locale/uk/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/AR.po +35 -35
- holidays/locale/uk/LC_MESSAGES/AT.po +15 -16
- holidays/locale/uk/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/AW.po +87 -0
- holidays/locale/uk/LC_MESSAGES/CH.po +92 -58
- holidays/locale/uk/LC_MESSAGES/CL.po +40 -40
- holidays/locale/uk/LC_MESSAGES/CO.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CO.po +28 -29
- holidays/locale/uk/LC_MESSAGES/CR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CR.po +20 -21
- holidays/locale/uk/LC_MESSAGES/CU.po +11 -12
- holidays/locale/uk/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CW.po +82 -0
- holidays/locale/uk/LC_MESSAGES/DE.po +33 -34
- holidays/locale/uk/LC_MESSAGES/DK.po +14 -14
- holidays/locale/uk/LC_MESSAGES/DO.po +13 -14
- holidays/locale/uk/LC_MESSAGES/EC.po +12 -14
- holidays/locale/uk/LC_MESSAGES/FI.po +17 -18
- holidays/locale/uk/LC_MESSAGES/FR.po +28 -26
- holidays/locale/uk/LC_MESSAGES/HN.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/HN.po +18 -14
- holidays/locale/uk/LC_MESSAGES/HU.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/HU.po +109 -0
- holidays/locale/uk/LC_MESSAGES/IS.po +19 -20
- holidays/locale/uk/LC_MESSAGES/LI.po +24 -25
- holidays/locale/uk/LC_MESSAGES/MC.po +27 -28
- holidays/locale/uk/LC_MESSAGES/MD.po +14 -15
- holidays/locale/uk/LC_MESSAGES/MX.po +10 -14
- holidays/locale/uk/LC_MESSAGES/NI.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/NI.po +16 -17
- holidays/locale/uk/LC_MESSAGES/NL.po +14 -15
- holidays/locale/uk/LC_MESSAGES/NO.po +15 -16
- holidays/locale/uk/LC_MESSAGES/PE.po +31 -32
- holidays/locale/uk/LC_MESSAGES/PL.po +38 -21
- holidays/locale/uk/LC_MESSAGES/PY.po +17 -18
- holidays/locale/uk/LC_MESSAGES/RO.po +13 -14
- holidays/locale/uk/LC_MESSAGES/SE.po +21 -22
- holidays/locale/uk/LC_MESSAGES/SK.po +18 -20
- holidays/locale/uk/LC_MESSAGES/UA.po +17 -17
- holidays/locale/uk/LC_MESSAGES/UY.po +16 -17
- holidays/locale/uk/LC_MESSAGES/VE.po +17 -18
- holidays/registry.py +21 -12
- holidays/utils.py +87 -17
- {holidays-0.25.dist-info → holidays-0.27.dist-info}/METADATA +282 -265
- holidays-0.27.dist-info/RECORD +449 -0
- holidays-0.25.dist-info/RECORD +0 -390
- {holidays-0.25.dist-info → holidays-0.27.dist-info}/LICENSE +0 -0
- {holidays-0.25.dist-info → holidays-0.27.dist-info}/WHEEL +0 -0
- {holidays-0.25.dist-info → holidays-0.27.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
# python-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: dr-prodigy <maurizio.montel@gmail.com> (c) 2017-2022
|
|
8
|
+
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
|
|
9
|
+
# Website: https://github.com/dr-prodigy/python-holidays
|
|
10
|
+
# License: MIT (see LICENSE file)
|
|
11
|
+
|
|
12
|
+
from datetime import date
|
|
13
|
+
from datetime import timedelta as td
|
|
14
|
+
|
|
15
|
+
from dateutil.easter import EASTER_ORTHODOX, EASTER_WESTERN, easter
|
|
16
|
+
|
|
17
|
+
from holidays.calendars import GREGORIAN_CALENDAR, JULIAN_CALENDAR
|
|
18
|
+
from holidays.constants import JAN, FEB, MAR, APR, JUN, JUL, AUG, SEP, NOV, DEC
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ChristianHolidays:
|
|
22
|
+
"""
|
|
23
|
+
Christian holidays.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def __init__(self, calendar=GREGORIAN_CALENDAR) -> None:
|
|
27
|
+
self.__verify_calendar(calendar)
|
|
28
|
+
self.__calendar = calendar
|
|
29
|
+
|
|
30
|
+
def __get_christmas_day(self, calendar=None):
|
|
31
|
+
"""
|
|
32
|
+
Get Christmas Day date.
|
|
33
|
+
"""
|
|
34
|
+
calendar = calendar or self.__calendar
|
|
35
|
+
self.__verify_calendar(calendar)
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
date(self._year, DEC, 25)
|
|
39
|
+
if self.__is_gregorian_calendar(calendar)
|
|
40
|
+
else date(self._year, JAN, 7) # Orthodox.
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def __get_easter_sunday(self, calendar=None):
|
|
44
|
+
"""
|
|
45
|
+
Get Easter Sunday date.
|
|
46
|
+
"""
|
|
47
|
+
calendar = calendar or self.__calendar
|
|
48
|
+
self.__verify_calendar(calendar)
|
|
49
|
+
|
|
50
|
+
return easter(
|
|
51
|
+
self._year,
|
|
52
|
+
method=EASTER_ORTHODOX if calendar == JULIAN_CALENDAR else EASTER_WESTERN,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
@staticmethod
|
|
56
|
+
def __is_gregorian_calendar(calendar):
|
|
57
|
+
"""
|
|
58
|
+
Return True if `calendar` is Gregorian calendar.
|
|
59
|
+
Return False otherwise.
|
|
60
|
+
"""
|
|
61
|
+
return calendar == GREGORIAN_CALENDAR
|
|
62
|
+
|
|
63
|
+
@staticmethod
|
|
64
|
+
def __verify_calendar(calendar):
|
|
65
|
+
"""
|
|
66
|
+
Verify calendar type.
|
|
67
|
+
"""
|
|
68
|
+
if calendar not in {GREGORIAN_CALENDAR, JULIAN_CALENDAR}:
|
|
69
|
+
raise ValueError(
|
|
70
|
+
f"Unknown calendar name: {calendar}. "
|
|
71
|
+
"Use `GREGORIAN_CALENDAR` or `JULIAN_CALENDAR`."
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def _christmas_day(self):
|
|
76
|
+
"""
|
|
77
|
+
Return Christmas Day date.
|
|
78
|
+
"""
|
|
79
|
+
return self.__get_christmas_day()
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def _easter_sunday(self):
|
|
83
|
+
"""
|
|
84
|
+
Return Easter Sunday date.
|
|
85
|
+
"""
|
|
86
|
+
return self.__get_easter_sunday()
|
|
87
|
+
|
|
88
|
+
def _add_all_saints_day(self, name) -> date:
|
|
89
|
+
"""
|
|
90
|
+
Add All Saints' Day (November 1st).
|
|
91
|
+
|
|
92
|
+
Also known as All Hallows' Day, the Feast of All Saints,
|
|
93
|
+
the Feast of All Hallows, the Solemnity of All Saints, and Hallowmas.
|
|
94
|
+
https://en.wikipedia.org/wiki/All_Saints%27_Day
|
|
95
|
+
"""
|
|
96
|
+
return self._add_holiday(name, NOV, 1)
|
|
97
|
+
|
|
98
|
+
def _add_all_souls_day(self, name) -> date:
|
|
99
|
+
"""
|
|
100
|
+
Add All Souls' Day (November 2nd).
|
|
101
|
+
|
|
102
|
+
All Souls' Day is a day of prayer and remembrance for the faithful
|
|
103
|
+
departed, observed by certain Christian denominations on 2 November.
|
|
104
|
+
https://en.wikipedia.org/wiki/All_Souls%27_Day
|
|
105
|
+
"""
|
|
106
|
+
return self._add_holiday(name, NOV, 2)
|
|
107
|
+
|
|
108
|
+
def _add_ascension_thursday(self, name) -> date:
|
|
109
|
+
"""
|
|
110
|
+
Add Ascension Thursday (39 days after the Easter Sunday).
|
|
111
|
+
|
|
112
|
+
The Solemnity of the Ascension of Jesus Christ, also called Ascension
|
|
113
|
+
Day, or sometimes Holy Thursday.
|
|
114
|
+
https://en.wikipedia.org/wiki/Feast_of_the_Ascension
|
|
115
|
+
"""
|
|
116
|
+
return self._add_holiday(
|
|
117
|
+
name,
|
|
118
|
+
self._easter_sunday + td(days=+39),
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
def _add_ash_monday(self, name) -> date:
|
|
122
|
+
"""
|
|
123
|
+
Add Ash Monday (48 days before Easter Sunday).
|
|
124
|
+
|
|
125
|
+
The Clean Monday, also known as Pure Monday, Monday of Lent
|
|
126
|
+
or Green Monday. The first day of Great Lent.
|
|
127
|
+
https://en.wikipedia.org/wiki/Clean_Monday
|
|
128
|
+
"""
|
|
129
|
+
return self._add_holiday(
|
|
130
|
+
name,
|
|
131
|
+
self._easter_sunday + td(days=-48),
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
def _add_ash_wednesday(self, name) -> date:
|
|
135
|
+
"""
|
|
136
|
+
Add Ash Wednesday (46 days before Easter Sunday).
|
|
137
|
+
|
|
138
|
+
A holy day of prayer and fasting. It marks the beginning of Lent.
|
|
139
|
+
https://en.wikipedia.org/wiki/Ash_Wednesday
|
|
140
|
+
"""
|
|
141
|
+
return self._add_holiday(
|
|
142
|
+
name,
|
|
143
|
+
self._easter_sunday + td(days=-46),
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
def _add_assumption_of_mary_day(self, name) -> date:
|
|
147
|
+
"""
|
|
148
|
+
Add Assumption Of Mary (August 15th).
|
|
149
|
+
|
|
150
|
+
The Feast of the Assumption of Mary, or simply The Assumption marks the
|
|
151
|
+
occasion of the Virgin Mary's bodily ascent to heaven at the end of
|
|
152
|
+
her life.
|
|
153
|
+
https://en.wikipedia.org/wiki/Assumption_of_Mary
|
|
154
|
+
"""
|
|
155
|
+
return self._add_holiday(name, AUG, 15)
|
|
156
|
+
|
|
157
|
+
def _add_candlemas(self, name) -> date:
|
|
158
|
+
"""
|
|
159
|
+
Add Candlemas (February 2nd).
|
|
160
|
+
|
|
161
|
+
Also known as the Feast of the Presentation of Jesus Christ,
|
|
162
|
+
the Feast of the Purification of the Blessed Virgin Mary, or the Feast
|
|
163
|
+
of the Holy Encounter, is a Christian holiday commemorating the
|
|
164
|
+
presentation of Jesus at the Temple.
|
|
165
|
+
https://en.wikipedia.org/wiki/Candlemas
|
|
166
|
+
"""
|
|
167
|
+
return self._add_holiday(name, FEB, 2)
|
|
168
|
+
|
|
169
|
+
def _add_carnival_monday(self, name) -> date:
|
|
170
|
+
"""
|
|
171
|
+
Add Carnival Monday (48 days before Easter Sunday).
|
|
172
|
+
|
|
173
|
+
Carnival is a Catholic Christian festive season that occurs before
|
|
174
|
+
the liturgical season of Lent.
|
|
175
|
+
https://en.wikipedia.org/wiki/Carnival
|
|
176
|
+
"""
|
|
177
|
+
return self._add_holiday(
|
|
178
|
+
name,
|
|
179
|
+
self._easter_sunday + td(days=-48),
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
def _add_carnival_tuesday(self, name) -> date:
|
|
183
|
+
"""
|
|
184
|
+
Add Carnival Monday (47 days before Easter Sunday).
|
|
185
|
+
|
|
186
|
+
Carnival is a Catholic Christian festive season that occurs before
|
|
187
|
+
the liturgical season of Lent.
|
|
188
|
+
https://en.wikipedia.org/wiki/Carnival
|
|
189
|
+
"""
|
|
190
|
+
return self._add_holiday(
|
|
191
|
+
name,
|
|
192
|
+
self._easter_sunday + td(days=-47),
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
def _add_christmas_day(self, name, calendar=None) -> date:
|
|
196
|
+
"""
|
|
197
|
+
Add Christmas Day.
|
|
198
|
+
|
|
199
|
+
Christmas is an annual festival commemorating the birth of
|
|
200
|
+
Jesus Christ.
|
|
201
|
+
https://en.wikipedia.org/wiki/Christmas
|
|
202
|
+
"""
|
|
203
|
+
calendar = calendar or self.__calendar
|
|
204
|
+
self.__verify_calendar(calendar)
|
|
205
|
+
|
|
206
|
+
return self._add_holiday(
|
|
207
|
+
name,
|
|
208
|
+
self.__get_christmas_day(calendar),
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
def _add_christmas_day_two(self, name, calendar=None) -> date:
|
|
212
|
+
"""
|
|
213
|
+
Add Christmas Day 2.
|
|
214
|
+
|
|
215
|
+
A holiday celebrated after Christmas Day, also known as Boxing Day.
|
|
216
|
+
https://en.wikipedia.org/wiki/Boxing_Day
|
|
217
|
+
https://en.wikipedia.org/wiki/Christmas
|
|
218
|
+
"""
|
|
219
|
+
calendar = calendar or self.__calendar
|
|
220
|
+
self.__verify_calendar(calendar)
|
|
221
|
+
|
|
222
|
+
return self._add_holiday(
|
|
223
|
+
name,
|
|
224
|
+
self.__get_christmas_day(calendar) + td(days=+1),
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
def _add_christmas_day_three(self, name, calendar=None) -> date:
|
|
228
|
+
"""
|
|
229
|
+
Add Christmas Day 3.
|
|
230
|
+
|
|
231
|
+
A holiday celebrated 2 days after Christmas Day (in some countries).
|
|
232
|
+
https://en.wikipedia.org/wiki/Christmas
|
|
233
|
+
"""
|
|
234
|
+
calendar = calendar or self.__calendar
|
|
235
|
+
self.__verify_calendar(calendar)
|
|
236
|
+
|
|
237
|
+
return self._add_holiday(
|
|
238
|
+
name,
|
|
239
|
+
self.__get_christmas_day(calendar) + td(days=+2),
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
def _add_christmas_eve(self, name, calendar=None) -> date:
|
|
243
|
+
"""
|
|
244
|
+
Add Christmas Eve.
|
|
245
|
+
|
|
246
|
+
Christmas Eve is the evening or entire day before Christmas Day,
|
|
247
|
+
the festival commemorating the birth of Jesus Christ.
|
|
248
|
+
https://en.wikipedia.org/wiki/Christmas_Eve
|
|
249
|
+
"""
|
|
250
|
+
calendar = calendar or self.__calendar
|
|
251
|
+
self.__verify_calendar(calendar)
|
|
252
|
+
|
|
253
|
+
return self._add_holiday(
|
|
254
|
+
name,
|
|
255
|
+
self.__get_christmas_day(calendar) + td(days=-1),
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
def _add_corpus_christi_day(self, name) -> date:
|
|
259
|
+
"""
|
|
260
|
+
Add Feast Of Corpus Christi (60 days after Easter Sunday).
|
|
261
|
+
|
|
262
|
+
The Feast of Corpus Christi, also known as the Solemnity of the Most
|
|
263
|
+
Holy Body and Blood of Christ, is a Christian liturgical solemnity
|
|
264
|
+
celebrating the Real Presence of the Body and Blood, Soul and Divinity
|
|
265
|
+
of Jesus Christ in the elements of the Eucharist.
|
|
266
|
+
https://en.wikipedia.org/wiki/Feast_of_Corpus_Christi
|
|
267
|
+
"""
|
|
268
|
+
return self._add_holiday(
|
|
269
|
+
name,
|
|
270
|
+
self._easter_sunday + td(days=+60),
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
def _add_easter_monday(self, name, calendar=None) -> date:
|
|
274
|
+
"""
|
|
275
|
+
Add Easter Monday (1 day after Easter Sunday).
|
|
276
|
+
|
|
277
|
+
Easter Monday refers to the day after Easter Sunday in either the
|
|
278
|
+
Eastern or Western Christian traditions. It is a public holiday in
|
|
279
|
+
some countries.
|
|
280
|
+
https://en.wikipedia.org/wiki/Easter_Monday
|
|
281
|
+
"""
|
|
282
|
+
return self._add_holiday(
|
|
283
|
+
name,
|
|
284
|
+
self.__get_easter_sunday(calendar) + td(days=+1),
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
def _add_easter_sunday(self, name, calendar=None) -> date:
|
|
288
|
+
"""
|
|
289
|
+
Add Easter Sunday.
|
|
290
|
+
|
|
291
|
+
Easter, also called Pascha or Resurrection Sunday is a Christian
|
|
292
|
+
festival and cultural holiday commemorating the resurrection of Jesus
|
|
293
|
+
from the dead.
|
|
294
|
+
https://en.wikipedia.org/wiki/Easter
|
|
295
|
+
"""
|
|
296
|
+
return self._add_holiday(name, self.__get_easter_sunday(calendar))
|
|
297
|
+
|
|
298
|
+
def _add_epiphany_day(self, name, calendar=None) -> date:
|
|
299
|
+
"""
|
|
300
|
+
Add Epiphany Day.
|
|
301
|
+
|
|
302
|
+
Epiphany, also known as Theophany in Eastern Christian traditions,
|
|
303
|
+
is a Christian feast day that celebrates the revelation of God
|
|
304
|
+
incarnate as Jesus Christ.
|
|
305
|
+
https://en.wikipedia.org/wiki/Epiphany_(holiday)
|
|
306
|
+
"""
|
|
307
|
+
calendar = calendar or self.__calendar
|
|
308
|
+
self.__verify_calendar(calendar)
|
|
309
|
+
|
|
310
|
+
return self._add_holiday(
|
|
311
|
+
name,
|
|
312
|
+
date(self._year, JAN, 6)
|
|
313
|
+
if self.__is_gregorian_calendar(calendar)
|
|
314
|
+
else date(self._year, JAN, 19),
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
def _add_good_friday(self, name, calendar=None) -> date:
|
|
318
|
+
"""
|
|
319
|
+
Add Good Friday (2 days before Easter Sunday).
|
|
320
|
+
|
|
321
|
+
Good Friday is a Christian holiday commemorating the crucifixion of
|
|
322
|
+
Jesus and his death at Calvary. It is also known as Holy Friday,
|
|
323
|
+
Great Friday, Great and Holy Friday.
|
|
324
|
+
https://en.wikipedia.org/wiki/Good_Friday
|
|
325
|
+
"""
|
|
326
|
+
return self._add_holiday(
|
|
327
|
+
name,
|
|
328
|
+
self.__get_easter_sunday(calendar) + td(days=-2),
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
def _add_holy_saturday(self, name) -> date:
|
|
332
|
+
"""
|
|
333
|
+
Add Holy Saturday (1 day before Easter Sunday).
|
|
334
|
+
|
|
335
|
+
Great and Holy Saturday is a day between Good Friday and Easter Sunday.
|
|
336
|
+
https://en.wikipedia.org/wiki/Holy_Saturday
|
|
337
|
+
"""
|
|
338
|
+
return self._add_holiday(
|
|
339
|
+
name,
|
|
340
|
+
self._easter_sunday + td(days=-1),
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
def _add_holy_thursday(self, name) -> date:
|
|
344
|
+
"""
|
|
345
|
+
Add Holy Thursday (3 days before Easter Sunday).
|
|
346
|
+
|
|
347
|
+
Holy Thursday or Maundy Thursday is the day during Holy Week that
|
|
348
|
+
commemorates the Washing of the Feet (Maundy) and Last Supper of
|
|
349
|
+
Jesus Christ with the Apostles, as described in the canonical gospels.
|
|
350
|
+
https://en.wikipedia.org/wiki/Maundy_Thursday
|
|
351
|
+
"""
|
|
352
|
+
return self._add_holiday(
|
|
353
|
+
name,
|
|
354
|
+
self._easter_sunday + td(days=-3),
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
def _add_immaculate_conception_day(self, name) -> date:
|
|
358
|
+
"""
|
|
359
|
+
Add Immaculate Conception Day (December 8th).
|
|
360
|
+
|
|
361
|
+
https://en.wikipedia.org/wiki/Immaculate_Conception
|
|
362
|
+
"""
|
|
363
|
+
return self._add_holiday(name, DEC, 8)
|
|
364
|
+
|
|
365
|
+
def _add_nativity_of_mary_day(self, name) -> date:
|
|
366
|
+
"""
|
|
367
|
+
Add Nativity Of Mary Day (September 8th).
|
|
368
|
+
|
|
369
|
+
The Nativity of the Blessed Virgin Mary, the Nativity of Mary,
|
|
370
|
+
the Marymas or the Birth of the Virgin Mary, refers to a Christian
|
|
371
|
+
feast day celebrating the birth of Mary, mother of Jesus.
|
|
372
|
+
https://en.wikipedia.org/wiki/Nativity_of_Mary
|
|
373
|
+
"""
|
|
374
|
+
return self._add_holiday(name, SEP, 8)
|
|
375
|
+
|
|
376
|
+
def _add_palm_sunday(self, name) -> date:
|
|
377
|
+
"""
|
|
378
|
+
Add Palm Sunday (7 days before Easter Sunday).
|
|
379
|
+
|
|
380
|
+
Palm Sunday is a Christian moveable feast that falls on the Sunday
|
|
381
|
+
before Easter. The feast commemorates Christ's triumphal entry into
|
|
382
|
+
Jerusalem, an event mentioned in each of the four canonical Gospels.
|
|
383
|
+
Palm Sunday marks the first day of Holy Week.
|
|
384
|
+
https://en.wikipedia.org/wiki/Palm_Sunday
|
|
385
|
+
"""
|
|
386
|
+
return self._add_holiday(
|
|
387
|
+
name,
|
|
388
|
+
self._easter_sunday + td(days=-7),
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
def _add_rejoicing_day(self, name) -> date:
|
|
392
|
+
"""
|
|
393
|
+
Add Day Of Rejoicing (9 days after Easter Sunday).
|
|
394
|
+
|
|
395
|
+
Add Day Of Rejoicing ("Radonitsa"), in the Russian Orthodox Church is
|
|
396
|
+
a commemoration of the departed observed on the second Tuesday of
|
|
397
|
+
Pascha (Easter).In Ukrainian tradition it is called Provody.
|
|
398
|
+
https://en.wikipedia.org/wiki/Radonitsa
|
|
399
|
+
"""
|
|
400
|
+
return self._add_holiday(
|
|
401
|
+
name,
|
|
402
|
+
self._easter_sunday + td(days=+9),
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
def _add_saint_georges_day(self, name) -> date:
|
|
406
|
+
"""
|
|
407
|
+
Add Saint George's Day (April 23th).
|
|
408
|
+
|
|
409
|
+
Saint George's Day is celebrated on 23 April, the traditionally
|
|
410
|
+
accepted date of the saint's death.
|
|
411
|
+
https://en.wikipedia.org/wiki/Saint_George%27s_Day
|
|
412
|
+
"""
|
|
413
|
+
return self._add_holiday(name, APR, 23)
|
|
414
|
+
|
|
415
|
+
def _add_saint_james_day(self, name) -> date:
|
|
416
|
+
"""
|
|
417
|
+
Add Saint James' Day (July 25th).
|
|
418
|
+
|
|
419
|
+
James the Great was one of the Twelve Apostles of Jesus.
|
|
420
|
+
https://en.wikipedia.org/wiki/James_the_Great#Feast
|
|
421
|
+
"""
|
|
422
|
+
return self._add_holiday(name, JUL, 25)
|
|
423
|
+
|
|
424
|
+
def _add_saint_johns_day(self, name) -> date:
|
|
425
|
+
"""
|
|
426
|
+
Add Saint John's Day (June 24th).
|
|
427
|
+
|
|
428
|
+
The Nativity of John the Baptist is a Christian feast day celebrating
|
|
429
|
+
the birth of John the Baptist.
|
|
430
|
+
https://en.wikipedia.org/wiki/Nativity_of_John_the_Baptist
|
|
431
|
+
"""
|
|
432
|
+
return self._add_holiday(name, JUN, 24)
|
|
433
|
+
|
|
434
|
+
def _add_saint_josephs_day(self, name) -> date:
|
|
435
|
+
"""
|
|
436
|
+
Add Saint Joseph's Day (March 19th).
|
|
437
|
+
|
|
438
|
+
Saint Joseph's Day, also called the Feast of Saint Joseph or the
|
|
439
|
+
Solemnity of Saint Joseph, is in Western Christianity the principal
|
|
440
|
+
feast day of Saint Joseph, husband of the Virgin Mary and legal father
|
|
441
|
+
of Jesus Christ.
|
|
442
|
+
https://en.wikipedia.org/wiki/Saint_Joseph%27s_Day
|
|
443
|
+
"""
|
|
444
|
+
return self._add_holiday(name, MAR, 19)
|
|
445
|
+
|
|
446
|
+
def _add_saints_peter_and_paul_day(self, name) -> date:
|
|
447
|
+
"""
|
|
448
|
+
Feast of Saints Peter and Paul (June 29th).
|
|
449
|
+
|
|
450
|
+
A liturgical feast in honor of the martyrdom in Rome of the apostles
|
|
451
|
+
Saint Peter and Saint Paul, which is observed on 29 June.
|
|
452
|
+
https://en.wikipedia.org/wiki/Feast_of_Saints_Peter_and_Paul
|
|
453
|
+
"""
|
|
454
|
+
return self._add_holiday(name, JUN, 29)
|
|
455
|
+
|
|
456
|
+
def _add_whit_monday(self, name) -> date:
|
|
457
|
+
"""
|
|
458
|
+
Add Whit Monday (50 days after Easter Sunday).
|
|
459
|
+
|
|
460
|
+
Whit Monday or Pentecost Monday, also known as Monday of the
|
|
461
|
+
Holy Spirit, is the holiday celebrated the day after Pentecost.
|
|
462
|
+
https://en.wikipedia.org/wiki/Pentecost
|
|
463
|
+
https://en.wikipedia.org/wiki/Whit_Monday
|
|
464
|
+
"""
|
|
465
|
+
return self._add_holiday(
|
|
466
|
+
name,
|
|
467
|
+
self._easter_sunday + td(days=+50),
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
def _add_whit_sunday(self, name) -> date:
|
|
471
|
+
"""
|
|
472
|
+
Add Whit Sunday (49 days after Easter Sunday).
|
|
473
|
+
|
|
474
|
+
Whit Sunday, also called Pentecost, is a holiday which commemorates
|
|
475
|
+
the descent of the Holy Spirit upon the Apostles and other followers
|
|
476
|
+
of Jesus Christ while they were in Jerusalem celebrating the
|
|
477
|
+
Feast of Weeks.
|
|
478
|
+
https://en.wikipedia.org/wiki/Pentecost
|
|
479
|
+
"""
|
|
480
|
+
return self._add_holiday(
|
|
481
|
+
name,
|
|
482
|
+
self._easter_sunday + td(days=+49),
|
|
483
|
+
)
|
holidays/groups/hindu.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# python-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: dr-prodigy <maurizio.montel@gmail.com> (c) 2017-2022
|
|
8
|
+
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
|
|
9
|
+
# Website: https://github.com/dr-prodigy/python-holidays
|
|
10
|
+
# License: MIT (see LICENSE file)
|
|
11
|
+
|
|
12
|
+
from datetime import date
|
|
13
|
+
from typing import Tuple, Optional
|
|
14
|
+
|
|
15
|
+
from holidays.calendars import _HinduLunisolar
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class HinduCalendarHolidays:
|
|
19
|
+
"""
|
|
20
|
+
Hindu lunisolar calendar holidays.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self, calendar=_HinduLunisolar(), show_estimated=False) -> None:
|
|
24
|
+
self._hindu_calendar = calendar
|
|
25
|
+
self._show_estimated = show_estimated
|
|
26
|
+
|
|
27
|
+
def _add_hindu_calendar_holiday(
|
|
28
|
+
self,
|
|
29
|
+
name: str,
|
|
30
|
+
hol_date: Tuple[date, bool],
|
|
31
|
+
) -> Optional[date]:
|
|
32
|
+
"""
|
|
33
|
+
Add Hindu calendar holiday.
|
|
34
|
+
|
|
35
|
+
Adds customizable estimation label to holiday name if holiday date
|
|
36
|
+
is an estimation.
|
|
37
|
+
"""
|
|
38
|
+
estimated_label = getattr(self, "estimated_label", "%s* (*estimated)")
|
|
39
|
+
|
|
40
|
+
dt, is_estimated = hol_date
|
|
41
|
+
return self._add_holiday(
|
|
42
|
+
self.tr(estimated_label) % self.tr(name)
|
|
43
|
+
if is_estimated and self._show_estimated
|
|
44
|
+
else name,
|
|
45
|
+
dt,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
def _add_diwali(self, name) -> Optional[date]:
|
|
49
|
+
"""
|
|
50
|
+
Add Diwali Festival.
|
|
51
|
+
|
|
52
|
+
Diwali (Deepavali, Festival of Lights) is one of the most important
|
|
53
|
+
festivals in Indian religions. It is celebrated during the Hindu
|
|
54
|
+
lunisolar months of Ashvin and Kartika (between mid-October and
|
|
55
|
+
mid-November).
|
|
56
|
+
https://en.wikipedia.org/wiki/Diwali
|
|
57
|
+
"""
|
|
58
|
+
return self._add_hindu_calendar_holiday(name, self._hindu_calendar.diwali_date(self._year))
|
|
59
|
+
|
|
60
|
+
def _add_thaipusam(self, name) -> Optional[date]:
|
|
61
|
+
"""
|
|
62
|
+
Add Thaipusam.
|
|
63
|
+
|
|
64
|
+
Thaipusam is a Tamil Hindu festival celebrated on the full moon
|
|
65
|
+
of the Tamil month of Thai (January/February).
|
|
66
|
+
https://en.wikipedia.org/wiki/Thaipusam
|
|
67
|
+
"""
|
|
68
|
+
return self._add_hindu_calendar_holiday(
|
|
69
|
+
name,
|
|
70
|
+
self._hindu_calendar.thaipusam_date(self._year),
|
|
71
|
+
)
|