holidays 0.84__py3-none-any.whl → 0.86__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 +0 -2
- holidays/calendars/__init__.py +0 -2
- holidays/constants.py +0 -2
- holidays/countries/__init__.py +0 -2
- holidays/countries/aland_islands.py +4 -4
- holidays/countries/american_samoa.py +4 -4
- holidays/countries/azerbaijan.py +2 -0
- holidays/countries/bulgaria.py +208 -50
- holidays/countries/china.py +10 -1
- holidays/countries/ecuador.py +12 -4
- holidays/countries/estonia.py +55 -9
- holidays/countries/french_guiana.py +4 -4
- holidays/countries/french_polynesia.py +4 -4
- holidays/countries/french_southern_territories.py +4 -4
- holidays/countries/gibraltar.py +1 -1
- holidays/countries/guadeloupe.py +4 -4
- holidays/countries/guam.py +4 -4
- holidays/countries/italy.py +489 -167
- holidays/countries/marshall_islands.py +8 -6
- holidays/countries/martinique.py +4 -4
- holidays/countries/mauritania.py +2 -4
- holidays/countries/mayotte.py +4 -4
- holidays/countries/mongolia.py +1 -5
- holidays/countries/nepal.py +46 -41
- holidays/countries/new_caledonia.py +4 -4
- holidays/countries/northern_mariana_islands.py +4 -4
- holidays/countries/puerto_rico.py +4 -4
- holidays/countries/reunion.py +4 -4
- holidays/countries/russia.py +1 -2
- holidays/countries/saint_barthelemy.py +4 -4
- holidays/countries/saint_martin.py +4 -4
- holidays/countries/saint_pierre_and_miquelon.py +4 -4
- holidays/countries/samoa.py +1 -3
- holidays/countries/svalbard_and_jan_mayen.py +4 -4
- holidays/countries/sweden.py +102 -32
- holidays/countries/taiwan.py +3 -6
- holidays/countries/thailand.py +9 -6
- holidays/countries/turkey.py +7 -4
- holidays/countries/united_states.py +4 -0
- holidays/countries/united_states_minor_outlying_islands.py +4 -4
- holidays/countries/united_states_virgin_islands.py +4 -4
- holidays/countries/wallis_and_futuna.py +4 -4
- holidays/financial/__init__.py +1 -3
- holidays/financial/ice_futures_europe.py +6 -2
- holidays/financial/national_stock_exchange_of_india.py +141 -38
- holidays/groups/__init__.py +0 -2
- holidays/holiday_base.py +51 -23
- holidays/locale/bg/LC_MESSAGES/BG.mo +0 -0
- holidays/locale/en_IN/LC_MESSAGES/XNSE.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BG.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/EC.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/EE.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/IT.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/NP.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/SE.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/XNSE.mo +0 -0
- holidays/locale/es/LC_MESSAGES/EC.mo +0 -0
- holidays/locale/et/LC_MESSAGES/EE.mo +0 -0
- holidays/locale/hi/LC_MESSAGES/XNSE.mo +0 -0
- holidays/locale/it_IT/LC_MESSAGES/IT.mo +0 -0
- holidays/locale/ne/LC_MESSAGES/NP.mo +0 -0
- holidays/locale/sv/LC_MESSAGES/SE.mo +0 -0
- holidays/locale/th/LC_MESSAGES/CA.mo +0 -0
- holidays/locale/th/LC_MESSAGES/CN.mo +0 -0
- holidays/locale/th/LC_MESSAGES/DK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/th/LC_MESSAGES/FI.mo +0 -0
- holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/NO.mo +0 -0
- holidays/locale/th/LC_MESSAGES/SE.mo +0 -0
- holidays/locale/th/LC_MESSAGES/TL.mo +0 -0
- holidays/locale/th/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/th/LC_MESSAGES/US.mo +0 -0
- holidays/locale/th/LC_MESSAGES/VA.mo +0 -0
- holidays/locale/tr/LC_MESSAGES/TR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/BG.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/EC.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/EE.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/SE.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/TR.mo +0 -0
- holidays/locale/zh_CN/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/zh_TW/LC_MESSAGES/TW.mo +0 -0
- holidays/mixins/__init__.py +0 -2
- holidays/registry.py +1 -1
- holidays/version.py +1 -1
- {holidays-0.84.dist-info → holidays-0.86.dist-info}/METADATA +7 -7
- {holidays-0.84.dist-info → holidays-0.86.dist-info}/RECORD +94 -90
- {holidays-0.84.dist-info → holidays-0.86.dist-info}/licenses/CONTRIBUTORS +5 -0
- {holidays-0.84.dist-info → holidays-0.86.dist-info}/WHEEL +0 -0
- {holidays-0.84.dist-info → holidays-0.86.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.84.dist-info → holidays-0.86.dist-info}/top_level.txt +0 -0
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
from gettext import gettext as tr
|
|
14
14
|
|
|
15
15
|
from holidays.calendars import _CustomHinduHolidays, _CustomIslamicHolidays
|
|
16
|
-
from holidays.calendars.gregorian import MAR, APR, MAY, JUN, JUL,
|
|
17
|
-
from holidays.groups import
|
|
16
|
+
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, SEP, OCT, NOV, DEC
|
|
17
|
+
from holidays.groups import (
|
|
18
|
+
ChristianHolidays,
|
|
19
|
+
HinduCalendarHolidays,
|
|
20
|
+
IslamicHolidays,
|
|
21
|
+
StaticHolidays,
|
|
22
|
+
)
|
|
18
23
|
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_NONE, SUN_TO_NONE
|
|
19
24
|
|
|
20
25
|
|
|
21
26
|
class NationalStockExchangeOfIndia(
|
|
22
|
-
ObservedHolidayBase, HinduCalendarHolidays, ChristianHolidays, IslamicHolidays
|
|
27
|
+
ObservedHolidayBase, HinduCalendarHolidays, ChristianHolidays, IslamicHolidays, StaticHolidays
|
|
23
28
|
):
|
|
24
29
|
"""National Stock Exchange of India (NSE) holidays.
|
|
25
30
|
|
|
@@ -27,6 +32,27 @@ class NationalStockExchangeOfIndia(
|
|
|
27
32
|
* <https://web.archive.org/web/20250821175252/https://www.nseindia.com/resources/exchange-communication-circulars>
|
|
28
33
|
|
|
29
34
|
Historical data:
|
|
35
|
+
* [2001](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr2189.wri)
|
|
36
|
+
* [2002](https://archive.org/details/cmtr3058)
|
|
37
|
+
* [2003](https://web.archive.org/web/20250904042405/https://nsearchives.nseindia.com/content/circulars/cmtr3809.htm)
|
|
38
|
+
* [2004](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr4645.htm)
|
|
39
|
+
* [2005](https://web.archive.org/web/20250904043234/https://nsearchives.nseindia.com/content/circulars/cmtr5633.htm)
|
|
40
|
+
* [2006](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr6946.htm)
|
|
41
|
+
* [2007](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr8182.pdf)
|
|
42
|
+
* [2008](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr9908.htm)
|
|
43
|
+
* [2009](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr11733.htm)
|
|
44
|
+
* [2010](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr13713.pdf)
|
|
45
|
+
* [2011](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr16348.pdf)
|
|
46
|
+
* [2012](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr19539.pdf)
|
|
47
|
+
* [2013](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr22317.pdf)
|
|
48
|
+
* [2014](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr25326.pdf)
|
|
49
|
+
* [2015](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr28337.pdf)
|
|
50
|
+
* [2016](https://web.archive.org/web/20250903152854/https://nsearchives.nseindia.com/content/circulars/CMTR31297.pdf)
|
|
51
|
+
* [2017](https://web.archive.org/web/20250903152829/https://nsearchives.nseindia.com/content/circulars/CMTR33746.pdf)
|
|
52
|
+
* [2018](https://web.archive.org/web/20250903152307/https://nsearchives.nseindia.com/content/circulars/CMTR36475.pdf)
|
|
53
|
+
* [2019](https://archive.org/details/nsearchives.nseindia.comcontentcircularscmtr39612.pdf)
|
|
54
|
+
* [2020](https://web.archive.org/web/20250903152140/https://nsearchives.nseindia.com/content/circulars/CMTR42877.pdf)
|
|
55
|
+
* [2021](https://web.archive.org/web/20250903152041/https://nsearchives.nseindia.com/content/circulars/CMTR46623.pdf)
|
|
30
56
|
* [2022](https://web.archive.org/web/20250821071611/https://nsearchives.nseindia.com/content/circulars/CMTR50560.pdf)
|
|
31
57
|
* [2023](https://web.archive.org/web/20250821071635/https://nsearchives.nseindia.com/content/circulars/CMTR54757.pdf)
|
|
32
58
|
* [2024](https://web.archive.org/web/20250821071650/https://nsearchives.nseindia.com/content/circulars/CMTR59722.pdf)
|
|
@@ -46,6 +72,9 @@ class NationalStockExchangeOfIndia(
|
|
|
46
72
|
islamic_show_estimated:
|
|
47
73
|
Whether to add "estimated" label to Islamic holidays name
|
|
48
74
|
if holiday date is estimated.
|
|
75
|
+
|
|
76
|
+
In India, the dates of the Islamic calendar usually fall a day later than
|
|
77
|
+
the corresponding dates in the Umm al-Qura calendar.
|
|
49
78
|
"""
|
|
50
79
|
ChristianHolidays.__init__(self)
|
|
51
80
|
HinduCalendarHolidays.__init__(self, cls=NationalStockExchangeOfIndiaHinduHolidays)
|
|
@@ -53,7 +82,9 @@ class NationalStockExchangeOfIndia(
|
|
|
53
82
|
self,
|
|
54
83
|
cls=NationalStockExchangeOfIndiaIslamicHolidays,
|
|
55
84
|
show_estimated=islamic_show_estimated,
|
|
85
|
+
calendar_delta_days=+1,
|
|
56
86
|
)
|
|
87
|
+
StaticHolidays.__init__(self, cls=NationalStockExchangeOfIndiaStaticHolidays)
|
|
57
88
|
kwargs.setdefault("observed_rule", SAT_TO_NONE + SUN_TO_NONE)
|
|
58
89
|
super().__init__(*args, **kwargs)
|
|
59
90
|
|
|
@@ -64,16 +95,23 @@ class NationalStockExchangeOfIndia(
|
|
|
64
95
|
# Good Friday.
|
|
65
96
|
self._add_good_friday(tr("Good Friday"))
|
|
66
97
|
|
|
67
|
-
# Dr.
|
|
98
|
+
# Dr. B. R. Ambedkar Jayanti.
|
|
68
99
|
self._move_holiday(self._add_holiday_apr_14(tr("Dr. Baba Saheb Ambedkar Jayanti")))
|
|
69
100
|
|
|
70
|
-
|
|
71
|
-
|
|
101
|
+
self._move_holiday(
|
|
102
|
+
self._add_holiday_may_1(
|
|
103
|
+
# May Day.
|
|
104
|
+
tr("May Day")
|
|
105
|
+
if 2010 <= self._year <= 2014
|
|
106
|
+
# Maharashtra Day.
|
|
107
|
+
else tr("Maharashtra Day")
|
|
108
|
+
)
|
|
109
|
+
)
|
|
72
110
|
|
|
73
111
|
# Independence Day.
|
|
74
112
|
self._move_holiday(self._add_holiday_aug_15(tr("Independence Day")))
|
|
75
113
|
|
|
76
|
-
#
|
|
114
|
+
# Gandhi Jayanti.
|
|
77
115
|
self._move_holiday(self._add_holiday_oct_2(tr("Mahatma Gandhi Jayanti")))
|
|
78
116
|
|
|
79
117
|
# Christmas Day.
|
|
@@ -81,17 +119,19 @@ class NationalStockExchangeOfIndia(
|
|
|
81
119
|
|
|
82
120
|
# Hindu Calendar Holidays.
|
|
83
121
|
|
|
84
|
-
|
|
85
|
-
|
|
122
|
+
if self._year >= 2007:
|
|
123
|
+
# Maha Shivaratri.
|
|
124
|
+
self._move_holiday(self._add_maha_shivaratri(tr("Maha Shivaratri")))
|
|
86
125
|
|
|
87
126
|
# Holi.
|
|
88
127
|
self._move_holiday(self._add_holi(tr("Holi")))
|
|
89
128
|
|
|
90
|
-
|
|
91
|
-
|
|
129
|
+
if self._year >= 2006:
|
|
130
|
+
# Ram Navami.
|
|
131
|
+
self._move_holiday(self._add_ram_navami(tr("Ram Navami")))
|
|
92
132
|
|
|
93
|
-
|
|
94
|
-
|
|
133
|
+
# Mahavir Jayanti.
|
|
134
|
+
self._move_holiday(self._add_mahavir_jayanti(tr("Mahavir Jayanti")))
|
|
95
135
|
|
|
96
136
|
# Ganesh Chaturthi.
|
|
97
137
|
self._move_holiday(self._add_ganesh_chaturthi(tr("Ganesh Chaturthi")))
|
|
@@ -99,28 +139,35 @@ class NationalStockExchangeOfIndia(
|
|
|
99
139
|
# Dussehra.
|
|
100
140
|
self._move_holiday(self._add_dussehra(tr("Dussehra")))
|
|
101
141
|
|
|
102
|
-
# Diwali
|
|
103
|
-
self._move_holiday(self.
|
|
142
|
+
# Diwali Lakshmi Puja.
|
|
143
|
+
self._move_holiday(self._add_diwali_india(tr("Diwali Laxmi Pujan")))
|
|
104
144
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
# between Diwali Laxmi Pujan and Diwali Balipratipada.
|
|
109
|
-
self._move_holiday(
|
|
110
|
-
self._add_bhai_dooj(name)
|
|
111
|
-
if self._year in {2022, 2023}
|
|
112
|
-
else self._add_govardhan_puja(name)
|
|
113
|
-
)
|
|
145
|
+
if self._year <= 2002 or self._year >= 2011:
|
|
146
|
+
# Diwali Balipratipada.
|
|
147
|
+
self._move_holiday(self._add_govardhan_puja(tr("Diwali Balipratipada")))
|
|
114
148
|
|
|
115
149
|
# Guru Nanak Jayanti.
|
|
116
150
|
self._move_holiday(self._add_guru_nanak_jayanti(tr("Guru Nanak Jayanti")))
|
|
117
151
|
|
|
152
|
+
if 2003 <= self._year <= 2010:
|
|
153
|
+
# Bhai Dooj.
|
|
154
|
+
self._move_holiday(self._add_bhai_dooj(tr("Bhau Bhij")))
|
|
155
|
+
|
|
156
|
+
if 2006 <= self._year <= 2009:
|
|
157
|
+
# Buddha Purnima.
|
|
158
|
+
self._move_holiday(self._add_buddha_purnima(tr("Buddha Purnima")))
|
|
159
|
+
|
|
118
160
|
# Islamic Calendar Holidays.
|
|
119
161
|
|
|
120
162
|
# Ashura.
|
|
121
163
|
for dt in self._add_ashura_day(tr("Muharram")):
|
|
122
164
|
self._move_holiday(dt)
|
|
123
165
|
|
|
166
|
+
if 2006 <= self._year <= 2009:
|
|
167
|
+
# Prophet's Birthday.
|
|
168
|
+
for dt in self._add_mawlid_day(tr("Id-E-Milad-Un-Nabi")):
|
|
169
|
+
self._move_holiday(dt)
|
|
170
|
+
|
|
124
171
|
# Eid al-Fitr.
|
|
125
172
|
for dt in self._add_eid_al_fitr_day(tr("Id-Ul-Fitr (Ramadan Eid)")):
|
|
126
173
|
self._move_holiday(dt)
|
|
@@ -139,31 +186,87 @@ class NSE(NationalStockExchangeOfIndia):
|
|
|
139
186
|
|
|
140
187
|
|
|
141
188
|
class NationalStockExchangeOfIndiaHinduHolidays(_CustomHinduHolidays):
|
|
189
|
+
BUDDHA_PURNIMA_DATES = {
|
|
190
|
+
2008: (MAY, 19),
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
DIWALI_INDIA_DATES = {
|
|
194
|
+
2024: (NOV, 1),
|
|
195
|
+
2025: (OCT, 21),
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
DUSSEHRA_DATES = {
|
|
199
|
+
2003: (OCT, 4),
|
|
200
|
+
2018: (OCT, 18),
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
GOVARDHAN_PUJA_DATES = {
|
|
204
|
+
2001: (NOV, 16),
|
|
205
|
+
2002: (NOV, 6),
|
|
206
|
+
2003: (OCT, 25),
|
|
207
|
+
2006: (OCT, 23),
|
|
208
|
+
2020: (NOV, 16),
|
|
209
|
+
2022: (OCT, 26),
|
|
210
|
+
2023: (NOV, 14),
|
|
211
|
+
}
|
|
212
|
+
|
|
142
213
|
HOLI_DATES = {
|
|
143
214
|
2023: (MAR, 7),
|
|
144
215
|
}
|
|
145
216
|
|
|
217
|
+
MAHAVIR_JAYANTI_DATES = {
|
|
218
|
+
2010: (MAR, 28),
|
|
219
|
+
2016: (APR, 19),
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
RAM_NAVAMI_DATES = {
|
|
223
|
+
2007: (MAR, 27),
|
|
224
|
+
}
|
|
225
|
+
|
|
146
226
|
|
|
147
227
|
class NationalStockExchangeOfIndiaIslamicHolidays(_CustomIslamicHolidays):
|
|
148
|
-
ASHURA_DATES_CONFIRMED_YEARS = (
|
|
228
|
+
ASHURA_DATES_CONFIRMED_YEARS = (2001, 2025)
|
|
149
229
|
ASHURA_DATES = {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
230
|
+
2003: (MAR, 15),
|
|
231
|
+
2006: (FEB, 9),
|
|
232
|
+
2008: (JAN, 19),
|
|
233
|
+
2015: (OCT, 23),
|
|
234
|
+
2018: (SEP, 20),
|
|
154
235
|
}
|
|
155
236
|
|
|
156
|
-
EID_AL_ADHA_DATES_CONFIRMED_YEARS = (
|
|
237
|
+
EID_AL_ADHA_DATES_CONFIRMED_YEARS = (2001, 2025)
|
|
157
238
|
EID_AL_ADHA_DATES = {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
239
|
+
2003: (FEB, 13),
|
|
240
|
+
2005: (JAN, 21),
|
|
241
|
+
2006: (JAN, 11),
|
|
242
|
+
2007: ((JAN, 1), (DEC, 21)),
|
|
243
|
+
2009: (NOV, 27),
|
|
244
|
+
2014: (OCT, 6),
|
|
245
|
+
2015: (SEP, 25),
|
|
246
|
+
2016: (SEP, 13),
|
|
247
|
+
2023: (JUN, 28),
|
|
161
248
|
}
|
|
162
249
|
|
|
163
|
-
EID_AL_FITR_DATES_CONFIRMED_YEARS = (
|
|
250
|
+
EID_AL_FITR_DATES_CONFIRMED_YEARS = (2001, 2025)
|
|
164
251
|
EID_AL_FITR_DATES = {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
252
|
+
2002: (DEC, 7),
|
|
253
|
+
2005: (NOV, 5),
|
|
254
|
+
2006: (OCT, 25),
|
|
255
|
+
2010: (SEP, 10),
|
|
256
|
+
2016: (JUL, 6),
|
|
257
|
+
2021: (MAY, 13),
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
MAWLID_DATES_CONFIRMED_YEARS = (2006, 2009)
|
|
261
|
+
MAWLID_DATES = {
|
|
262
|
+
2008: (MAR, 20),
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
class NationalStockExchangeOfIndiaStaticHolidays:
|
|
267
|
+
"""National Stock Exchange of India (NSE) special holidays."""
|
|
268
|
+
|
|
269
|
+
special_public_holidays = {
|
|
270
|
+
# New Year's Day.
|
|
271
|
+
2010: (JAN, 1, tr("New Year")),
|
|
169
272
|
}
|
holidays/groups/__init__.py
CHANGED
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
# ruff: noqa: F401
|
|
14
|
-
|
|
15
13
|
from holidays.groups.balinese_saka import BalineseSakaCalendarHolidays
|
|
16
14
|
from holidays.groups.buddhist import BuddhistCalendarHolidays
|
|
17
15
|
from holidays.groups.burmese import BurmeseCalendarHolidays
|
holidays/holiday_base.py
CHANGED
|
@@ -46,6 +46,7 @@ from holidays.helpers import _normalize_arguments, _normalize_tuple
|
|
|
46
46
|
CategoryArg = str | Iterable[str]
|
|
47
47
|
DateArg = date | tuple[int, int] | tuple[int, int, int]
|
|
48
48
|
DateLike = date | datetime | str | float | int
|
|
49
|
+
NameLookup = Literal["contains", "exact", "startswith", "icontains", "iexact", "istartswith"]
|
|
49
50
|
SpecialHoliday = tuple[int, int, str] | tuple[tuple[int, int, str], ...]
|
|
50
51
|
SubstitutedHoliday = (
|
|
51
52
|
tuple[int, int, int, int]
|
|
@@ -558,27 +559,25 @@ class HolidayBase(dict[date, str]):
|
|
|
558
559
|
|
|
559
560
|
if key.step is None:
|
|
560
561
|
step = 1
|
|
561
|
-
elif isinstance(key.step, timedelta):
|
|
562
|
-
step = key.step.days
|
|
563
562
|
elif isinstance(key.step, int):
|
|
564
563
|
step = key.step
|
|
564
|
+
elif isinstance(key.step, timedelta):
|
|
565
|
+
step = key.step.days
|
|
565
566
|
else:
|
|
566
567
|
raise TypeError(f"Cannot convert type '{type(key.step)}' to int.")
|
|
567
568
|
|
|
568
569
|
if step == 0:
|
|
569
570
|
raise ValueError("Step value must not be zero.")
|
|
570
571
|
|
|
571
|
-
|
|
572
|
-
if
|
|
573
|
-
step
|
|
574
|
-
|
|
575
|
-
days_in_range = []
|
|
576
|
-
for delta_days in range(0, date_diff.days, step):
|
|
577
|
-
day = _timedelta(start, delta_days)
|
|
578
|
-
if day in self:
|
|
579
|
-
days_in_range.append(day)
|
|
572
|
+
diff_days = (stop - start).days
|
|
573
|
+
if diff_days < 0 <= step or diff_days >= 0 > step:
|
|
574
|
+
step = -step
|
|
580
575
|
|
|
581
|
-
return
|
|
576
|
+
return [
|
|
577
|
+
day
|
|
578
|
+
for delta_days in range(0, diff_days, step)
|
|
579
|
+
if (day := _timedelta(start, delta_days)) in self
|
|
580
|
+
]
|
|
582
581
|
|
|
583
582
|
return dict.__getitem__(self, self.__keytransform__(key))
|
|
584
583
|
|
|
@@ -670,19 +669,14 @@ class HolidayBase(dict[date, str]):
|
|
|
670
669
|
if self:
|
|
671
670
|
return super().__repr__()
|
|
672
671
|
|
|
673
|
-
parts = []
|
|
674
672
|
if hasattr(self, "market"):
|
|
675
|
-
|
|
676
|
-
parts.append(")")
|
|
673
|
+
return f"holidays.financial_holidays({self.market!r})"
|
|
677
674
|
elif hasattr(self, "country"):
|
|
678
|
-
parts.append(f"holidays.country_holidays({self.country!r}")
|
|
679
675
|
if self.subdiv:
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
else:
|
|
683
|
-
parts.append("holidays.HolidayBase()")
|
|
676
|
+
return f"holidays.country_holidays({self.country!r}, subdiv={self.subdiv!r})"
|
|
677
|
+
return f"holidays.country_holidays({self.country!r})"
|
|
684
678
|
|
|
685
|
-
return "
|
|
679
|
+
return "holidays.HolidayBase()"
|
|
686
680
|
|
|
687
681
|
def __setattr__(self, key: str, value: Any) -> None:
|
|
688
682
|
dict.__setattr__(self, key, value)
|
|
@@ -809,6 +803,37 @@ class HolidayBase(dict[date, str]):
|
|
|
809
803
|
self[dt] = self.tr(name)
|
|
810
804
|
return dt
|
|
811
805
|
|
|
806
|
+
def _add_multiday_holiday(
|
|
807
|
+
self, start_date: date, duration_days: int, *, name: str | None = None
|
|
808
|
+
) -> set[date]:
|
|
809
|
+
"""Add a multi-day holiday.
|
|
810
|
+
|
|
811
|
+
Args:
|
|
812
|
+
start_date:
|
|
813
|
+
First day of the holiday.
|
|
814
|
+
|
|
815
|
+
duration_days:
|
|
816
|
+
Number of additional days to add.
|
|
817
|
+
|
|
818
|
+
name:
|
|
819
|
+
Optional holiday name; inferred from `start_date` if omitted.
|
|
820
|
+
|
|
821
|
+
Returns:
|
|
822
|
+
A set of all added holiday dates.
|
|
823
|
+
|
|
824
|
+
Raises:
|
|
825
|
+
ValueError:
|
|
826
|
+
If the holiday name cannot be inferred from `start_date`.
|
|
827
|
+
"""
|
|
828
|
+
if (holiday_name := name or self.get(start_date)) is None:
|
|
829
|
+
raise ValueError(f"Cannot infer holiday name for date {start_date!r}.")
|
|
830
|
+
|
|
831
|
+
return {
|
|
832
|
+
d
|
|
833
|
+
for delta in range(1, duration_days + 1)
|
|
834
|
+
if (d := self._add_holiday(holiday_name, _timedelta(start_date, delta)))
|
|
835
|
+
}
|
|
836
|
+
|
|
812
837
|
def _add_special_holidays(self, mapping_names, *, observed=False):
|
|
813
838
|
"""Add special holidays."""
|
|
814
839
|
for mapping_name in mapping_names:
|
|
@@ -997,7 +1022,10 @@ class HolidayBase(dict[date, str]):
|
|
|
997
1022
|
return [name for name in self.get(key, "").split(HOLIDAY_NAME_DELIMITER) if name]
|
|
998
1023
|
|
|
999
1024
|
def get_named(
|
|
1000
|
-
self,
|
|
1025
|
+
self,
|
|
1026
|
+
holiday_name: str,
|
|
1027
|
+
lookup: NameLookup = "icontains",
|
|
1028
|
+
split_multiple_names: bool = True,
|
|
1001
1029
|
) -> list[date]:
|
|
1002
1030
|
"""Find all holiday dates matching a given name.
|
|
1003
1031
|
|
|
@@ -1202,7 +1230,7 @@ class HolidayBase(dict[date, str]):
|
|
|
1202
1230
|
|
|
1203
1231
|
return dict.pop(self, self.__keytransform__(key), default)
|
|
1204
1232
|
|
|
1205
|
-
def pop_named(self, holiday_name: str, lookup:
|
|
1233
|
+
def pop_named(self, holiday_name: str, lookup: NameLookup = "icontains") -> list[date]:
|
|
1206
1234
|
"""Remove all holidays matching the given name.
|
|
1207
1235
|
|
|
1208
1236
|
This method removes all dates associated with a holiday name, so they are
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
holidays/mixins/__init__.py
CHANGED
holidays/registry.py
CHANGED
|
@@ -287,7 +287,7 @@ COUNTRIES: RegistryDict = {
|
|
|
287
287
|
FINANCIAL: RegistryDict = {
|
|
288
288
|
"brasil_bolsa_balcao": ("BrasilBolsaBalcao", "BVMF", "B3"),
|
|
289
289
|
"european_central_bank": ("EuropeanCentralBank", "XECB", "ECB", "TAR"),
|
|
290
|
-
"ice_futures_europe": ("
|
|
290
|
+
"ice_futures_europe": ("IceFuturesEurope", "IFEU", "ICEFuturesEurope"),
|
|
291
291
|
"national_stock_exchange_of_india": ("NationalStockExchangeOfIndia", "XNSE", "NSE"),
|
|
292
292
|
"ny_stock_exchange": ("NewYorkStockExchange", "XNYS", "NYSE"),
|
|
293
293
|
}
|
holidays/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: holidays
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.86
|
|
4
4
|
Summary: Open World Holidays Framework
|
|
5
5
|
Author: Vacanza Team
|
|
6
6
|
Maintainer: Arkadii Yakovets, Panpakorn Siripanich, Serhii Murza
|
|
@@ -185,7 +185,7 @@ any) in brackets, available languages and additional holiday categories. All cou
|
|
|
185
185
|
<td></td>
|
|
186
186
|
</tr>
|
|
187
187
|
<tr>
|
|
188
|
-
<td
|
|
188
|
+
<td>Åland Islands</td>
|
|
189
189
|
<td>AX</td>
|
|
190
190
|
<td>Can also be loaded as country FI, subdivision 01</td>
|
|
191
191
|
<td>en_US, <strong>fi</strong>, sv_FI, th, uk</td>
|
|
@@ -427,7 +427,7 @@ any) in brackets, available languages and additional holiday categories. All cou
|
|
|
427
427
|
<td>BG</td>
|
|
428
428
|
<td></td>
|
|
429
429
|
<td><strong>bg</strong>, en_US, uk</td>
|
|
430
|
-
<td>SCHOOL</td>
|
|
430
|
+
<td>HALF_DAY, SCHOOL</td>
|
|
431
431
|
</tr>
|
|
432
432
|
<tr>
|
|
433
433
|
<td>Burkina Faso</td>
|
|
@@ -665,7 +665,7 @@ any) in brackets, available languages and additional holiday categories. All cou
|
|
|
665
665
|
<td>EE</td>
|
|
666
666
|
<td></td>
|
|
667
667
|
<td>en_US, <strong>et</strong>, uk</td>
|
|
668
|
-
<td
|
|
668
|
+
<td>HALF_DAY</td>
|
|
669
669
|
</tr>
|
|
670
670
|
<tr>
|
|
671
671
|
<td>Eswatini</td>
|
|
@@ -944,7 +944,7 @@ any) in brackets, available languages and additional holiday categories. All cou
|
|
|
944
944
|
<td>Italy</td>
|
|
945
945
|
<td>IT</td>
|
|
946
946
|
<td>Provinces: AG (Agrigento), AL (Alessandria), AN (Ancona), AO (Aosta), AP (Ascoli Piceno), AQ (L'Aquila), AR (Arezzo), AT (Asti), AV (Avellino), BA (Bari), BG (Bergamo), BI (Biella), BL (Belluno), BN (Benevento), BO (Bologna), BR (Brindisi), BS (Brescia), BT (Barletta-Andria-Trani), BZ (Bolzano), CA (Cagliari), CB (Campobasso), CE (Caserta), CH (Chieti), CL (Caltanissetta), CN (Cuneo), CO (Como), CR (Cremona), CS (Cosenza), CT (Catania), CZ (Catanzaro), EN (Enna), FC (Forli-Cesena, Forlì-Cesena), FE (Ferrara), FG (Foggia), FI (Firenze), FM (Fermo), FR (Frosinone), GE (Genova), GO (Gorizia), GR (Grosseto), IM (Imperia), IS (Isernia), KR (Crotone), LC (Lecco), LE (Lecce), LI (Livorno), LO (Lodi), LT (Latina), LU (Lucca), MB (Monza e Brianza), MC (Macerata), ME (Messina), MI (Milano), MN (Mantova), MO (Modena), MS (Massa-Carrara), MT (Matera), NA (Napoli), NO (Novara), NU (Nuoro), OR (Oristano), PA (Palermo), PC (Piacenza), PD (Padova), PE (Pescara), PG (Perugia), PI (Pisa), PN (Pordenone), PO (Prato), PR (Parma), PT (Pistoia), PU (Pesaro e Urbino), PV (Pavia), PZ (Potenza), RA (Ravenna), RC (Reggio Calabria), RE (Reggio Emilia), RG (Ragusa), RI (Rieti), RM (Roma), RN (Rimini), RO (Rovigo), SA (Salerno), SI (Siena), SO (Sondrio), SP (La Spezia), SR (Siracusa), SS (Sassari), SU (Sud Sardegna), SV (Savona), TA (Taranto), TE (Teramo), TN (Trento), TO (Torino), TP (Trapani), TR (Terni), TS (Trieste), TV (Treviso), UD (Udine), VA (Varese), VB (Verbano-Cusio-Ossola), VC (Vercelli), VE (Venezia), VI (Vicenza), VR (Verona), VT (Viterbo), VV (Vibo Valentia); cities: Andria, Barletta, Cesena, Forli (Forlì), Pesaro, Trani, Urbino</td>
|
|
947
|
-
<td></td>
|
|
947
|
+
<td>en_US, <strong>it_IT</strong></td>
|
|
948
948
|
<td></td>
|
|
949
949
|
</tr>
|
|
950
950
|
<tr>
|
|
@@ -1252,7 +1252,7 @@ any) in brackets, available languages and additional holiday categories. All cou
|
|
|
1252
1252
|
<td>Nepal</td>
|
|
1253
1253
|
<td>NP</td>
|
|
1254
1254
|
<td></td>
|
|
1255
|
-
<td></td>
|
|
1255
|
+
<td>en_US, <strong>ne</strong></td>
|
|
1256
1256
|
<td>WORKDAY</td>
|
|
1257
1257
|
</tr>
|
|
1258
1258
|
<tr>
|
|
@@ -1680,7 +1680,7 @@ any) in brackets, available languages and additional holiday categories. All cou
|
|
|
1680
1680
|
<td>SE</td>
|
|
1681
1681
|
<td></td>
|
|
1682
1682
|
<td>en_US, <strong>sv</strong>, th, uk</td>
|
|
1683
|
-
<td
|
|
1683
|
+
<td>BANK, OPTIONAL</td>
|
|
1684
1684
|
</tr>
|
|
1685
1685
|
<tr>
|
|
1686
1686
|
<td>Switzerland</td>
|