holidays 0.26__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 +5 -7
- holidays/calendars/buddhist.py +1 -3
- holidays/calendars/chinese.py +1 -3
- holidays/calendars/custom.py +1 -3
- holidays/calendars/hindu.py +1 -3
- holidays/calendars/islamic.py +1341 -1345
- holidays/calendars/thai.py +217 -26
- holidays/countries/__init__.py +4 -0
- holidays/countries/albania.py +6 -17
- holidays/countries/andorra.py +2 -6
- holidays/countries/angola.py +53 -39
- holidays/countries/argentina.py +13 -24
- holidays/countries/aruba.py +109 -48
- holidays/countries/australia.py +31 -69
- holidays/countries/azerbaijan.py +30 -38
- holidays/countries/bahrain.py +5 -5
- holidays/countries/bangladesh.py +1 -3
- holidays/countries/belarus.py +1 -3
- holidays/countries/belize.py +4 -16
- holidays/countries/bolivia.py +2 -6
- holidays/countries/bosnia_and_herzegovina.py +5 -17
- holidays/countries/botswana.py +9 -18
- holidays/countries/brazil.py +2 -5
- holidays/countries/brunei.py +427 -0
- holidays/countries/bulgaria.py +2 -6
- holidays/countries/burkina_faso.py +141 -0
- holidays/countries/burundi.py +2 -5
- holidays/countries/cambodia.py +323 -0
- holidays/countries/cameroon.py +71 -77
- holidays/countries/canada.py +19 -28
- holidays/countries/chad.py +133 -0
- holidays/countries/chile.py +4 -11
- holidays/countries/china.py +1 -2
- holidays/countries/colombia.py +17 -15
- holidays/countries/costa_rica.py +2 -6
- holidays/countries/curacao.py +100 -46
- holidays/countries/cyprus.py +2 -6
- holidays/countries/czechia.py +4 -12
- holidays/countries/denmark.py +1 -3
- holidays/countries/dominican_republic.py +1 -3
- holidays/countries/ecuador.py +54 -54
- holidays/countries/egypt.py +2 -5
- holidays/countries/eswatini.py +34 -44
- holidays/countries/ethiopia.py +5 -14
- holidays/countries/finland.py +1 -3
- holidays/countries/gabon.py +49 -53
- holidays/countries/greece.py +1 -2
- holidays/countries/honduras.py +16 -13
- holidays/countries/hongkong.py +7 -8
- holidays/countries/hungary.py +93 -92
- holidays/countries/india.py +4 -11
- holidays/countries/indonesia.py +120 -114
- holidays/countries/ireland.py +5 -15
- holidays/countries/isle_of_man.py +9 -4
- holidays/countries/israel.py +6 -18
- holidays/countries/italy.py +1 -2
- holidays/countries/jamaica.py +10 -18
- holidays/countries/japan.py +10 -16
- holidays/countries/kazakhstan.py +7 -22
- holidays/countries/kenya.py +1 -3
- holidays/countries/kyrgyzstan.py +2 -5
- holidays/countries/latvia.py +2 -6
- holidays/countries/lesotho.py +52 -32
- holidays/countries/lithuania.py +4 -12
- holidays/countries/madagascar.py +3 -9
- holidays/countries/malawi.py +34 -26
- holidays/countries/malaysia.py +223 -248
- holidays/countries/marshall_islands.py +4 -9
- holidays/countries/mexico.py +1 -3
- holidays/countries/moldova.py +3 -6
- holidays/countries/monaco.py +16 -26
- holidays/countries/montenegro.py +23 -19
- holidays/countries/morocco.py +2 -5
- holidays/countries/mozambique.py +35 -31
- holidays/countries/namibia.py +54 -35
- holidays/countries/new_zealand.py +11 -21
- holidays/countries/nicaragua.py +26 -22
- holidays/countries/nigeria.py +6 -17
- holidays/countries/north_macedonia.py +3 -8
- holidays/countries/norway.py +1 -3
- holidays/countries/pakistan.py +71 -72
- holidays/countries/panama.py +25 -24
- holidays/countries/paraguay.py +54 -47
- holidays/countries/philippines.py +6 -2
- holidays/countries/poland.py +3 -9
- holidays/countries/portugal.py +3 -11
- holidays/countries/romania.py +3 -5
- holidays/countries/saudi_arabia.py +8 -22
- holidays/countries/serbia.py +19 -29
- holidays/countries/singapore.py +70 -74
- holidays/countries/slovakia.py +1 -4
- holidays/countries/south_africa.py +60 -62
- holidays/countries/south_korea.py +14 -23
- holidays/countries/spain.py +2 -5
- holidays/countries/sweden.py +1 -3
- holidays/countries/taiwan.py +2 -5
- holidays/countries/thailand.py +34 -81
- holidays/countries/turkey.py +1 -3
- holidays/countries/ukraine.py +6 -18
- holidays/countries/united_arab_emirates.py +21 -29
- holidays/countries/united_kingdom.py +47 -67
- holidays/countries/united_states.py +42 -72
- holidays/countries/vatican_city.py +1 -3
- holidays/countries/venezuela.py +8 -6
- holidays/countries/vietnam.py +6 -18
- holidays/countries/zambia.py +63 -33
- holidays/countries/zimbabwe.py +56 -37
- holidays/financial/european_central_bank.py +1 -3
- holidays/financial/ny_stock_exchange.py +31 -48
- 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 +49 -75
- holidays/holiday_groups.py +11 -1190
- holidays/locale/am/LC_MESSAGES/ET.po +18 -15
- holidays/locale/ar/LC_MESSAGES/CA.po +43 -43
- holidays/locale/ar/LC_MESSAGES/ET.po +18 -15
- holidays/locale/ar/LC_MESSAGES/UA.po +16 -14
- holidays/locale/be/LC_MESSAGES/BY.po +9 -8
- holidays/locale/bg/LC_MESSAGES/BG.po +14 -12
- holidays/locale/da/LC_MESSAGES/DK.po +7 -6
- holidays/locale/el/LC_MESSAGES/CY.po +5 -3
- holidays/locale/el/LC_MESSAGES/GR.po +13 -13
- holidays/locale/en/LC_MESSAGES/CA.po +43 -43
- holidays/locale/en_US/LC_MESSAGES/AR.po +26 -25
- 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 +14 -12
- 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 +9 -8
- holidays/locale/en_US/LC_MESSAGES/CA.po +43 -43
- holidays/locale/en_US/LC_MESSAGES/CL.po +18 -18
- holidays/locale/en_US/LC_MESSAGES/CO.po +19 -19
- holidays/locale/en_US/LC_MESSAGES/CR.po +6 -5
- 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 +5 -3
- holidays/locale/en_US/LC_MESSAGES/DK.po +7 -6
- 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.po +18 -15
- holidays/locale/en_US/LC_MESSAGES/FI.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/GR.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/HN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/HN.po +13 -13
- 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/JP.po +19 -17
- 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/MC.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MC.po +16 -15
- holidays/locale/en_US/LC_MESSAGES/MD.po +5 -5
- holidays/locale/en_US/LC_MESSAGES/MX.po +3 -2
- holidays/locale/en_US/LC_MESSAGES/NI.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/NI.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/NO.po +1 -1
- holidays/locale/en_US/LC_MESSAGES/PL.po +23 -21
- holidays/locale/en_US/LC_MESSAGES/PT.po +31 -31
- holidays/locale/en_US/LC_MESSAGES/PY.po +13 -11
- holidays/locale/en_US/LC_MESSAGES/RO.po +4 -3
- holidays/locale/en_US/LC_MESSAGES/RS.po +10 -10
- holidays/locale/en_US/LC_MESSAGES/SE.po +1 -1
- holidays/locale/en_US/LC_MESSAGES/SK.po +14 -14
- holidays/locale/en_US/LC_MESSAGES/TH.po +41 -41
- holidays/locale/en_US/LC_MESSAGES/UA.po +16 -14
- holidays/locale/en_US/LC_MESSAGES/VE.po +6 -6
- holidays/locale/es/LC_MESSAGES/AR.po +26 -25
- holidays/locale/es/LC_MESSAGES/CL.po +18 -18
- holidays/locale/es/LC_MESSAGES/CO.po +19 -19
- holidays/locale/es/LC_MESSAGES/CR.po +6 -5
- holidays/locale/es/LC_MESSAGES/DO.po +12 -12
- holidays/locale/es/LC_MESSAGES/EC.po +11 -12
- holidays/locale/es/LC_MESSAGES/HN.po +12 -12
- holidays/locale/es/LC_MESSAGES/MX.po +3 -2
- holidays/locale/es/LC_MESSAGES/NI.po +10 -10
- holidays/locale/es/LC_MESSAGES/PY.po +13 -11
- holidays/locale/es/LC_MESSAGES/VE.po +6 -6
- holidays/locale/fi/LC_MESSAGES/FI.po +13 -13
- holidays/locale/fr/LC_MESSAGES/CA.po +43 -43
- holidays/locale/fr/LC_MESSAGES/MC.po +15 -14
- holidays/locale/hu/LC_MESSAGES/HU.mo +0 -0
- holidays/locale/hu/LC_MESSAGES/HU.po +109 -0
- holidays/locale/ja/LC_MESSAGES/JP.po +19 -17
- 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/no/LC_MESSAGES/NO.po +1 -1
- 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 +23 -21
- holidays/locale/pt_PT/LC_MESSAGES/PT.po +31 -31
- holidays/locale/ro/LC_MESSAGES/MD.po +5 -5
- holidays/locale/ro/LC_MESSAGES/RO.po +4 -3
- holidays/locale/sk/LC_MESSAGES/SK.po +14 -14
- holidays/locale/sr/LC_MESSAGES/RS.po +10 -10
- holidays/locale/sv/LC_MESSAGES/FI.po +13 -13
- holidays/locale/sv/LC_MESSAGES/SE.po +1 -1
- 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 +43 -43
- 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.po +26 -25
- holidays/locale/uk/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/AW.po +87 -0
- holidays/locale/uk/LC_MESSAGES/CL.po +18 -18
- holidays/locale/uk/LC_MESSAGES/CO.po +19 -19
- holidays/locale/uk/LC_MESSAGES/CR.po +6 -5
- holidays/locale/uk/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CW.po +82 -0
- holidays/locale/uk/LC_MESSAGES/DK.po +7 -6
- holidays/locale/uk/LC_MESSAGES/DO.po +12 -12
- holidays/locale/uk/LC_MESSAGES/EC.po +11 -12
- holidays/locale/uk/LC_MESSAGES/FI.po +13 -13
- holidays/locale/uk/LC_MESSAGES/HN.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/HN.po +13 -13
- holidays/locale/uk/LC_MESSAGES/HU.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/HU.po +109 -0
- holidays/locale/uk/LC_MESSAGES/MC.po +15 -14
- holidays/locale/uk/LC_MESSAGES/MD.po +5 -5
- holidays/locale/uk/LC_MESSAGES/MX.po +3 -2
- holidays/locale/uk/LC_MESSAGES/NI.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/NI.po +13 -13
- holidays/locale/uk/LC_MESSAGES/NO.po +1 -1
- holidays/locale/uk/LC_MESSAGES/PL.po +23 -21
- holidays/locale/uk/LC_MESSAGES/PY.po +13 -11
- holidays/locale/uk/LC_MESSAGES/RO.po +4 -3
- holidays/locale/uk/LC_MESSAGES/SE.po +1 -1
- holidays/locale/uk/LC_MESSAGES/SK.po +14 -14
- holidays/locale/uk/LC_MESSAGES/UA.po +16 -14
- holidays/locale/uk/LC_MESSAGES/VE.po +6 -6
- holidays/registry.py +7 -11
- holidays/utils.py +5 -15
- {holidays-0.26.dist-info → holidays-0.27.dist-info}/METADATA +25 -7
- holidays-0.27.dist-info/RECORD +449 -0
- holidays-0.26.dist-info/RECORD +0 -402
- {holidays-0.26.dist-info → holidays-0.27.dist-info}/LICENSE +0 -0
- {holidays-0.26.dist-info → holidays-0.27.dist-info}/WHEEL +0 -0
- {holidays-0.26.dist-info → holidays-0.27.dist-info}/top_level.txt +0 -0
|
@@ -13,15 +13,12 @@ from datetime import date
|
|
|
13
13
|
from datetime import timedelta as td
|
|
14
14
|
|
|
15
15
|
from holidays.calendars import _get_nth_weekday_of_month
|
|
16
|
-
from holidays.constants import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP
|
|
17
|
-
from holidays.constants import OCT, NOV, DEC, MON, THU
|
|
16
|
+
from holidays.constants import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC, MON, THU
|
|
18
17
|
from holidays.holiday_base import HolidayBase
|
|
19
18
|
from holidays.holiday_groups import ChristianHolidays, InternationalHolidays
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
class NewYorkStockExchange(
|
|
23
|
-
HolidayBase, ChristianHolidays, InternationalHolidays
|
|
24
|
-
):
|
|
21
|
+
class NewYorkStockExchange(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
25
22
|
"""
|
|
26
23
|
Official regulations:
|
|
27
24
|
- https://www.nyse.com/publicdocs/nyse/regulation/nyse/NYSE_Rules.pdf
|
|
@@ -46,21 +43,21 @@ class NewYorkStockExchange(
|
|
|
46
43
|
(OCT, 12, "Columbian Celebration"),
|
|
47
44
|
(OCT, 21, "Columbian Celebration"),
|
|
48
45
|
),
|
|
49
|
-
1893: (
|
|
50
|
-
1897: (
|
|
51
|
-
1898: (
|
|
46
|
+
1893: (APR, 27, "Columbian Celebration"),
|
|
47
|
+
1897: (APR, 27, "Grant's Birthday"),
|
|
48
|
+
1898: (MAY, 4, "Charter Day"),
|
|
52
49
|
1899: (
|
|
53
50
|
(MAY, 29, "Monday before Decoration Day"),
|
|
54
51
|
(JUL, 3, "Monday before Independence Day"),
|
|
55
52
|
(SEP, 29, "Admiral Dewey Celebration"),
|
|
56
53
|
),
|
|
57
|
-
1900: (
|
|
54
|
+
1900: (DEC, 24, "Christmas Eve"),
|
|
58
55
|
1901: (
|
|
59
56
|
(JUL, 5, "Friday after Independence Day"),
|
|
60
57
|
(SEP, 19, "Funeral of President McKinley"),
|
|
61
58
|
),
|
|
62
|
-
1903: (
|
|
63
|
-
1917: (
|
|
59
|
+
1903: (APR, 22, "Opening of new NYSE building"),
|
|
60
|
+
1917: (JUN, 5, "Draft Registration Day"),
|
|
64
61
|
1918: (
|
|
65
62
|
(JAN, 28, "Heatless Day"),
|
|
66
63
|
(FEB, 4, "Heatless Day"),
|
|
@@ -78,8 +75,8 @@ class NewYorkStockExchange(
|
|
|
78
75
|
(AUG, 3, "Death of President Warren G. Harding"),
|
|
79
76
|
(AUG, 10, "Funeral of President Warren G. Harding"),
|
|
80
77
|
),
|
|
81
|
-
1927: (
|
|
82
|
-
1929: (
|
|
78
|
+
1927: (JUN, 13, "Parade for Colonel Charles Lindbergh"),
|
|
79
|
+
1929: (NOV, 29, "Catch Up Day"),
|
|
83
80
|
1933: (
|
|
84
81
|
(MAR, 6, "Special Bank Holiday"),
|
|
85
82
|
(MAR, 7, "Special Bank Holiday"),
|
|
@@ -94,12 +91,12 @@ class NewYorkStockExchange(
|
|
|
94
91
|
(AUG, 16, "V-J Day (WWII)"),
|
|
95
92
|
(DEC, 24, "Christmas Eve"),
|
|
96
93
|
),
|
|
97
|
-
1954: (
|
|
98
|
-
1956: (
|
|
99
|
-
1958: (
|
|
100
|
-
1961: (
|
|
101
|
-
1963: (
|
|
102
|
-
1965: (
|
|
94
|
+
1954: (DEC, 24, "Christmas Eve"),
|
|
95
|
+
1956: (DEC, 24, "Christmas Eve"),
|
|
96
|
+
1958: (DEC, 26, "Day after Christmas"),
|
|
97
|
+
1961: (MAY, 29, "Day before Decoration Day"),
|
|
98
|
+
1963: (NOV, 25, "Funeral of President John F. Kennedy"),
|
|
99
|
+
1965: (DEC, 24, "Christmas Eve"),
|
|
103
100
|
1968: (
|
|
104
101
|
(APR, 9, "Day of Mourning for Martin Luther King Jr."),
|
|
105
102
|
(JUL, 5, "Day after Independence Day"),
|
|
@@ -109,24 +106,24 @@ class NewYorkStockExchange(
|
|
|
109
106
|
(MAR, 31, "Funeral of President Dwight D. Eisenhower"),
|
|
110
107
|
(JUL, 21, "National Participation in Lunar Exploration"),
|
|
111
108
|
),
|
|
112
|
-
1972: (
|
|
113
|
-
1973: (
|
|
114
|
-
1977: (
|
|
115
|
-
1985: (
|
|
116
|
-
1994: (
|
|
109
|
+
1972: (DEC, 28, "Funeral for President Harry S. Truman"),
|
|
110
|
+
1973: (JAN, 25, "Funeral for President Lyndon B. Johnson"),
|
|
111
|
+
1977: (JUL, 14, "Blackout in New Yor City"),
|
|
112
|
+
1985: (SEP, 27, "Hurricane Gloria"),
|
|
113
|
+
1994: (APR, 27, "Funeral for President Richard M. Nixon"),
|
|
117
114
|
2001: (
|
|
118
115
|
(SEP, 11, "Closed for Sept 11, 2001 Attacks"),
|
|
119
116
|
(SEP, 12, "Closed for Sept 11, 2001 Attacks"),
|
|
120
117
|
(SEP, 13, "Closed for Sept 11, 2001 Attacks"),
|
|
121
118
|
(SEP, 14, "Closed for Sept 11, 2001 Attacks"),
|
|
122
119
|
),
|
|
123
|
-
2004: (
|
|
124
|
-
2007: (
|
|
120
|
+
2004: (JUN, 11, "Day of Mourning for President Ronald W. Reagan"),
|
|
121
|
+
2007: (JAN, 2, "Day of Mourning for President Gerald R. Ford"),
|
|
125
122
|
2012: (
|
|
126
123
|
(OCT, 29, "Hurricane Sandy"),
|
|
127
124
|
(OCT, 30, "Hurricane Sandy"),
|
|
128
125
|
),
|
|
129
|
-
2018: (
|
|
126
|
+
2018: (DEC, 5, "Day of Mourning for President George H.W. Bush"),
|
|
130
127
|
}
|
|
131
128
|
|
|
132
129
|
def __init__(self, *args, **kwargs):
|
|
@@ -168,16 +165,12 @@ class NewYorkStockExchange(
|
|
|
168
165
|
|
|
169
166
|
# LINCOLN BIRTHDAY: observed 1896 - 1953 and 1968, Feb 12 (observed)
|
|
170
167
|
if 1896 <= year <= 1953 or year == 1968:
|
|
171
|
-
self._add_observed_holiday(
|
|
172
|
-
"Lincoln's Birthday", date(year, FEB, 12)
|
|
173
|
-
)
|
|
168
|
+
self._add_observed_holiday("Lincoln's Birthday", date(year, FEB, 12))
|
|
174
169
|
|
|
175
170
|
# WASHINGTON'S BIRTHDAY: Feb 22 (obs) until 1971, then 3rd Mon of Feb
|
|
176
171
|
self._add_observed_holiday(
|
|
177
172
|
"Washington's Birthday",
|
|
178
|
-
date(year, FEB, 22)
|
|
179
|
-
if year <= 1970
|
|
180
|
-
else _get_nth_weekday_of_month(3, MON, FEB, year),
|
|
173
|
+
date(year, FEB, 22) if year <= 1970 else _get_nth_weekday_of_month(3, MON, FEB, year),
|
|
181
174
|
)
|
|
182
175
|
|
|
183
176
|
# GOOD FRIDAY - closed every year except 1898, 1906, and 1907
|
|
@@ -200,18 +193,14 @@ class NewYorkStockExchange(
|
|
|
200
193
|
|
|
201
194
|
# JUNETEENTH: since 2021
|
|
202
195
|
if year >= 2021:
|
|
203
|
-
self._add_observed_holiday(
|
|
204
|
-
"Juneteenth National Independence Day", date(year, JUN, 19)
|
|
205
|
-
)
|
|
196
|
+
self._add_observed_holiday("Juneteenth National Independence Day", date(year, JUN, 19))
|
|
206
197
|
|
|
207
198
|
# INDEPENDENCE DAY (July 4) - history suggests closed every year
|
|
208
199
|
self._add_observed_holiday("Independence Day", date(year, JUL, 4))
|
|
209
200
|
|
|
210
201
|
# LABOR DAY - first mon in Sept, since 1887
|
|
211
202
|
if year >= 1887:
|
|
212
|
-
self._add_holiday(
|
|
213
|
-
"Labor Day", _get_nth_weekday_of_month(1, MON, SEP, year)
|
|
214
|
-
)
|
|
203
|
+
self._add_holiday("Labor Day", _get_nth_weekday_of_month(1, MON, SEP, year))
|
|
215
204
|
|
|
216
205
|
# COLUMBUS DAY/INDIGENOUS PPL DAY: Oct 12 - closed 1909-1953
|
|
217
206
|
if 1909 <= year <= 1953:
|
|
@@ -230,9 +219,7 @@ class NewYorkStockExchange(
|
|
|
230
219
|
self._add_observed_holiday("Veteran's Day", date(year, NOV, 11))
|
|
231
220
|
|
|
232
221
|
# THXGIVING DAY: 4th Thurs in Nov - closed every year
|
|
233
|
-
self._add_holiday(
|
|
234
|
-
"Thanksgiving Day", _get_nth_weekday_of_month(4, THU, NOV, year)
|
|
235
|
-
)
|
|
222
|
+
self._add_holiday("Thanksgiving Day", _get_nth_weekday_of_month(4, THU, NOV, year))
|
|
236
223
|
|
|
237
224
|
# XMAS DAY: Dec 25th - every year
|
|
238
225
|
self._add_observed_holiday("Christmas Day", date(year, DEC, 25))
|
|
@@ -242,9 +229,7 @@ class NewYorkStockExchange(
|
|
|
242
229
|
# Beginning of WWI.
|
|
243
230
|
begin = date(year, JUL, 31)
|
|
244
231
|
end = date(year, NOV, 27)
|
|
245
|
-
for dt in (
|
|
246
|
-
begin + td(days=n) for n in range((end - begin).days + 1)
|
|
247
|
-
):
|
|
232
|
+
for dt in (begin + td(days=n) for n in range((end - begin).days + 1)):
|
|
248
233
|
if self._is_weekend(dt) or dt in self:
|
|
249
234
|
continue
|
|
250
235
|
self._add_holiday("World War I", dt)
|
|
@@ -252,9 +237,7 @@ class NewYorkStockExchange(
|
|
|
252
237
|
begin = date(year, JUN, 12)
|
|
253
238
|
end = date(year, DEC, 24)
|
|
254
239
|
# Wednesday special holiday.
|
|
255
|
-
for dt in (
|
|
256
|
-
begin + td(days=n) for n in range(0, (end - begin).days + 1, 7)
|
|
257
|
-
):
|
|
240
|
+
for dt in (begin + td(days=n) for n in range(0, (end - begin).days + 1, 7)):
|
|
258
241
|
self._add_holiday("Paper Crisis", dt)
|
|
259
242
|
|
|
260
243
|
|
|
@@ -0,0 +1,18 @@
|
|
|
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 <dr.prodigy.github@gmail.com> (c) 2017-2023
|
|
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 holidays.groups.buddhist import BuddhistCalendarHolidays
|
|
13
|
+
from holidays.groups.chinese import ChineseCalendarHolidays
|
|
14
|
+
from holidays.groups.christian import ChristianHolidays
|
|
15
|
+
from holidays.groups.hindu import HinduCalendarHolidays
|
|
16
|
+
from holidays.groups.international import InternationalHolidays
|
|
17
|
+
from holidays.groups.islamic import IslamicHolidays
|
|
18
|
+
from holidays.groups.thai import ThaiCalendarHolidays
|
|
@@ -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 _BuddhistLunisolar
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BuddhistCalendarHolidays:
|
|
19
|
+
"""
|
|
20
|
+
Buddhist lunisolar calendar holidays.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self, calendar=_BuddhistLunisolar(), show_estimated=False) -> None:
|
|
24
|
+
self._buddhist_calendar = calendar
|
|
25
|
+
self._show_estimated = show_estimated
|
|
26
|
+
|
|
27
|
+
def _add_buddhist_calendar_holiday(
|
|
28
|
+
self,
|
|
29
|
+
name: str,
|
|
30
|
+
hol_date: Tuple[date, bool],
|
|
31
|
+
) -> Optional[date]:
|
|
32
|
+
"""
|
|
33
|
+
Add Buddhist 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
|
+
dt, is_estimated = hol_date
|
|
40
|
+
|
|
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_vesak(self, name) -> Optional[date]:
|
|
49
|
+
"""
|
|
50
|
+
Add Vesak (15th day of the 4th lunar month).
|
|
51
|
+
|
|
52
|
+
Vesak for Thailand, Laos, Singapore and Indonesia.
|
|
53
|
+
https://en.wikipedia.org/wiki/Vesak
|
|
54
|
+
"""
|
|
55
|
+
return self._add_buddhist_calendar_holiday(
|
|
56
|
+
name,
|
|
57
|
+
self._buddhist_calendar.vesak_date(self._year),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def _add_vesak_may(self, name) -> Optional[date]:
|
|
61
|
+
"""
|
|
62
|
+
Add Vesak (on the day of the first full moon in May
|
|
63
|
+
in the Gregorian calendar).
|
|
64
|
+
|
|
65
|
+
Vesak for Sri Lanka, Nepal, India, Bangladesh and Malaysia.
|
|
66
|
+
https://en.wikipedia.org/wiki/Vesak
|
|
67
|
+
"""
|
|
68
|
+
return self._add_buddhist_calendar_holiday(
|
|
69
|
+
name,
|
|
70
|
+
self._buddhist_calendar.vesak_may_date(self._year),
|
|
71
|
+
)
|
|
@@ -0,0 +1,235 @@
|
|
|
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
|
+
from typing import Tuple, Optional
|
|
15
|
+
|
|
16
|
+
from holidays.calendars import _ChineseLunisolar
|
|
17
|
+
from holidays.constants import APR
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ChineseCalendarHolidays:
|
|
21
|
+
"""
|
|
22
|
+
Chinese lunisolar calendar holidays.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
def __init__(self, calendar=_ChineseLunisolar(), show_estimated=False) -> None:
|
|
26
|
+
self._chinese_calendar = calendar
|
|
27
|
+
self._show_estimated = show_estimated
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def _chinese_new_year(self):
|
|
31
|
+
"""
|
|
32
|
+
Return Chinese New Year date.
|
|
33
|
+
"""
|
|
34
|
+
return self._chinese_calendar.lunar_new_year_date(self._year)[0]
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def _qingming_date(self):
|
|
38
|
+
day = 5
|
|
39
|
+
if (self._year % 4 < 1) or (self._year % 4 < 2 and self._year >= 2009):
|
|
40
|
+
day = 4
|
|
41
|
+
return date(self._year, APR, day)
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def _mid_autumn_festival(self):
|
|
45
|
+
"""
|
|
46
|
+
Return Mid Autumn Festival (15th day of the 8th lunar month) date.
|
|
47
|
+
"""
|
|
48
|
+
return self._chinese_calendar.mid_autumn_date(self._year)[0]
|
|
49
|
+
|
|
50
|
+
def _add_chinese_calendar_holiday(
|
|
51
|
+
self,
|
|
52
|
+
name: str,
|
|
53
|
+
hol_date: Tuple[date, bool],
|
|
54
|
+
days_delta: int = 0,
|
|
55
|
+
) -> Optional[date]:
|
|
56
|
+
"""
|
|
57
|
+
Add Chinese calendar holiday.
|
|
58
|
+
|
|
59
|
+
Adds customizable estimation label to holiday name if holiday date
|
|
60
|
+
is an estimation.
|
|
61
|
+
"""
|
|
62
|
+
estimated_label = getattr(self, "estimated_label", "%s* (*estimated)")
|
|
63
|
+
dt, is_estimated = hol_date
|
|
64
|
+
if days_delta != 0:
|
|
65
|
+
dt += td(days=days_delta)
|
|
66
|
+
|
|
67
|
+
return self._add_holiday(
|
|
68
|
+
self.tr(estimated_label) % self.tr(name)
|
|
69
|
+
if is_estimated and self._show_estimated
|
|
70
|
+
else name,
|
|
71
|
+
dt,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
def _add_chinese_birthday_of_buddha(self, name) -> Optional[date]:
|
|
75
|
+
"""
|
|
76
|
+
Add Birthday of the Buddha by Chinese lunar calendar (8th day of the
|
|
77
|
+
4th lunar month).
|
|
78
|
+
|
|
79
|
+
Birthday of the Buddha is a Buddhist festival that is celebrated in
|
|
80
|
+
most of East Asia and South Asia commemorating the birth of Gautama
|
|
81
|
+
Buddha, who was the founder of Buddhism.
|
|
82
|
+
https://en.wikipedia.org/wiki/Buddha%27s_Birthday
|
|
83
|
+
"""
|
|
84
|
+
return self._add_chinese_calendar_holiday(
|
|
85
|
+
name,
|
|
86
|
+
self._chinese_calendar.buddha_birthday_date(self._year),
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
def _add_chinese_new_years_eve(self, name) -> Optional[date]:
|
|
90
|
+
"""
|
|
91
|
+
Add Chinese New Year's Eve (last day of 12th lunar month).
|
|
92
|
+
|
|
93
|
+
Chinese New Year's Eve is the day before the Chinese New Year.
|
|
94
|
+
https://en.wikipedia.org/wiki/Chinese_New_Year%27s_Eve
|
|
95
|
+
"""
|
|
96
|
+
return self._add_chinese_calendar_holiday(
|
|
97
|
+
name,
|
|
98
|
+
self._chinese_calendar.lunar_new_year_date(self._year),
|
|
99
|
+
days_delta=-1,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
def _add_chinese_new_years_day(self, name) -> Optional[date]:
|
|
103
|
+
"""
|
|
104
|
+
Add Chinese New Year's Day (first day of the first lunar month).
|
|
105
|
+
|
|
106
|
+
Chinese New Year is the festival that celebrates the beginning of
|
|
107
|
+
a new year on the traditional lunisolar and solar Chinese calendar.
|
|
108
|
+
https://en.wikipedia.org/wiki/Chinese_New_Year
|
|
109
|
+
"""
|
|
110
|
+
return self._add_chinese_calendar_holiday(
|
|
111
|
+
name,
|
|
112
|
+
self._chinese_calendar.lunar_new_year_date(self._year),
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
def _add_chinese_new_years_day_two(self, name) -> Optional[date]:
|
|
116
|
+
"""
|
|
117
|
+
Add Chinese New Year's Day Two.
|
|
118
|
+
|
|
119
|
+
https://en.wikipedia.org/wiki/Chinese_New_Year
|
|
120
|
+
"""
|
|
121
|
+
return self._add_chinese_calendar_holiday(
|
|
122
|
+
name,
|
|
123
|
+
self._chinese_calendar.lunar_new_year_date(self._year),
|
|
124
|
+
days_delta=+1,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
def _add_chinese_new_years_day_three(self, name) -> Optional[date]:
|
|
128
|
+
"""
|
|
129
|
+
Add Chinese New Year's Day Three.
|
|
130
|
+
|
|
131
|
+
https://en.wikipedia.org/wiki/Chinese_New_Year
|
|
132
|
+
"""
|
|
133
|
+
return self._add_chinese_calendar_holiday(
|
|
134
|
+
name,
|
|
135
|
+
self._chinese_calendar.lunar_new_year_date(self._year),
|
|
136
|
+
days_delta=+2,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
def _add_chinese_new_years_day_four(self, name) -> Optional[date]:
|
|
140
|
+
"""
|
|
141
|
+
Add Chinese New Year's Day Four.
|
|
142
|
+
|
|
143
|
+
https://en.wikipedia.org/wiki/Chinese_New_Year
|
|
144
|
+
"""
|
|
145
|
+
return self._add_chinese_calendar_holiday(
|
|
146
|
+
name,
|
|
147
|
+
self._chinese_calendar.lunar_new_year_date(self._year),
|
|
148
|
+
days_delta=+3,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
def _add_chinese_new_years_day_five(self, name) -> Optional[date]:
|
|
152
|
+
"""
|
|
153
|
+
Add Chinese New Year's Day Five.
|
|
154
|
+
|
|
155
|
+
https://en.wikipedia.org/wiki/Chinese_New_Year
|
|
156
|
+
"""
|
|
157
|
+
return self._add_chinese_calendar_holiday(
|
|
158
|
+
name,
|
|
159
|
+
self._chinese_calendar.lunar_new_year_date(self._year),
|
|
160
|
+
days_delta=+4,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
def _add_qingming_festival(self, name) -> date:
|
|
164
|
+
"""
|
|
165
|
+
Add Qingming Festival (15th day after the Spring Equinox).
|
|
166
|
+
|
|
167
|
+
The Qingming festival or Ching Ming Festival, also known as
|
|
168
|
+
Tomb-Sweeping Day in English, is a traditional Chinese festival.
|
|
169
|
+
https://en.wikipedia.org/wiki/Qingming_Festival
|
|
170
|
+
"""
|
|
171
|
+
return self._add_holiday(name, self._qingming_date)
|
|
172
|
+
|
|
173
|
+
def _add_double_ninth_festival(self, name) -> Optional[date]:
|
|
174
|
+
"""
|
|
175
|
+
Add Double Ninth Festival (9th day of 9th lunar month).
|
|
176
|
+
|
|
177
|
+
The Double Ninth Festival (Chongyang Festival in Mainland China
|
|
178
|
+
and Taiwan or Chung Yeung Festival in Hong Kong and Macau).
|
|
179
|
+
https://en.wikipedia.org/wiki/Double_Ninth_Festival
|
|
180
|
+
"""
|
|
181
|
+
return self._add_chinese_calendar_holiday(
|
|
182
|
+
name, self._chinese_calendar.double_ninth_date(self._year)
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
def _add_dragon_boat_festival(self, name) -> Optional[date]:
|
|
186
|
+
"""
|
|
187
|
+
Add Dragon Boat Festival (5th day of 5th lunar month).
|
|
188
|
+
|
|
189
|
+
The Dragon Boat Festival is a traditional Chinese holiday which occurs
|
|
190
|
+
on the fifth day of the fifth month of the Chinese calendar.
|
|
191
|
+
https://en.wikipedia.org/wiki/Dragon_Boat_Festival
|
|
192
|
+
"""
|
|
193
|
+
return self._add_chinese_calendar_holiday(
|
|
194
|
+
name, self._chinese_calendar.dragon_boat_date(self._year)
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
def _add_hung_kings_day(self, name) -> Optional[date]:
|
|
198
|
+
"""
|
|
199
|
+
Add Hùng Kings' Temple Festival (10th day of the 3rd lunar month).
|
|
200
|
+
|
|
201
|
+
Vietnamese festival held annually from the 8th to the 11th day of the
|
|
202
|
+
3rd lunar month in honour of the Hùng Kings.
|
|
203
|
+
https://en.wikipedia.org/wiki/H%C3%B9ng_Kings%27_Festival
|
|
204
|
+
"""
|
|
205
|
+
return self._add_chinese_calendar_holiday(
|
|
206
|
+
name,
|
|
207
|
+
self._chinese_calendar.hung_kings_date(self._year),
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
def _add_mid_autumn_festival(self, name) -> Optional[date]:
|
|
211
|
+
"""
|
|
212
|
+
Add Mid Autumn Festival (15th day of the 8th lunar month).
|
|
213
|
+
|
|
214
|
+
The Mid-Autumn Festival, also known as the Moon Festival or
|
|
215
|
+
Mooncake Festival.
|
|
216
|
+
https://en.wikipedia.org/wiki/Mid-Autumn_Festival
|
|
217
|
+
"""
|
|
218
|
+
return self._add_chinese_calendar_holiday(
|
|
219
|
+
name,
|
|
220
|
+
self._chinese_calendar.mid_autumn_date(self._year),
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
def _add_mid_autumn_festival_day_two(self, name) -> Optional[date]:
|
|
224
|
+
"""
|
|
225
|
+
Add Mid Autumn Festival Day Two (16th day of the 8th lunar month).
|
|
226
|
+
|
|
227
|
+
The Mid-Autumn Festival, also known as the Moon Festival or
|
|
228
|
+
Mooncake Festival.
|
|
229
|
+
https://en.wikipedia.org/wiki/Mid-Autumn_Festival
|
|
230
|
+
"""
|
|
231
|
+
return self._add_chinese_calendar_holiday(
|
|
232
|
+
name,
|
|
233
|
+
self._chinese_calendar.mid_autumn_date(self._year),
|
|
234
|
+
days_delta=+1,
|
|
235
|
+
)
|