holidays 0.87__py3-none-any.whl → 0.89__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 (71) hide show
  1. holidays/constants.py +1 -0
  2. holidays/countries/american_samoa.py +2 -0
  3. holidays/countries/argentina.py +49 -37
  4. holidays/countries/australia.py +13 -1
  5. holidays/countries/azerbaijan.py +5 -4
  6. holidays/countries/belarus.py +4 -2
  7. holidays/countries/brazil.py +27 -1
  8. holidays/countries/chile.py +2 -3
  9. holidays/countries/estonia.py +5 -5
  10. holidays/countries/guam.py +2 -0
  11. holidays/countries/italy.py +7 -7
  12. holidays/countries/jordan.py +6 -4
  13. holidays/countries/kyrgyzstan.py +3 -2
  14. holidays/countries/macau.py +39 -45
  15. holidays/countries/malaysia.py +171 -71
  16. holidays/countries/new_zealand.py +4 -3
  17. holidays/countries/northern_mariana_islands.py +2 -0
  18. holidays/countries/puerto_rico.py +4 -2
  19. holidays/countries/qatar.py +4 -5
  20. holidays/countries/sweden.py +35 -11
  21. holidays/countries/taiwan.py +6 -5
  22. holidays/countries/timor_leste.py +14 -20
  23. holidays/countries/turks_and_caicos_islands.py +13 -3
  24. holidays/countries/united_states.py +400 -108
  25. holidays/countries/united_states_minor_outlying_islands.py +2 -0
  26. holidays/countries/united_states_virgin_islands.py +2 -0
  27. holidays/countries/uzbekistan.py +12 -1
  28. holidays/countries/venezuela.py +113 -23
  29. holidays/financial/__init__.py +1 -0
  30. holidays/financial/bombay_stock_exchange.py +33 -0
  31. holidays/financial/national_stock_exchange_of_india.py +1 -1
  32. holidays/holiday_base.py +2 -1
  33. holidays/locale/en_AU/LC_MESSAGES/AU.mo +0 -0
  34. holidays/locale/en_IN/LC_MESSAGES/XBOM.mo +0 -0
  35. holidays/locale/en_TC/LC_MESSAGES/TC.mo +0 -0
  36. holidays/locale/en_TL/LC_MESSAGES/TL.mo +0 -0
  37. holidays/locale/en_US/LC_MESSAGES/AU.mo +0 -0
  38. holidays/locale/en_US/LC_MESSAGES/BR.mo +0 -0
  39. holidays/locale/en_US/LC_MESSAGES/MY.mo +0 -0
  40. holidays/locale/en_US/LC_MESSAGES/SE.mo +0 -0
  41. holidays/locale/en_US/LC_MESSAGES/TC.mo +0 -0
  42. holidays/locale/en_US/LC_MESSAGES/TL.mo +0 -0
  43. holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
  44. holidays/locale/en_US/LC_MESSAGES/VE.mo +0 -0
  45. holidays/locale/en_US/LC_MESSAGES/XBOM.mo +0 -0
  46. holidays/locale/es/LC_MESSAGES/VE.mo +0 -0
  47. holidays/locale/gu/LC_MESSAGES/XBOM.mo +0 -0
  48. holidays/locale/gu/LC_MESSAGES/XNSE.mo +0 -0
  49. holidays/locale/hi/LC_MESSAGES/XBOM.mo +0 -0
  50. holidays/locale/ms_MY/LC_MESSAGES/MY.mo +0 -0
  51. holidays/locale/pt_BR/LC_MESSAGES/BR.mo +0 -0
  52. holidays/locale/pt_TL/LC_MESSAGES/TL.mo +0 -0
  53. holidays/locale/sv/LC_MESSAGES/SE.mo +0 -0
  54. holidays/locale/tet/LC_MESSAGES/TL.mo +0 -0
  55. holidays/locale/th/LC_MESSAGES/AU.mo +0 -0
  56. holidays/locale/th/LC_MESSAGES/MY.mo +0 -0
  57. holidays/locale/th/LC_MESSAGES/SE.mo +0 -0
  58. holidays/locale/th/LC_MESSAGES/TL.mo +0 -0
  59. holidays/locale/th/LC_MESSAGES/US.mo +0 -0
  60. holidays/locale/uk/LC_MESSAGES/BR.mo +0 -0
  61. holidays/locale/uk/LC_MESSAGES/SE.mo +0 -0
  62. holidays/locale/uk/LC_MESSAGES/VE.mo +0 -0
  63. holidays/registry.py +1 -0
  64. holidays/utils.py +52 -0
  65. holidays/version.py +3 -1
  66. {holidays-0.87.dist-info → holidays-0.89.dist-info}/METADATA +18 -18
  67. {holidays-0.87.dist-info → holidays-0.89.dist-info}/RECORD +71 -65
  68. {holidays-0.87.dist-info → holidays-0.89.dist-info}/licenses/CONTRIBUTORS +7 -0
  69. {holidays-0.87.dist-info → holidays-0.89.dist-info}/WHEEL +0 -0
  70. {holidays-0.87.dist-info → holidays-0.89.dist-info}/licenses/LICENSE +0 -0
  71. {holidays-0.87.dist-info → holidays-0.89.dist-info}/top_level.txt +0 -0
