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.
Files changed (112) hide show
  1. holidays/__init__.py +0 -2
  2. holidays/calendars/__init__.py +0 -2
  3. holidays/calendars/balinese_saka.py +2 -3
  4. holidays/calendars/buddhist.py +3 -4
  5. holidays/calendars/burmese.py +9 -10
  6. holidays/calendars/chinese.py +8 -9
  7. holidays/calendars/hebrew.py +10 -11
  8. holidays/calendars/hindu.py +27 -28
  9. holidays/calendars/mandaean.py +2 -3
  10. holidays/calendars/mongolian.py +4 -5
  11. holidays/calendars/persian.py +2 -3
  12. holidays/calendars/sinhala.py +25 -14
  13. holidays/calendars/thai.py +13 -14
  14. holidays/calendars/tibetan.py +12 -13
  15. holidays/constants.py +0 -2
  16. holidays/countries/__init__.py +0 -2
  17. holidays/countries/aland_islands.py +4 -4
  18. holidays/countries/american_samoa.py +4 -4
  19. holidays/countries/angola.py +1 -2
  20. holidays/countries/austria.py +1 -1
  21. holidays/countries/azerbaijan.py +2 -0
  22. holidays/countries/china.py +10 -1
  23. holidays/countries/ecuador.py +12 -4
  24. holidays/countries/french_guiana.py +4 -4
  25. holidays/countries/french_polynesia.py +4 -4
  26. holidays/countries/french_southern_territories.py +4 -4
  27. holidays/countries/guadeloupe.py +4 -4
  28. holidays/countries/guam.py +4 -4
  29. holidays/countries/guernsey.py +1 -2
  30. holidays/countries/italy.py +2 -2
  31. holidays/countries/jersey.py +1 -2
  32. holidays/countries/malta.py +1 -1
  33. holidays/countries/marshall_islands.py +8 -6
  34. holidays/countries/martinique.py +4 -4
  35. holidays/countries/mauritania.py +2 -4
  36. holidays/countries/mayotte.py +4 -4
  37. holidays/countries/new_caledonia.py +4 -4
  38. holidays/countries/northern_mariana_islands.py +4 -4
  39. holidays/countries/portugal.py +6 -3
  40. holidays/countries/puerto_rico.py +4 -4
  41. holidays/countries/reunion.py +4 -4
  42. holidays/countries/saint_barthelemy.py +4 -4
  43. holidays/countries/saint_martin.py +4 -4
  44. holidays/countries/saint_pierre_and_miquelon.py +4 -4
  45. holidays/countries/samoa.py +1 -3
  46. holidays/countries/sint_maarten.py +1 -1
  47. holidays/countries/spain.py +418 -214
  48. holidays/countries/sri_lanka.py +37 -33
  49. holidays/countries/svalbard_and_jan_mayen.py +4 -4
  50. holidays/countries/taiwan.py +2 -2
  51. holidays/countries/thailand.py +4 -1
  52. holidays/countries/turkey.py +7 -4
  53. holidays/countries/united_kingdom.py +1 -2
  54. holidays/countries/united_states.py +5 -2
  55. holidays/countries/united_states_minor_outlying_islands.py +4 -4
  56. holidays/countries/united_states_virgin_islands.py +4 -4
  57. holidays/countries/wallis_and_futuna.py +4 -4
  58. holidays/financial/__init__.py +1 -3
  59. holidays/financial/ice_futures_europe.py +6 -2
  60. holidays/financial/national_stock_exchange_of_india.py +141 -38
  61. holidays/groups/__init__.py +0 -2
  62. holidays/groups/balinese_saka.py +2 -3
  63. holidays/groups/buddhist.py +4 -5
  64. holidays/groups/burmese.py +11 -12
  65. holidays/groups/chinese.py +18 -19
  66. holidays/groups/christian.py +20 -0
  67. holidays/groups/eastern.py +2 -3
  68. holidays/groups/hebrew.py +7 -10
  69. holidays/groups/hindu.py +36 -37
  70. holidays/groups/mandaean.py +13 -14
  71. holidays/groups/mongolian.py +7 -8
  72. holidays/groups/persian.py +14 -15
  73. holidays/groups/sinhala.py +13 -14
  74. holidays/groups/thai.py +12 -13
  75. holidays/groups/tibetan.py +16 -17
  76. holidays/holiday_base.py +34 -33
  77. holidays/ical.py +1 -2
  78. holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
  79. holidays/locale/en_IN/LC_MESSAGES/XNSE.mo +0 -0
  80. holidays/locale/en_US/LC_MESSAGES/EC.mo +0 -0
  81. holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
  82. holidays/locale/en_US/LC_MESSAGES/LK.mo +0 -0
  83. holidays/locale/en_US/LC_MESSAGES/TR.mo +0 -0
  84. holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
  85. holidays/locale/en_US/LC_MESSAGES/XNSE.mo +0 -0
  86. holidays/locale/es/LC_MESSAGES/EC.mo +0 -0
  87. holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
  88. holidays/locale/hi/LC_MESSAGES/XNSE.mo +0 -0
  89. holidays/locale/si_LK/LC_MESSAGES/LK.mo +0 -0
  90. holidays/locale/ta_LK/LC_MESSAGES/LK.mo +0 -0
  91. holidays/locale/th/LC_MESSAGES/CN.mo +0 -0
  92. holidays/locale/th/LC_MESSAGES/ES.mo +0 -0
  93. holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
  94. holidays/locale/th/LC_MESSAGES/KR.mo +0 -0
  95. holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
  96. holidays/locale/th/LC_MESSAGES/US.mo +0 -0
  97. holidays/locale/tr/LC_MESSAGES/TR.mo +0 -0
  98. holidays/locale/uk/LC_MESSAGES/EC.mo +0 -0
  99. holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
  100. holidays/locale/uk/LC_MESSAGES/TR.mo +0 -0
  101. holidays/mixins/__init__.py +0 -2
  102. holidays/mixins/child_entity.py +1 -3
  103. holidays/observed_holiday_base.py +12 -13
  104. holidays/registry.py +4 -4
  105. holidays/utils.py +13 -14
  106. holidays/version.py +1 -1
  107. {holidays-0.83.dist-info → holidays-0.85.dist-info}/METADATA +4 -5
  108. {holidays-0.83.dist-info → holidays-0.85.dist-info}/RECORD +112 -111
  109. {holidays-0.83.dist-info → holidays-0.85.dist-info}/licenses/CONTRIBUTORS +2 -0
  110. {holidays-0.83.dist-info → holidays-0.85.dist-info}/WHEEL +0 -0
  111. {holidays-0.83.dist-info → holidays-0.85.dist-info}/licenses/LICENSE +0 -0
  112. {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, Optional[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: Optional[ObservedRule] = None,
110
- observed_since: Optional[int] = None,
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) -> Optional[date]:
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: Optional[DateArg] = None,
147
- name: Optional[str] = None,
145
+ dt: DateArg | None = None,
146
+ name: str | None = None,
148
147
  *,
149
- rule: Optional[ObservedRule] = None,
148
+ rule: ObservedRule | None = None,
150
149
  force_observed: bool = False,
151
150
  show_observed_label: bool = True,
152
- ) -> tuple[bool, Optional[date]]:
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: Optional[ObservedRule] = None,
203
+ rule: ObservedRule | None = None,
205
204
  force_observed: bool = False,
