holidays 0.83__py3-none-any.whl → 0.85__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/calendars/balinese_saka.py +2 -3
- holidays/calendars/buddhist.py +3 -4
- holidays/calendars/burmese.py +9 -10
- holidays/calendars/chinese.py +8 -9
- holidays/calendars/hebrew.py +10 -11
- holidays/calendars/hindu.py +27 -28
- holidays/calendars/mandaean.py +2 -3
- holidays/calendars/mongolian.py +4 -5
- holidays/calendars/persian.py +2 -3
- holidays/calendars/sinhala.py +25 -14
- holidays/calendars/thai.py +13 -14
- holidays/calendars/tibetan.py +12 -13
- 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/angola.py +1 -2
- holidays/countries/austria.py +1 -1
- holidays/countries/azerbaijan.py +2 -0
- holidays/countries/china.py +10 -1
- holidays/countries/ecuador.py +12 -4
- holidays/countries/french_guiana.py +4 -4
- holidays/countries/french_polynesia.py +4 -4
- holidays/countries/french_southern_territories.py +4 -4
- holidays/countries/guadeloupe.py +4 -4
- holidays/countries/guam.py +4 -4
- holidays/countries/guernsey.py +1 -2
- holidays/countries/italy.py +2 -2
- holidays/countries/jersey.py +1 -2
- holidays/countries/malta.py +1 -1
- 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/new_caledonia.py +4 -4
- holidays/countries/northern_mariana_islands.py +4 -4
- holidays/countries/portugal.py +6 -3
- holidays/countries/puerto_rico.py +4 -4
- holidays/countries/reunion.py +4 -4
- 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/sint_maarten.py +1 -1
- holidays/countries/spain.py +418 -214
- holidays/countries/sri_lanka.py +37 -33
- holidays/countries/svalbard_and_jan_mayen.py +4 -4
- holidays/countries/taiwan.py +2 -2
- holidays/countries/thailand.py +4 -1
- holidays/countries/turkey.py +7 -4
- holidays/countries/united_kingdom.py +1 -2
- holidays/countries/united_states.py +5 -2
- 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/groups/balinese_saka.py +2 -3
- holidays/groups/buddhist.py +4 -5
- holidays/groups/burmese.py +11 -12
- holidays/groups/chinese.py +18 -19
- holidays/groups/christian.py +20 -0
- holidays/groups/eastern.py +2 -3
- holidays/groups/hebrew.py +7 -10
- holidays/groups/hindu.py +36 -37
- holidays/groups/mandaean.py +13 -14
- holidays/groups/mongolian.py +7 -8
- holidays/groups/persian.py +14 -15
- holidays/groups/sinhala.py +13 -14
- holidays/groups/thai.py +12 -13
- holidays/groups/tibetan.py +16 -17
- holidays/holiday_base.py +34 -33
- holidays/ical.py +1 -2
- holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_IN/LC_MESSAGES/XNSE.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/EC.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/LK.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TR.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/es/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/hi/LC_MESSAGES/XNSE.mo +0 -0
- holidays/locale/si_LK/LC_MESSAGES/LK.mo +0 -0
- holidays/locale/ta_LK/LC_MESSAGES/LK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/CN.mo +0 -0
- holidays/locale/th/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/KR.mo +0 -0
- holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/th/LC_MESSAGES/US.mo +0 -0
- holidays/locale/tr/LC_MESSAGES/TR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/EC.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/TR.mo +0 -0
- holidays/mixins/__init__.py +0 -2
- holidays/mixins/child_entity.py +1 -3
- holidays/observed_holiday_base.py +12 -13
- holidays/registry.py +4 -4
- holidays/utils.py +13 -14
- holidays/version.py +1 -1
- {holidays-0.83.dist-info → holidays-0.85.dist-info}/METADATA +4 -5
- {holidays-0.83.dist-info → holidays-0.85.dist-info}/RECORD +112 -111
- {holidays-0.83.dist-info → holidays-0.85.dist-info}/licenses/CONTRIBUTORS +2 -0
- {holidays-0.83.dist-info → holidays-0.85.dist-info}/WHEEL +0 -0
- {holidays-0.83.dist-info → holidays-0.85.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.83.dist-info → holidays-0.85.dist-info}/top_level.txt +0 -0
|
@@ -11,13 +11,12 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from typing import Optional
|
|
15
14
|
|
|
16
15
|
from holidays.calendars.gregorian import MON, TUE, WED, THU, FRI, SAT, SUN, _timedelta
|
|
17
16
|
from holidays.holiday_base import DateArg, HolidayBase
|
|
18
17
|
|
|
19
18
|
|
|
20
|
-
class ObservedRule(dict[int,
|
|
19
|
+
class ObservedRule(dict[int, int | None]):
|
|
21
20
|
__slots__ = ()
|
|
22
21
|
|
|
23
22
|
def __add__(self, other):
|
|
@@ -106,8 +105,8 @@ class ObservedHolidayBase(HolidayBase):
|
|
|
106
105
|
|
|
107
106
|
def __init__(
|
|
108
107
|
self,
|
|
109
|
-
observed_rule:
|
|
110
|
-
observed_since:
|
|
108
|
+
observed_rule: ObservedRule | None = None,
|
|
109
|
+
observed_since: int | None = None,
|
|
111
110
|
*args,
|
|
112
111
|
**kwargs,
|
|
113
112
|
):
|
|
@@ -127,7 +126,7 @@ class ObservedHolidayBase(HolidayBase):
|
|
|
127
126
|
return dt_work
|
|
128
127
|
return dt
|
|
129
128
|
|
|
130
|
-
def _get_observed_date(self, dt: date, rule: ObservedRule) ->
|
|
129
|
+
def _get_observed_date(self, dt: date, rule: ObservedRule) -> date | None:
|
|
131
130
|
delta = rule.get(dt.weekday(), 0)
|
|
132
131
|
if delta:
|
|
133
132
|
return (
|
|
@@ -143,13 +142,13 @@ class ObservedHolidayBase(HolidayBase):
|
|
|
143
142
|
|
|
144
143
|
def _add_observed(
|
|
145
144
|
self,
|
|
146
|
-
dt:
|
|
147
|
-
name:
|
|
145
|
+
dt: DateArg | None = None,
|
|
146
|
+
name: str | None = None,
|
|
148
147
|
*,
|
|
149
|
-
rule:
|
|
148
|
+
rule: ObservedRule | None = None,
|
|
150
149
|
force_observed: bool = False,
|
|
151
150
|
show_observed_label: bool = True,
|
|
152
|
-
) -> tuple[bool,
|
|
151
|
+
) -> tuple[bool, date | None]:
|
|
153
152
|
if dt is None:
|
|
154
153
|
return False, None
|
|
155
154
|
|
|
@@ -201,10 +200,10 @@ class ObservedHolidayBase(HolidayBase):
|
|
|
201
200
|
self,
|
|
202
201
|
dt: date,
|
|
203
202
|
*,
|
|
204
|
-
rule:
|
|
203
|
+
rule: ObservedRule | None = None,
|
|
205
204
|
force_observed: bool = False,
|
|
206
205
|
show_observed_label: bool = True,
|
|
207
|
-
) -> tuple[bool,
|
|
206
|
+
) -> tuple[bool, date | None]:
|
|
208
207
|
is_observed, dt_observed = self._add_observed(
|
|
209
208
|
dt, rule=rule, force_observed=force_observed, show_observed_label=show_observed_label
|
|
210
209
|
)
|
|
@@ -213,8 +212,8 @@ class ObservedHolidayBase(HolidayBase):
|
|
|
213
212
|
return is_observed, dt_observed if is_observed else dt
|
|
214
213
|
|
|
215
214
|
def _move_holiday_forced(
|
|
216
|
-
self, dt: date, rule:
|
|
217
|
-
) -> tuple[bool,
|
|
215
|
+
self, dt: date, rule: ObservedRule | None = None
|
|
216
|
+
) -> tuple[bool, date | None]:
|
|
218
217
|
return self._move_holiday(dt, rule=rule, force_observed=True, show_observed_label=False)
|
|
219
218
|
|
|
220
219
|
def _populate_observed(self, dts: set[date], *, multiple: bool = False) -> None:
|
holidays/registry.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import importlib
|
|
14
14
|
from collections.abc import Iterable
|
|
15
15
|
from threading import RLock
|
|
16
|
-
from typing import Any
|
|
16
|
+
from typing import Any
|
|
17
17
|
|
|
18
18
|
from holidays.holiday_base import HolidayBase
|
|
19
19
|
|
|
@@ -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
|
}
|
|
@@ -327,7 +327,7 @@ class EntityLoader:
|
|
|
327
327
|
cls = self.get_entity()
|
|
328
328
|
return cls(*args, **kwargs) # type: ignore[misc, operator]
|
|
329
329
|
|
|
330
|
-
def __getattr__(self, name: str) ->
|
|
330
|
+
def __getattr__(self, name: str) -> Any | None:
|
|
331
331
|
"""Return attribute of a lazy-loaded entity."""
|
|
332
332
|
cls = self.get_entity()
|
|
333
333
|
return getattr(cls, name)
|
|
@@ -339,7 +339,7 @@ class EntityLoader:
|
|
|
339
339
|
f"use the '{self.module_name}.{self.entity_name}' class directly."
|
|
340
340
|
)
|
|
341
341
|
|
|
342
|
-
def get_entity(self) ->
|
|
342
|
+
def get_entity(self) -> HolidayBase | None:
|
|
343
343
|
"""Return lazy-loaded entity."""
|
|
344
344
|
if self.entity is None:
|
|
345
345
|
# Avoid deadlock due to importlib.import_module not being thread-safe by caching all
|
holidays/utils.py
CHANGED
|
@@ -23,7 +23,6 @@ __all__ = (
|
|
|
23
23
|
import warnings
|
|
24
24
|
from collections.abc import Iterable
|
|
25
25
|
from functools import cache
|
|
26
|
-
from typing import Optional, Union
|
|
27
26
|
|
|
28
27
|
from holidays.holiday_base import CategoryArg, HolidayBase
|
|
29
28
|
from holidays.registry import EntityLoader
|
|
@@ -31,14 +30,14 @@ from holidays.registry import EntityLoader
|
|
|
31
30
|
|
|
32
31
|
def country_holidays(
|
|
33
32
|
country: str,
|
|
34
|
-
subdiv:
|
|
35
|
-
years:
|
|
33
|
+
subdiv: str | None = None,
|
|
34
|
+
years: int | Iterable[int] | None = None,
|
|
36
35
|
expand: bool = True,
|
|
37
36
|
observed: bool = True,
|
|
38
|
-
prov:
|
|
39
|
-
state:
|
|
40
|
-
language:
|
|
41
|
-
categories:
|
|
37
|
+
prov: str | None = None,
|
|
38
|
+
state: str | None = None,
|
|
39
|
+
language: str | None = None,
|
|
40
|
+
categories: CategoryArg | None = None,
|
|
42
41
|
) -> HolidayBase:
|
|
43
42
|
"""Return a new dictionary-like [HolidayBase][holidays.holiday_base.HolidayBase] object.
|
|
44
43
|
|
|
@@ -230,11 +229,11 @@ def country_holidays(
|
|
|
230
229
|
|
|
231
230
|
def financial_holidays(
|
|
232
231
|
market: str,
|
|
233
|
-
subdiv:
|
|
234
|
-
years:
|
|
232
|
+
subdiv: str | None = None,
|
|
233
|
+
years: int | Iterable[int] | None = None,
|
|
235
234
|
expand: bool = True,
|
|
236
235
|
observed: bool = True,
|
|
237
|
-
language:
|
|
236
|
+
language: str | None = None,
|
|
238
237
|
) -> HolidayBase:
|
|
239
238
|
"""Return a new dictionary-like [HolidayBase][holidays.holiday_base.HolidayBase] object.
|
|
240
239
|
|
|
@@ -315,12 +314,12 @@ def financial_holidays(
|
|
|
315
314
|
|
|
316
315
|
def CountryHoliday( # noqa: N802
|
|
317
316
|
country: str,
|
|
318
|
-
subdiv:
|
|
319
|
-
years:
|
|
317
|
+
subdiv: str | None = None,
|
|
318
|
+
years: int | Iterable[int] | None = None,
|
|
320
319
|
expand: bool = True,
|
|
321
320
|
observed: bool = True,
|
|
322
|
-
prov:
|
|
323
|
-
state:
|
|
321
|
+
prov: str | None = None,
|
|
322
|
+
state: str | None = None,
|
|
324
323
|
) -> HolidayBase:
|
|
325
324
|
"""
|
|
326
325
|
Note:
|
holidays/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: holidays
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.85
|
|
4
4
|
Summary: Open World Holidays Framework
|
|
5
5
|
Author: Vacanza Team
|
|
6
6
|
Maintainer: Arkadii Yakovets, Panpakorn Siripanich, Serhii Murza
|
|
@@ -17,7 +17,6 @@ Classifier: Intended Audience :: Financial and Insurance Industry
|
|
|
17
17
|
Classifier: Intended Audience :: Information Technology
|
|
18
18
|
Classifier: Operating System :: OS Independent
|
|
19
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -29,7 +28,7 @@ Classifier: Topic :: Office/Business :: Financial :: Accounting
|
|
|
29
28
|
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
30
29
|
Classifier: Topic :: Office/Business :: Scheduling
|
|
31
30
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
32
|
-
Requires-Python: >=3.
|
|
31
|
+
Requires-Python: >=3.10
|
|
33
32
|
Description-Content-Type: text/markdown
|
|
34
33
|
License-File: CONTRIBUTORS
|
|
35
34
|
License-File: LICENSE
|
|
@@ -186,7 +185,7 @@ any) in brackets, available languages and additional holiday categories. All cou
|
|
|
186
185
|
<td></td>
|
|
187
186
|
</tr>
|
|
188
187
|
<tr>
|
|
189
|
-
<td
|
|
188
|
+
<td>Åland Islands</td>
|
|
190
189
|
<td>AX</td>
|
|
191
190
|
<td>Can also be loaded as country FI, subdivision 01</td>
|
|
192
191
|
<td>en_US, <strong>fi</strong>, sv_FI, th, uk</td>
|
|
@@ -1645,7 +1644,7 @@ any) in brackets, available languages and additional holiday categories. All cou
|
|
|
1645
1644
|
<td>Spain</td>
|
|
1646
1645
|
<td>ES</td>
|
|
1647
1646
|
<td>Autonomous communities: AN (Andalucía), AR (Aragón), AS (Asturias), CB (Cantabria), CE (Ceuta), CL (Castilla y León), CM (Castilla-La Mancha), CN (Canarias), CT (Cataluña, Catalunya), EX (Extremadura), GA (Galicia), IB (Islas Baleares, Illes Balears), MC (Murcia), MD (Madrid), ML (Melilla), NC (Navarra), PV (País Vasco), RI (La Rioja), VC (Valenciana)</td>
|
|
1648
|
-
<td>ca, en_US, <strong>es</strong>, uk</td>
|
|
1647
|
+
<td>ca, en_US, <strong>es</strong>, th, uk</td>
|
|
1649
1648
|
<td></td>
|
|
1650
1649
|
</tr>
|
|
1651
1650
|
<tr>
|