@@ -10,6 +10,7 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from holidays.constants import PUBLIC, UNOFFICIAL
13
14
  from holidays.countries.united_states import UnitedStates
14
15
  from holidays.mixins.child_entity import ChildEntity
15
16
 
@@ -25,6 +26,7 @@ class UnitedStatesMinorOutlyingIslands(ChildEntity, UnitedStates):
25
26
  parent_entity = UnitedStates
26
27
  # The first islands were claimed via Guano Islands Act on August 18th, 1856.
27
28
  start_year = 1857
29
+ supported_categories = (PUBLIC, UNOFFICIAL)
28
30
 
29
31
 
30
32
  class HolidaysUM(UnitedStatesMinorOutlyingIslands):
@@ -10,6 +10,7 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from holidays.constants import PUBLIC, UNOFFICIAL
13
14
  from holidays.countries.united_states import UnitedStates
14
15
  from holidays.mixins.child_entity import ChildEntity
15
16
 
@@ -25,6 +26,7 @@ class UnitedStatesVirginIslands(ChildEntity, UnitedStates):
25
26
  parent_entity = UnitedStates
26
27
  # Became a U.S. Territory since March 31st, 1917.
27
28
  start_year = 1918
29
+ supported_categories = (PUBLIC, UNOFFICIAL)
28
30
 
29
31
 
30
32
  class HolidaysVI(UnitedStatesVirginIslands):