206
205
  show_observed_label: bool = True,
207
- ) -> tuple[bool, Optional[date]]:
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: Optional[ObservedRule] = None
217
- ) -> tuple[bool, Optional[date]]:
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, Optional
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": ("ICEFuturesEurope", "IFEU"),
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) -> Optional[Any]:
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) -> Optional[HolidayBase]:
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: Optional[str] = None,
35
- years: Optional[Union[int, Iterable[int]]] = None,
33
+ subdiv: str | None = None,
34
+ years: int | Iterable[int] | None = None,
36
35
  expand: bool = True,
37
36
  observed: bool = True,
38
- prov: Optional[str] = None,
39
- state: Optional[str] = None,
40
- language: Optional[str] = None,
41
- categories: Optional[CategoryArg] = None,
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: Optional[str] = None,
234
- years: Optional[Union[int, Iterable[int]]] = None,
232
+ subdiv: str | None = None,
233
+ years: int | Iterable[int] | None = None,
235
234
  expand: bool = True,
236
235
  observed: bool = True,
237
- language: Optional[str] = None,
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: Optional[str] = None,
319
- years: Optional[Union[int, Iterable[int]]] = None,
317
+ subdiv: str | None = None,
318
+ years: int | Iterable[int] | None = None,
320
319
  expand: bool = True,
321
320
  observed: bool = True,
322
- prov: Optional[str] = None,
323
- state: Optional[str] = None,
321
+ prov: str | None = None,
322
+ state: str | None = None,
324
323
  ) -> HolidayBase:
325
324
  """
326
325
  Note:
holidays/version.py CHANGED
@@ -10,4 +10,4 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- __version__ = "0.83"
13
+ __version__ = "0.85"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: holidays
3
- Version: 0.83
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.9
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>Aland Islands</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>