@@ -144,6 +144,7 @@ class UzbekistanStaticHolidays:
144
144
  * [2023](https://web.archive.org/web/20250522053822/https://lex.uz/docs/-6324664)
145
145
  * [2024](https://web.archive.org/web/20250522053835/https://lex.uz/docs/-6704048)
146
146
  * [2025](https://web.archive.org/web/20250422135040/https://lex.uz/docs/-7275687)
147
+ * [2025-2026](https://web.archive.org/web/20251227000438/https://lex.uz/docs/-7938920)
147
148
  """
148
149
 
149
150
  # Date format (see strftime() Format Codes)
@@ -220,5 +221,15 @@ class UzbekistanStaticHolidays:
220
221
  (DEC, 30, DEC, 14),
221
222
  (DEC, 31, additional_day_off),
222
223
  ),
223
- 2025: (JAN, 2, JAN, 4),
224
+ 2025: (
225
+ (JAN, 2, JAN, 4),
226
+ (DEC, 31, additional_day_off),
227
+ ),
228
+ 2026: (
229
+ (JAN, 2, additional_day_off),
230
+ (MAY, 28, additional_day_off),
231
+ (MAY, 29, additional_day_off),
232
+ (AUG, 31, additional_day_off),
233
+ (DEC, 31, DEC, 12),
234
+ ),
224
235
  }
@@ -12,41 +12,48 @@
12
12
 
13
13
  from gettext import gettext as tr
14
14
 
15
- from holidays.groups import ChristianHolidays, InternationalHolidays
15
+ from holidays.calendars.gregorian import FEB, MAR, APR, MAY, AUG, OCT, DEC, SUN
16
+ from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
16
17
  from holidays.holiday_base import HolidayBase
17
18
 
18
19
 
19
- class Venezuela(HolidayBase, ChristianHolidays, InternationalHolidays):
20
+ class Venezuela(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
20
21
  """Venezuela holidays.
21
22
 
22
23
  References:
23
24
  * <https://web.archive.org/web/20250317124608/https://dias-festivos.eu/dias-festivos/venezuela/>
25
+ * <https://web.archive.org/web/20260104061304/https://ecoportal50a.tripod.com/directur-fiestas.htm>
24
26
  * [1909 Aug 5](https://web.archive.org/web/20241012151721/https://www.guao.org/sites/default/files/efemerides/69.Ley%20fiestas%20nacionales%201909.pdf)
25
27
  * [1918 May 19](https://web.archive.org/web/20250429081541/https://www.guao.org/sites/default/files/efemerides/70.%20Ley%20de%20fiestas%20nacionales%201918.pdf)
26
28
  * [1921 Jun 11](https://web.archive.org/web/20241012160001/https://www.guao.org/sites/default/files/efemerides/37.LEYES_Y_DECRETOS_1921_Día_de_la_raza.PDF)
27
- * [1971 Jun 22](https://web.archive.org/web/20240802055637/https://www.ilo.org/dyn/travail/docs/2030/Law%20No.29.541.pdf)
29
+ * [1945 Apr 30](https://web.archive.org/web/20250428122616/https://venezuelaenretrospectiva.wordpress.com/2016/05/01/1o-de-mayo-dia-del-trabajador-venezolano/)
30
+ * [1971 Jun 22](https://web.archive.org/web/20240623070739/https://docs.venezuela.justia.com/federales/leyes/ley-de-fiestas-nacionales.pdf)
28
31
  * [2002 Oct 10](https://web.archive.org/web/20250214140239/https://www.acnur.org/fileadmin/Documentos/BDL/2008/6635.pdf)
29
32
  * [2012 May 7](https://web.archive.org/web/20250418204844/https://oig.cepal.org/sites/default/files/2012_leyorgtrabajo_ven.pdf)
33
+ * [Family Day](https://web.archive.org/web/20240516041705/https://www.globovision.com/nacional/21451/ejecutivo-decreta-feriado-el-15-de-mayo-por-dia-de-la-familia)
30
34
  """
31
35
 
32
36
  country = "VE"
33
37
  default_language = "es"
34
38
  supported_languages = ("en_US", "es", "uk")
35
- start_year = 1801
39
+ # Ley de Fiestas Nacionales de 5 de agosto de 1909.
40
+ start_year = 1910
41
+ weekend = {SUN}
36
42
 
37
43
  def __init__(self, *args, **kwargs) -> None:
38
44
  ChristianHolidays.__init__(self)
39
45
  InternationalHolidays.__init__(self)
46
+ StaticHolidays.__init__(self, VenezuelaStaticHolidays)
40
47
  super().__init__(*args, **kwargs)
41
48
 
42
49
  def _populate_public_holidays(self):
43
50
  # New Year's Day.
44
51
  self._add_new_years_day(tr("Año Nuevo"))
45
52
 
46
- # Monday of Carnival.
53
+ # Carnival Monday.
47
54
  self._add_carnival_monday(tr("Lunes de Carnaval"))
48
55
 
49
- # Tuesday of Carnival.
56
+ # Carnival Tuesday.
50
57
  self._add_carnival_tuesday(tr("Martes de Carnaval"))
51
58
 
52
59
  # Maundy Thursday.
@@ -55,30 +62,36 @@ class Venezuela(HolidayBase, ChristianHolidays, InternationalHolidays):
55
62
  # Good Friday.
56
63
  self._add_good_friday(tr("Viernes Santo"))
57
64
 
58
- # Note: not sure about the start year, but this event happened in 1811
59
- if self._year >= 1811:
60
- # Declaration of Independence.
61
- self._add_holiday_apr_19(tr("Declaración de la Independencia"))
65
+ # Declaration of Independence.
66
+ self._add_holiday_apr_19(tr("Declaración de la Independencia"))
62
67
 
63
- # https://web.archive.org/web/20250428122616/https://venezuelaenretrospectiva.wordpress.com/2016/05/01/1o-de-mayo-dia-del-trabajador-venezolano/
64
- if self._year >= 1946:
68
+ # Added via Decreto 113 de 30 de abril de 1945.
69
+ if self._year >= 1945:
65
70
  # International Worker's Day.
66
71
  self._add_labor_day(tr("Dia Mundial del Trabajador"))
67
72
 
68
- # Note: not sure about the start year, but this event happened in 1824
69
- if self._year >= 1971 or 1824 <= self._year <= 1917:
73
+ # Added in 2024, confirmed to be observed in 2025.
74
+ if self._year >= 2024:
75
+ # Family Day.
76
+ self._add_holiday_may_15(tr("Día de la Familia"))
77
+
78
+ # Added via via Ley de Fiestas Nacionales de 5 de agosto de 1909.
79
+ # Removed via Ley de Fiestas Nacionales de 19 de mayo de 1918.
80
+ # Readded via Ley de Fiestas Nacionales de 22 de junio de 1971.
81
+ if self._year <= 1917 or self._year >= 1971:
70
82
  # Battle of Carabobo.
71
83
  self._add_holiday_jun_24(tr("Batalla de Carabobo"))
72
84
 
73
- # Note: not sure about the start year, but this event happened in 1811
74
- if self._year >= 1811:
75
- # Independence Day.
76
- self._add_holiday_jul_5(tr("Día de la Independencia"))
85
+ # Independence Day.
86
+ self._add_holiday_jul_5(tr("Día de la Independencia"))
77
87
 
88
+ # Added via Ley de Fiestas Nacionales de 19 de mayo de 1918.
78
89
  if self._year >= 1918:
79
90
  # Birthday of Simon Bolivar.
80
91
  self._add_holiday_jul_24(tr("Natalicio de Simón Bolívar"))
81
92
 
93
+ # Added via Ley de Fiestas Nacionales de 11 de junio de 1921.
94
+ # Name changed via Decreto N° 2.028, 10 de octubre de 2002.
82
95
  if self._year >= 1921:
83
96
  self._add_columbus_day(
84
97
  # Day of Indigenous Resistance.
@@ -88,11 +101,11 @@ class Venezuela(HolidayBase, ChristianHolidays, InternationalHolidays):
88
101
  else tr("Día de la Raza")
89
102
  )
90
103
 
91
- # Note: not sure about the start year nor the reason this was
92
- # Note: celebrated; the historical records are unclear
93
- if 1909 <= self._year <= 1917:
94
- # Unknown Holiday.
95
- self._add_holiday_oct_28(tr("Día Festivo Desconocido"))
104
+ # Added via Ley de Fiestas Nacionales de 5 de agosto de 1909.
105
+ # Removed via Ley de Fiestas Nacionales de 19 de mayo de 1918.
106
+ if self._year <= 1917:
107
+ # Feast of Saint Simon the Zealot.
108
+ self._add_holiday_oct_28(tr("Fiesta de San Simón Apóstol"))
96
109
 
97
110
  # Christmas Eve.
98
111
  self._add_christmas_eve(tr("Nochebuena"))
@@ -110,3 +123,80 @@ class VE(Venezuela):
110
123
 
111
124
  class VEN(Venezuela):
112
125
  pass
126
+
127
+
128
+ class VenezuelaStaticHolidays:
129
+ """Venezuela special holidays.
130
+
131
+ References:
132
+ * [February 2nd, 2009](https://web.archive.org/web/20260104075141/https://venezuelanalysis.com/news/4164/)
133
+ * [March 29th-31st, 2010](https://web.archive.org/web/20241013111835/https://accesoalajusticia.org/wp-content/uploads/2017/08/SPA-N%C2%BA-869-01-08-2017.pdf)
134
+ * [December 8th, 2013](https://web.archive.org/web/20230129224800/https://www.bbc.com/mundo/ultimas_noticias/2013/11/131105_ultnot_venezuela_dia_lealtad_chavez)
135
+ * [February 27th-28th, 2014](https://web.archive.org/web/20201111233441/https://www.economist.com/the-americas/2014/03/01/towards-the-brink)
136
+ * [March 21st-23rd, 2016](https://web.archive.org/web/20250803061045/https://kpmg.com/ve/es/home/insights/2016/03/sintesis-legal--11-2016.html)
137
+ * [All Fridays in April & May, 2016](https://web.archive.org/web/20260104055041/https://www.abs-cbn.com/world/v1/04/08/16/venezuela-decrees-fridays-a-holiday-to-ease-energy-crisis)
138
+ * [April 18th, 2016](https://web.archive.org/web/20160422035408/https://www.arabnews.com/world/news/910856)
139
+ * [April 10th-12th, 2017](https://web.archive.org/web/20260104080641/https://interjuris.com/dias-no-laborables-sector-publico/)
140
+ * [August 20th, 2018](https://web.archive.org/web/20260104074101/https://www.afaca.com.ve/wp-content/uploads/2018/08/Gaceta-oficial-iva-a-16.pdf)
141
+ * [February 28th-March 1st, 2019](https://web.archive.org/web/20260104073806/https://interjuris.com/non-working-days/)
142
+ * [March 11th-12th, 2019](https://web.archive.org/web/20260104065639/https://www.aa.com.tr/en/energy/electricity/venezuela-extends-public-holiday-over-power-outage/23799)
143
+ * [March 26th, 2019](https://web.archive.org/web/20260104065935/https://www.latimes.com/espanol/noticas-mas/articulo/2019-03-26/efe-3935909-15268311-20190326)
144
+ * [October 19th-20th, 2025](https://web.archive.org/web/20260104073119/https://finanzasdigital.com/gaceta-oficial-6933-dias-no-laborables-19-20-octubre-2025/)
145
+ """
146
+
147
+ # National Holidays.
148
+ national_holidays = tr("Fiesta Nacional")
149
+
150
+ # Canonization of José Gregorio Hernández and Mother Carmen Rendiles.
151
+ canonization = tr("Canonización de José Gregorio Hernández y la Madre Carmen Rendiles")
152
+
153
+ special_public_holidays = {
154
+ # 10th Anniversary of the Bolivarian Revolution.
155
+ 2009: (FEB, 2, tr("10.º aniversario de la Revolución Bolivariana")),
156
+ 2010: (
157
+ (MAR, 29, national_holidays),
158
+ (MAR, 30, national_holidays),
159
+ (MAR, 31, national_holidays),
160
+ ),
161
+ 2013: (
162
+ DEC,
163
+ 8,
164
+ # Day of Loyalty and Love for Supreme Commander Hugo Chávez and the Fatherland.
165
+ tr("Día de la Lealtad y el Amor al Comandante Supremo Hugo Chávez y a la Patria"),
166
+ ),
167
+ 2014: (
168
+ (FEB, 27, national_holidays),
169
+ (FEB, 28, national_holidays),
170
+ ),
171
+ 2016: (
172
+ (MAR, 21, national_holidays),
173
+ (MAR, 22, national_holidays),
174
+ (MAR, 23, national_holidays),
175
+ (APR, 8, national_holidays),
176
+ (APR, 15, national_holidays),
177
+ (APR, 18, national_holidays),
178
+ (APR, 22, national_holidays),
179
+ (APR, 29, national_holidays),
180
+ (MAY, 6, national_holidays),
181
+ (MAY, 13, national_holidays),
182
+ (MAY, 20, national_holidays),
183
+ (MAY, 27, national_holidays),
184
+ ),
185
+ 2017: (
186
+ (APR, 10, national_holidays),
187
+ (APR, 11, national_holidays),
188
+ (APR, 12, national_holidays),
189
+ ),
190
+ 2018: (AUG, 20, national_holidays),
191
+ 2019: (
192
+ (FEB, 28, national_holidays),
193
+ (MAR, 1, national_holidays),
194
+ (MAR, 11, national_holidays),
195
+ (MAR, 12, national_holidays),
196
+ (MAR, 26, national_holidays),
197
+ ),
198
+ 2025: (
199
+ (OCT, 19, canonization),
200
+ (OCT, 20, canonization),
201
+ ),
202
+ }
@@ -10,6 +10,7 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from holidays.financial.bombay_stock_exchange import BombayStockExchange, XBOM, BSE
13
14
  from holidays.financial.brasil_bolsa_balcao import BrasilBolsaBalcao, BVMF, B3
14
15
  from holidays.financial.european_central_bank import EuropeanCentralBank, XECB, ECB, TAR
15
16
  from holidays.financial.ice_futures_europe import IceFuturesEurope, ICEFuturesEurope, IFEU
@@ -0,0 +1,33 @@
1
+ # 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: Vacanza Team and individual contributors (see CONTRIBUTORS file)
8
+ # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
9
+ # ryanss <ryanssdev@icloud.com> (c) 2014-2017
10
+ # Website: https://github.com/vacanza/holidays
11
+ # License: MIT (see LICENSE file)
12
+
13
+ from holidays.financial.national_stock_exchange_of_india import NationalStockExchangeOfIndia
14
+
15
+
16
+ class BombayStockExchange(NationalStockExchangeOfIndia):
17
+ """Bombay Stock Exchange (BSE) holidays.
18
+
19
+ References:
20
+ * <https://web.archive.org/web/20251226065205/https://www.bseindia.com/static/markets/marketinfo/listholi.aspx>
21
+ """
22
+
23
+ market = "XBOM"
24
+ parent_entity = NationalStockExchangeOfIndia
25
+ start_year = 2001
26
+
27
+
28
+ class XBOM(BombayStockExchange):
29
+ pass
30
+
31
+
32
+ class BSE(BombayStockExchange):
33
+ pass
@@ -63,7 +63,7 @@ class NationalStockExchangeOfIndia(
63
63
  default_language = "en_IN"
64
64
  # %s (estimated).
65
65
  estimated_label = tr("%s (estimated)")
66
- supported_languages = ("en_IN", "en_US", "hi")
66
+ supported_languages = ("en_IN", "en_US", "gu", "hi")
67
67
  start_year = 2001
68
68
 
69
69
  def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
holidays/holiday_base.py CHANGED
@@ -775,7 +775,8 @@ class HolidayBase(dict[date, str]):
775
775
  if parent_entity := self.parent_entity:
776
776
  entity_translation.add_fallback(
777
777
  translation(
778
- parent_entity.country or parent_entity.market,
778
+ getattr(parent_entity, "country", None)
779
+ or getattr(parent_entity, "market", None), # type: ignore[arg-type]
779
780
  fallback=fallback,
780
781
  languages=languages,
781
782
  localedir=locale_directory,
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/registry.py CHANGED
@@ -285,6 +285,7 @@ COUNTRIES: RegistryDict = {
285
285
  }
286
286
 
287
287
  FINANCIAL: RegistryDict = {
288
+ "bombay_stock_exchange": ("BombayStockExchange", "XBOM", "BSE"),
288
289
  "brasil_bolsa_balcao": ("BrasilBolsaBalcao", "BVMF", "B3"),
289
290
  "european_central_bank": ("EuropeanCentralBank", "XECB", "ECB", "TAR"),
290
291
  "ice_futures_europe": ("IceFuturesEurope", "IFEU", "ICEFuturesEurope"),
holidays/utils.py CHANGED
@@ -16,14 +16,17 @@ __all__ = (
16
16
  "financial_holidays",
17
17
  "list_localized_countries",
18
18
  "list_localized_financial",
19
+ "list_long_breaks",
19
20
  "list_supported_countries",
20
21
  "list_supported_financial",
21
22
  )
22
23
 
23
24
  import warnings
24
25
  from collections.abc import Iterable
26
+ from datetime import date
25
27
  from functools import cache
26
28
 
29
+ from holidays.calendars.gregorian import _timedelta
27
30
  from holidays.holiday_base import CategoryArg, HolidayBase
28
31
  from holidays.registry import EntityLoader
29
32
 
@@ -443,3 +446,52 @@ def list_supported_financial(include_aliases: bool = True) -> dict[str, list[str
443
446
  subdivision codes.
444
447
  """
445
448
  return _list_supported_entities(EntityLoader.get_financial_codes(include_aliases))
449
+
450
+
451
+ def list_long_breaks(
452
+ instance: HolidayBase, *, minimum_break_length: int = 3, require_weekend_overlap: bool = True
453
+ ) -> list[list[date]]:
454
+ """Get consecutive holidays.
455
+
456
+ Args:
457
+ instance:
458
+ HolidayBase object containing holidays data.
459
+
460
+ minimum_break_length:
461
+ The minimum number of consecutive holidays required for a break period
462
+ to be considered a long one. Defaults to 3.
463
+
464
+ require_weekend_overlap:
465
+ Whether to include only consecutive holidays that overlap with a weekend.
466
+ Defaults to True.
467
+
468
+ Returns:
469
+ A list of consecutive holidays longer than or equal to the specified minimum length.
470
+ """
471
+ long_breaks = []
472
+ seen_dates = set()
473
+
474
+ for dt in sorted(instance.keys()):
475
+ if dt in seen_dates:
476
+ continue
477
+
478
+ previous_working_day = instance.get_nth_working_day(dt, -1)
479
+ next_working_day = instance.get_nth_working_day(dt, +1)
480
+ long_break_length = (next_working_day - previous_working_day).days - 1
481
+
482
+ if long_break_length < minimum_break_length:
483
+ continue
484
+
485
+ is_long_break = not require_weekend_overlap
486
+ long_break_dates = []
487
+ for delta_days in range(1, long_break_length + 1):
488
+ holiday = _timedelta(previous_working_day, delta_days)
489
+ if not is_long_break and instance._is_weekend(holiday):
490
+ is_long_break = True
491
+ long_break_dates.append(holiday)
492
+ seen_dates.add(holiday)
493
+
494
+ if is_long_break:
495
+ long_breaks.append(long_break_dates)
496
+
497
+ return long_breaks
holidays/version.py CHANGED
@@ -10,4 +10,6 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- __version__ = "0.87"
13
+ from importlib.metadata import version
14
+
15
+ __version__ = version("holidays")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: holidays
3
- Version: 0.87
3
+ Version: 0.89
4
4
  Summary: Open World Holidays Framework
5
5
  Author: Vacanza Team
6
6
  Maintainer: Arkadii Yakovets, Panpakorn Siripanich, Serhii Murza
@@ -210,7 +210,7 @@ any) in brackets, available languages and additional holiday categories. All cou
210
210
  <td>AS</td>
211
211
  <td>Can also be loaded as country US, subdivision AS</td>
212
212
  <td><strong>en_US</strong>, th</td>
213
- <td>GOVERNMENT, UNOFFICIAL</td>
213
+ <td>UNOFFICIAL</td>
214
214
  </tr>
215
215
  <tr>
216
216
  <td>Andorra</td>
@@ -397,7 +397,7 @@ any) in brackets, available languages and additional holiday categories. All cou
397
397
  <tr>
398
398
  <td>Brazil</td>
399
399
  <td>BR</td>
400
- <td>States: AC (Acre), AL (Alagoas), AM (Amazonas), AP (Amapá), BA (Bahia), CE (Ceará), DF (Distrito Federal), ES (Espírito Santo), GO (Goiás), MA (Maranhão), MG (Minas Gerais), MS (Mato Grosso do Sul), MT (Mato Grosso), PA (Pará), PB (Paraíba), PE (Pernambuco), PI (Piauí), PR (Paraná), RJ (Rio de Janeiro), RN (Rio Grande do Norte), RO (Rondônia), RR (Roraima), RS (Rio Grande do Sul), SC (Santa Catarina), SE (Sergipe), SP (São Paulo), TO (Tocantins)</td>
400
+ <td>States: AC (Acre), AL (Alagoas), AM (Amazonas), AP (Amapá), BA (Bahia), CE (Ceará), DF (Distrito Federal), ES (Espírito Santo), GO (Goiás), MA (Maranhão), MG (Minas Gerais), MS (Mato Grosso do Sul), MT (Mato Grosso), PA (Pará), PB (Paraíba), PE (Pernambuco), PI (Piauí), PR (Paraná), RJ (Rio de Janeiro), RN (Rio Grande do Norte), RO (Rondônia), RR (Roraima), RS (Rio Grande do Sul), SC (Santa Catarina), SE (Sergipe), SP (São Paulo), TO (Tocantins); cities: São Paulo Capital</td>
401
401
  <td>en_US, <strong>pt_BR</strong>, uk</td>
402
402
  <td>OPTIONAL</td>
403
403
  </tr>
@@ -812,7 +812,7 @@ any) in brackets, available languages and additional holiday categories. All cou
812
812
  <td>GU</td>
813
813
  <td>Can also be loaded as country US, subdivision GU</td>
814
814
  <td><strong>en_US</strong>, th</td>
815
- <td>GOVERNMENT, UNOFFICIAL</td>
815
+ <td>UNOFFICIAL</td>
816
816
  </tr>
817
817
  <tr>
818
818
  <td>Guatemala</td>
@@ -1316,7 +1316,7 @@ any) in brackets, available languages and additional holiday categories. All cou
1316
1316
  <td>MP</td>
1317
1317
  <td>Can also be loaded as country US, subdivision MP</td>
1318
1318
  <td><strong>en_US</strong>, th</td>
1319
- <td>GOVERNMENT, UNOFFICIAL</td>
1319
+ <td>UNOFFICIAL</td>
1320
1320
  </tr>
1321
1321
  <tr>
1322
1322
  <td>North Korea</td>
@@ -1428,7 +1428,7 @@ any) in brackets, available languages and additional holiday categories. All cou
1428
1428
  <td>PR</td>
1429
1429
  <td>Can also be loaded as country US, subdivision PR</td>
1430
1430
  <td><strong>en_US</strong>, th</td>
1431
- <td>GOVERNMENT, UNOFFICIAL</td>
1431
+ <td>HALF_DAY, UNOFFICIAL</td>
1432
1432
  </tr>
1433
1433
  <tr>
1434
1434
  <td>Qatar</td>
@@ -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>BANK, OPTIONAL</td>
1683
+ <td>BANK, DE_FACTO, OPTIONAL</td>
1684
1684
  </tr>
1685
1685
  <tr>
1686
1686
  <td>Switzerland</td>
@@ -1827,21 +1827,14 @@ any) in brackets, available languages and additional holiday categories. All cou
1827
1827
  <td>UM</td>
1828
1828
  <td>Can also be loaded as country US, subdivision UM</td>
1829
1829
  <td><strong>en_US</strong>, th</td>
1830
- <td>GOVERNMENT, UNOFFICIAL</td>
1830
+ <td>UNOFFICIAL</td>
1831
1831
  </tr>
1832
1832
  <tr>
1833
1833
  <td>United States of America (the)</td>
1834
1834
  <td>US</td>
1835
1835
  <td>States and territories: AK (Alaska), AL (Alabama), AR (Arkansas), AS (American Samoa), AZ (Arizona), CA (California), CO (Colorado), CT (Connecticut), DC (District of Columbia), DE (Delaware), FL (Florida), GA (Georgia), GU (Guam), HI (Hawaii), IA (Iowa), ID (Idaho), IL (Illinois), IN (Indiana), KS (Kansas), KY (Kentucky), LA (Louisiana), MA (Massachusetts), MD (Maryland), ME (Maine), MI (Michigan), MN (Minnesota), MO (Missouri), MP (Northern Mariana Islands), MS (Mississippi), MT (Montana), NC (North Carolina), ND (North Dakota), NE (Nebraska), NH (New Hampshire), NJ (New Jersey), NM (New Mexico), NV (Nevada), NY (New York), OH (Ohio), OK (Oklahoma), OR (Oregon), PA (Pennsylvania), PR (Puerto Rico), RI (Rhode Island), SC (South Carolina), SD (South Dakota), TN (Tennessee), TX (Texas), UM (United States Minor Outlying Islands), UT (Utah), VA (Virginia), VI (Virgin Islands, U.S.), VT (Vermont), WA (Washington), WI (Wisconsin), WV (West Virginia), WY (Wyoming)</td>
1836
1836
  <td><strong>en_US</strong>, th</td>
1837
- <td>GOVERNMENT, UNOFFICIAL</td>
1838
- </tr>
1839
- <tr>
1840
- <td>United States Virgin Islands (the)</td>
1841
- <td></td>
1842
- <td>See Virgin Islands (U.S.)</td>
1843
- <td></td>
1844
- <td>GOVERNMENT, UNOFFICIAL</td>
1837
+ <td>GOVERNMENT, HALF_DAY, UNOFFICIAL</td>
1845
1838
  </tr>
1846
1839
  <tr>
1847
1840
  <td>Uruguay</td>
@@ -1890,7 +1883,7 @@ any) in brackets, available languages and additional holiday categories. All cou
1890
1883
  <td>VI</td>
1891
1884
  <td>Can also be loaded as country US, subdivision VI</td>
1892
1885
  <td><strong>en_US</strong>, th</td>
1893
- <td>GOVERNMENT, UNOFFICIAL</td>
1886
+ <td>UNOFFICIAL</td>
1894
1887
  </tr>
1895
1888
  <tr>
1896
1889
  <td>Wallis and Futuna</td>
@@ -1955,6 +1948,13 @@ code when available. The following financial markets are available:
1955
1948
  </thead>
1956
1949
  <tbody>
1957
1950
  <tr>
1951
+ <td>Bombay Stock Exchange</td>
1952
+ <td>XBOM</td>
1953
+ <td>Bombay Stock Exchange (BSE) market holidays</td>
1954
+ <td><strong>en_IN</strong>, en_US, gu, hi</td>
1955
+ <td></td>
1956
+ </tr>
1957
+ <tr>
1958
1958
  <td>Brasil, Bolsa, Balcão</td>
1959
1959
  <td>BVMF</td>
1960
1960
  <td>Brazil Stock Exchange and Over-the-Counter Market holidays (same as ANBIMA holidays)</td>
@@ -1979,7 +1979,7 @@ code when available. The following financial markets are available:
1979
1979
  <td>National Stock Exchange of India</td>
1980
1980
  <td>XNSE</td>
1981
1981
  <td>National Stock Exchange of India market holidays</td>
1982
- <td><strong>en_IN</strong>, en_US, hi</td>
1982
+ <td><strong>en_IN</strong>, en_US, gu, hi</td>
1983
1983
  <td></td>
1984
1984
  </tr>
1985
1985
  <tr>