holidays 0.63__py3-none-any.whl → 0.65__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/calendars/hebrew.py +32 -3
  2. holidays/constants.py +1 -0
  3. holidays/countries/__init__.py +1 -0
  4. holidays/countries/afghanistan.py +192 -0
  5. holidays/countries/azerbaijan.py +2 -2
  6. holidays/countries/belarus.py +93 -14
  7. holidays/countries/el_salvador.py +45 -24
  8. holidays/countries/iran.py +3 -0
  9. holidays/countries/israel.py +55 -80
  10. holidays/countries/kazakhstan.py +2 -2
  11. holidays/countries/lithuania.py +1 -4
  12. holidays/countries/montenegro.py +143 -27
  13. holidays/countries/norway.py +1 -1
  14. holidays/countries/poland.py +9 -1
  15. holidays/countries/russia.py +1 -1
  16. holidays/countries/south_korea.py +2 -0
  17. holidays/countries/thailand.py +1 -2
  18. holidays/countries/ukraine.py +19 -10
  19. holidays/financial/ny_stock_exchange.py +81 -44
  20. holidays/groups/__init__.py +1 -0
  21. holidays/groups/christian.py +2 -0
  22. holidays/groups/custom.py +12 -0
  23. holidays/groups/hebrew.py +151 -0
  24. holidays/groups/persian.py +11 -0
  25. holidays/holiday_base.py +15 -8
  26. holidays/locale/be/LC_MESSAGES/BY.mo +0 -0
  27. holidays/locale/be/LC_MESSAGES/BY.po +53 -17
  28. holidays/locale/cnr/LC_MESSAGES/ME.mo +0 -0
  29. holidays/locale/cnr/LC_MESSAGES/ME.po +102 -0
  30. holidays/locale/en_US/LC_MESSAGES/AF.mo +0 -0
  31. holidays/locale/en_US/LC_MESSAGES/AF.po +92 -0
  32. holidays/locale/en_US/LC_MESSAGES/BY.mo +0 -0
  33. holidays/locale/en_US/LC_MESSAGES/BY.po +61 -20
  34. holidays/locale/en_US/LC_MESSAGES/ME.mo +0 -0
  35. holidays/locale/en_US/LC_MESSAGES/ME.po +102 -0
  36. holidays/locale/en_US/LC_MESSAGES/PL.mo +0 -0
  37. holidays/locale/en_US/LC_MESSAGES/PL.po +7 -5
  38. holidays/locale/en_US/LC_MESSAGES/SV.mo +0 -0
  39. holidays/locale/en_US/LC_MESSAGES/SV.po +75 -0
  40. holidays/locale/es/LC_MESSAGES/SV.mo +0 -0
  41. holidays/locale/es/LC_MESSAGES/SV.po +75 -0
  42. holidays/locale/fa_AF/LC_MESSAGES/AF.mo +0 -0
  43. holidays/locale/fa_AF/LC_MESSAGES/AF.po +92 -0
  44. holidays/locale/pl/LC_MESSAGES/PL.mo +0 -0
  45. holidays/locale/pl/LC_MESSAGES/PL.po +8 -4
  46. holidays/locale/ps_AF/LC_MESSAGES/AF.mo +0 -0
  47. holidays/locale/ps_AF/LC_MESSAGES/AF.po +92 -0
  48. holidays/locale/ru/LC_MESSAGES/BY.mo +0 -0
  49. holidays/locale/ru/LC_MESSAGES/BY.po +111 -0
  50. holidays/locale/th/LC_MESSAGES/BY.mo +0 -0
  51. holidays/locale/th/LC_MESSAGES/BY.po +109 -0
  52. holidays/locale/th/LC_MESSAGES/NO.mo +0 -0
  53. holidays/locale/th/LC_MESSAGES/NO.po +80 -0
  54. holidays/locale/th/LC_MESSAGES/RU.mo +0 -0
  55. holidays/locale/th/LC_MESSAGES/RU.po +90 -0
  56. holidays/locale/th/LC_MESSAGES/UA.mo +0 -0
  57. holidays/locale/th/LC_MESSAGES/UA.po +114 -0
  58. holidays/locale/uk/LC_MESSAGES/ME.mo +0 -0
  59. holidays/locale/uk/LC_MESSAGES/ME.po +102 -0
  60. holidays/locale/uk/LC_MESSAGES/PL.mo +0 -0
  61. holidays/locale/uk/LC_MESSAGES/PL.po +7 -5
  62. holidays/locale/uk/LC_MESSAGES/SV.mo +0 -0
  63. holidays/locale/uk/LC_MESSAGES/SV.po +75 -0
  64. holidays/registry.py +1 -0
  65. holidays/version.py +1 -1
  66. {holidays-0.63.dist-info → holidays-0.65.dist-info}/AUTHORS +1 -0
  67. {holidays-0.63.dist-info → holidays-0.65.dist-info}/METADATA +17 -12
  68. {holidays-0.63.dist-info → holidays-0.65.dist-info}/RECORD +71 -41
  69. {holidays-0.63.dist-info → holidays-0.65.dist-info}/WHEEL +1 -1
  70. {holidays-0.63.dist-info → holidays-0.65.dist-info}/LICENSE +0 -0
  71. {holidays-0.63.dist-info → holidays-0.65.dist-info}/top_level.txt +0 -0
@@ -147,22 +147,58 @@ class NYSE(NewYorkStockExchange):
147
147
 
148
148
 
149
149
  class NewYorkStockExchangeStaticHolidays:
150
+ """
151
+ References:
152
+ - https://guides.loc.gov/presidents-portraits/chronological
153
+ - https://www.presidency.ucsb.edu/documents/proclamation-3561-national-day-mourning-for-president-kennedy
154
+ """
155
+
156
+ # Blizzard of 1888.
157
+ name_blizard_1888 = "Blizzard of 1888"
158
+
159
+ # Centennial of George Washington's Inauguration.
160
+ name_george_washington_centennial = "Centennial of George Washington's Inauguration"
161
+
162
+ # Columbian Celebration.
163
+ name_columbian_celebration = "Columbian Celebration"
164
+
165
+ # Heatless Day.
166
+ name_heatless_day = "Heatless Day"
167
+
168
+ # Catch Up Day.
169
+ name_catch_up_day = "Catch Up Day"
170
+
171
+ # Special Bank Holiday.
172
+ name_special_bank_holiday = "Special Bank Holiday"
173
+
174
+ # V-J Day (WWII).
175
+ name_vj_day_wwii = "V-J Day (WWII)"
176
+
177
+ # Christmas Eve.
178
+ name_christmas_eve = "Christmas Eve"
179
+
180
+ # Closed for Sept 11, 2001 Attacks.
181
+ name_sept11_attacks = "Closed for Sept 11, 2001 Attacks"
182
+
183
+ # Hurricane Sandy.
184
+ name_hurricane_sandy = "Hurricane Sandy"
185
+
150
186
  special_public_holidays = {
151
187
  1888: (
152
- (MAR, 12, "Blizzard of 1888"),
153
- (MAR, 13, "Blizzard of 1888"),
188
+ (MAR, 12, name_blizard_1888),
189
+ (MAR, 13, name_blizard_1888),
154
190
  (NOV, 30, "Thanksgiving Friday 1888"),
155
191
  ),
156
192
  1889: (
157
- (APR, 29, "Centennial of Washington Inauguration"),
158
- (APR, 30, "Centennial of Washington Inauguration"),
159
- (MAY, 1, "Centennial of Washington Inauguration"),
193
+ (APR, 29, name_george_washington_centennial),
194
+ (APR, 30, name_george_washington_centennial),
195
+ (MAY, 1, name_george_washington_centennial),
160
196
  ),
161
197
  1892: (
162
- (OCT, 12, "Columbian Celebration"),
163
- (OCT, 21, "Columbian Celebration"),
198
+ (OCT, 12, name_columbian_celebration),
199
+ (OCT, 21, name_columbian_celebration),
164
200
  ),
165
- 1893: (APR, 27, "Columbian Celebration"),
201
+ 1893: (APR, 27, name_columbian_celebration),
166
202
  1897: (APR, 27, "Grant's Birthday"),
167
203
  1898: (MAY, 4, "Charter Day"),
168
204
  1899: (
@@ -170,17 +206,17 @@ class NewYorkStockExchangeStaticHolidays:
170
206
  (JUL, 3, "Monday before Independence Day"),
171
207
  (SEP, 29, "Admiral Dewey Celebration"),
172
208
  ),
173
- 1900: (DEC, 24, "Christmas Eve"),
209
+ 1900: (DEC, 24, name_christmas_eve),
174
210
  1901: (
175
211
  (JUL, 5, "Friday after Independence Day"),
176
- (SEP, 19, "Funeral of President McKinley"),
212
+ (SEP, 19, "National Day of Mourning for President WIlliam McKinley"),
177
213
  ),
178
214
  1903: (APR, 22, "Opening of new NYSE building"),
179
215
  1917: (JUN, 5, "Draft Registration Day"),
180
216
  1918: (
181
- (JAN, 28, "Heatless Day"),
182
- (FEB, 4, "Heatless Day"),
183
- (FEB, 11, "Heatless Day"),
217
+ (JAN, 28, name_heatless_day),
218
+ (FEB, 4, name_heatless_day),
219
+ (FEB, 11, name_heatless_day),
184
220
  (SEP, 12, "Draft Registration Day"),
185
221
  (NOV, 11, "Armistice Day"),
186
222
  ),
@@ -191,58 +227,59 @@ class NewYorkStockExchangeStaticHolidays:
191
227
  ),
192
228
  1923: (
193
229
  (AUG, 3, "Death of President Warren G. Harding"),
194
- (AUG, 10, "Funeral of President Warren G. Harding"),
230
+ (AUG, 10, "National Day of Mourning for President Warren G. Harding"),
195
231
  ),
196
232
  1927: (JUN, 13, "Parade for Colonel Charles Lindbergh"),
197
233
  1929: (
198
- (NOV, 1, "Catch Up Day"),
199
- (NOV, 29, "Catch Up Day"),
234
+ (NOV, 1, name_catch_up_day),
235
+ (NOV, 29, name_catch_up_day),
200
236
  ),
201
237
  1933: (
202
- (MAR, 6, "Special Bank Holiday"),
203
- (MAR, 7, "Special Bank Holiday"),
204
- (MAR, 8, "Special Bank Holiday"),
205
- (MAR, 9, "Special Bank Holiday"),
206
- (MAR, 10, "Special Bank Holiday"),
207
- (MAR, 13, "Special Bank Holiday"),
208
- (MAR, 14, "Special Bank Holiday"),
238
+ (MAR, 6, name_special_bank_holiday),
239
+ (MAR, 7, name_special_bank_holiday),
240
+ (MAR, 8, name_special_bank_holiday),
241
+ (MAR, 9, name_special_bank_holiday),
242
+ (MAR, 10, name_special_bank_holiday),
243
+ (MAR, 13, name_special_bank_holiday),
244
+ (MAR, 14, name_special_bank_holiday),
209
245
  ),
210
246
  1945: (
211
- (AUG, 15, "V-J Day (WWII)"),
212
- (AUG, 16, "V-J Day (WWII)"),
213
- (DEC, 24, "Christmas Eve"),
247
+ (AUG, 15, name_vj_day_wwii),
248
+ (AUG, 16, name_vj_day_wwii),
249
+ (DEC, 24, name_christmas_eve),
214
250
  ),
215
- 1954: (DEC, 24, "Christmas Eve"),
216
- 1956: (DEC, 24, "Christmas Eve"),
251
+ 1954: (DEC, 24, name_christmas_eve),
252
+ 1956: (DEC, 24, name_christmas_eve),
217
253
  1958: (DEC, 26, "Day after Christmas"),
218
254
  1961: (MAY, 29, "Day before Decoration Day"),
219
- 1963: (NOV, 25, "Funeral of President John F. Kennedy"),
220
- 1965: (DEC, 24, "Christmas Eve"),
255
+ 1963: (NOV, 25, "National Day of Mourning for President John F. Kennedy"),
256
+ 1965: (DEC, 24, name_christmas_eve),
221
257
  1968: (
222
- (APR, 9, "Day of Mourning for Martin Luther King Jr."),
258
+ (APR, 9, "National Day of Mourning for Martin Luther King Jr."),
223
259
  (JUL, 5, "Day after Independence Day"),
224
260
  ),
225
261
  1969: (
226
262
  (FEB, 10, "Heavy Snow"),
227
- (MAR, 31, "Funeral of President Dwight D. Eisenhower"),
263
+ (MAR, 31, "National Day of Mourning for former President Dwight D. Eisenhower"),
228
264
  (JUL, 21, "National Participation in Lunar Exploration"),
229
265
  ),
230
- 1972: (DEC, 28, "Funeral for President Harry S. Truman"),
231
- 1973: (JAN, 25, "Funeral for President Lyndon B. Johnson"),
266
+ 1972: (DEC, 28, "National Day of Mourning for former President Harry S. Truman"),
267
+ 1973: (JAN, 25, "National Day of Mourning for former President Lyndon B. Johnson"),
232
268
  1977: (JUL, 14, "Blackout in New York City"),
233
269
  1985: (SEP, 27, "Hurricane Gloria"),
234
- 1994: (APR, 27, "Funeral for President Richard M. Nixon"),
270
+ 1994: (APR, 27, "National Day of Mourning for former President Richard M. Nixon"),
235
271
  2001: (
236
- (SEP, 11, "Closed for Sept 11, 2001 Attacks"),
237
- (SEP, 12, "Closed for Sept 11, 2001 Attacks"),
238
- (SEP, 13, "Closed for Sept 11, 2001 Attacks"),
239
- (SEP, 14, "Closed for Sept 11, 2001 Attacks"),
272
+ (SEP, 11, name_sept11_attacks),
273
+ (SEP, 12, name_sept11_attacks),
274
+ (SEP, 13, name_sept11_attacks),
275
+ (SEP, 14, name_sept11_attacks),
240
276
  ),
241
- 2004: (JUN, 11, "Day of Mourning for President Ronald W. Reagan"),
242
- 2007: (JAN, 2, "Day of Mourning for President Gerald R. Ford"),
277
+ 2004: (JUN, 11, "National Day of Mourning for former President Ronald Reagan"),
278
+ 2007: (JAN, 2, "National Day of Mourning for former President Gerald R. Ford"),
243
279
  2012: (
244
- (OCT, 29, "Hurricane Sandy"),
245
- (OCT, 30, "Hurricane Sandy"),
280
+ (OCT, 29, name_hurricane_sandy),
281
+ (OCT, 30, name_hurricane_sandy),
246
282
  ),
247
- 2018: (DEC, 5, "Day of Mourning for President George H.W. Bush"),
283
+ 2018: (DEC, 5, "National Day of Mourning for former President George H. W. Bush"),
284
+ 2025: (JAN, 9, "National Day of Mourning for former President Jimmy Carter"),
248
285
  }
@@ -17,6 +17,7 @@ from holidays.groups.chinese import ChineseCalendarHolidays
17
17
  from holidays.groups.christian import ChristianHolidays
18
18
  from holidays.groups.custom import StaticHolidays
19
19
  from holidays.groups.eastern import EasternCalendarHolidays
20
+ from holidays.groups.hebrew import HebrewCalendarHolidays
20
21
  from holidays.groups.hindu import HinduCalendarHolidays
21
22
  from holidays.groups.international import InternationalHolidays
22
23
  from holidays.groups.islamic import IslamicHolidays
@@ -110,7 +110,9 @@ class ChristianHolidays:
110
110
 
111
111
  All Souls' Day is a day of prayer and remembrance for the faithful
112
112
  departed, observed by certain Christian denominations on 2 November.
113
+ In Belarussian tradition it is called Dziady.
113
114
  https://en.wikipedia.org/wiki/All_Souls%27_Day
115
+ https://en.wikipedia.org/wiki/Dziady
114
116
  """
115
117
  return self._add_holiday_nov_2(name)
116
118
 
holidays/groups/custom.py CHANGED
@@ -10,6 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from datetime import date
14
+
15
+ from holidays.helpers import _normalize_tuple
16
+
13
17
 
14
18
  class StaticHolidays:
15
19
  """Helper class for special and substituted holidays support.
@@ -33,3 +37,11 @@ class StaticHolidays:
33
37
  ):
34
38
  setattr(self, attribute_name, value)
35
39
  self.has_substituted_holidays = True
40
+
41
+ # Populate substituted holidays from adjacent years.
42
+ self.weekend_workdays = set()
43
+ for special_public_holidays in getattr(self, "special_public_holidays", {}).values():
44
+ for special_public_holiday in _normalize_tuple(special_public_holidays):
45
+ if len(special_public_holiday) == 5: # The fifth element is the year.
46
+ _, _, from_month, from_day, from_year = special_public_holiday
47
+ self.weekend_workdays.add(date(from_year, from_month, from_day))
@@ -0,0 +1,151 @@
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 AUTHORS 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 collections.abc import Iterable
14
+ from datetime import date
15
+ from typing import Optional, Union
16
+
17
+ from holidays.calendars import _HebrewLunisolar
18
+ from holidays.calendars.gregorian import _timedelta
19
+
20
+
21
+ class HebrewCalendarHolidays:
22
+ """
23
+ Hebrew lunisolar calendar holidays.
24
+ """
25
+
26
+ def __init__(self) -> None:
27
+ self._hebrew_calendar = _HebrewLunisolar()
28
+
29
+ def _add_hebrew_calendar_holiday(
30
+ self, name: str, hol_date: date, days_delta: Union[int, Iterable[int]] = 0
31
+ ) -> set[date]:
32
+ added_dates = set()
33
+ for delta in (days_delta,) if isinstance(days_delta, int) else days_delta:
34
+ if dt := self._add_holiday(name, _timedelta(hol_date, delta)):
35
+ added_dates.add(dt)
36
+ return added_dates
37
+
38
+ def _add_hanukkah(
39
+ self, name: str, days_delta: Union[int, Iterable[int]] = 0
40
+ ) -> set[Optional[date]]:
41
+ """
42
+ Add Hanukkah.
43
+ In some Gregorian years, there may be two Hanukkah dates.
44
+
45
+ Hanukkah is a Jewish festival commemorating the recovery of Jerusalem
46
+ and subsequent rededication of the Second Temple.
47
+ https://en.wikipedia.org/wiki/Hanukkah
48
+ """
49
+ dts = self._hebrew_calendar.hanukkah_date(self._year)
50
+ for dt in dts:
51
+ self._add_hebrew_calendar_holiday(name, dt, days_delta) # type: ignore[arg-type]
52
+ return dts
53
+
54
+ def _add_lag_baomer(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
55
+ """
56
+ Add Lag BaOmer.
57
+
58
+ Lag BaOmer, also Lag B'Omer or Lag LaOmer, is a Jewish religious holiday celebrated
59
+ on the 33rd day of the Counting of the Omer, which occurs on the 18th day of
60
+ the Hebrew month of Iyar.
61
+ https://en.wikipedia.org/wiki/Lag_BaOmer
62
+ """
63
+ return self._add_hebrew_calendar_holiday(
64
+ name,
65
+ self._hebrew_calendar.lag_baomer_date(self._year), # type: ignore[arg-type]
66
+ days_delta,
67
+ )
68
+
69
+ def _add_passover(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
70
+ """
71
+ Add Passover.
72
+
73
+ Passover, also called Pesach, is a major Jewish holiday and one of the Three Pilgrimage
74
+ Festivals. It celebrates the Exodus of the Israelites from slavery in Egypt.
75
+ https://en.wikipedia.org/wiki/Passover
76
+ """
77
+ return self._add_hebrew_calendar_holiday(
78
+ name,
79
+ self._hebrew_calendar.passover_date(self._year), # type: ignore[arg-type]
80
+ days_delta,
81
+ )
82
+
83
+ def _add_purim(self, name: str) -> set[date]:
84
+ """
85
+ Add Purim.
86
+
87
+ Purim is a Jewish holiday that commemorates the saving of the Jewish people
88
+ from annihilation at the hands of an official of the Achaemenid Empire named Haman,
89
+ as it is recounted in the Book of Esther.
90
+ https://en.wikipedia.org/wiki/Purim
91
+ """
92
+ return self._add_hebrew_calendar_holiday(
93
+ name,
94
+ self._hebrew_calendar.purim_date(self._year), # type: ignore[arg-type]
95
+ )
96
+
97
+ def _add_rosh_hashanah(
98
+ self, name: str, days_delta: Union[int, Iterable[int]] = 0
99
+ ) -> set[date]:
100
+ """
101
+ Add Rosh Hashanah.
102
+
103
+ Rosh Hashanah is the New Year in Judaism.
104
+ https://en.wikipedia.org/wiki/Rosh_Hashanah
105
+ """
106
+ return self._add_hebrew_calendar_holiday(
107
+ name,
108
+ self._hebrew_calendar.rosh_hashanah_date(self._year), # type: ignore[arg-type]
109
+ days_delta,
110
+ )
111
+
112
+ def _add_shavuot(self, name: str) -> set[date]:
113
+ """
114
+ Add Shavuot.
115
+
116
+ Shavuot, or Shvues, is a Jewish holiday, one of the biblically ordained
117
+ Three Pilgrimage Festivals. It occurs on the sixth day of the Hebrew month of Sivan.
118
+ https://en.wikipedia.org/wiki/Shavuot
119
+ """
120
+ return self._add_hebrew_calendar_holiday(
121
+ name,
122
+ self._hebrew_calendar.shavuot_date(self._year), # type: ignore[arg-type]
123
+ )
124
+
125
+ def _add_sukkot(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
126
+ """
127
+ Add Sukkot.
128
+
129
+ Sukkot, also known as the Feast of Tabernacles or Feast of Booths, is a Torah-commanded
130
+ holiday celebrated for seven days, beginning on the 15th day of the month of Tishrei.
131
+ https://en.wikipedia.org/wiki/Sukkot
132
+ """
133
+ return self._add_hebrew_calendar_holiday(
134
+ name,
135
+ self._hebrew_calendar.sukkot_date(self._year), # type: ignore[arg-type]
136
+ days_delta,
137
+ )
138
+
139
+ def _add_yom_kippur(self, name: str, days_delta: Union[int, Iterable[int]] = 0) -> set[date]:
140
+ """
141
+ Add Yom Kippur.
142
+
143
+ Yom Kippur (Day of Atonement) is the holiest day of the year in Judaism.
144
+ It occurs annually on the 10th of Tishrei.
145
+ https://en.wikipedia.org/wiki/Yom_Kippur
146
+ """
147
+ return self._add_hebrew_calendar_holiday(
148
+ name,
149
+ self._hebrew_calendar.yom_kippur_date(self._year), # type: ignore[arg-type]
150
+ days_delta,
151
+ )
@@ -36,6 +36,17 @@ class PersianCalendarHolidays:
36
36
  name, self._persian_calendar.persian_to_gregorian(self._year, 3, 14)
37
37
  )
38
38
 
39
+ def _add_islamic_emirat_victory_day(self, name: str) -> Optional[date]:
40
+ """
41
+ Add Islamic Emirate Victory Day (24th day of the 5th month).
42
+
43
+ Anniversary of the Taliban forces arrival in Kabul.
44
+ https://en.wikipedia.org/wiki/Fall_of_Kabul_(2021)
45
+ """
46
+ return self._add_persian_calendar_holiday(
47
+ name, self._persian_calendar.persian_to_gregorian(self._year, 5, 24)
48
+ )
49
+
39
50
  def _add_islamic_republic_day(self, name: str) -> Optional[date]:
40
51
  """
41
52
  Add Islamic Republic Day (12th day of the 1st month).
holidays/holiday_base.py CHANGED
@@ -233,7 +233,7 @@ class HolidayBase(dict[date, str]):
233
233
  ones."""
234
234
  weekend: set[int] = {SAT, SUN}
235
235
  """Country weekend days."""
236
- weekend_workdays: set[date] = set()
236
+ weekend_workdays: set[date]
237
237
  """Working days moved to weekends."""
238
238
  default_category: str = PUBLIC
239
239
  """The entity category used by default."""
@@ -329,8 +329,7 @@ class HolidayBase(dict[date, str]):
329
329
  # Deprecated arguments.
330
330
  if prov_state := prov or state:
331
331
  warnings.warn(
332
- "Arguments prov and state are deprecated, use "
333
- f"subdiv='{prov_state}' instead.",
332
+ f"Arguments prov and state are deprecated, use subdiv='{prov_state}' instead.",
334
333
  DeprecationWarning,
335
334
  )
336
335
 
@@ -362,7 +361,7 @@ class HolidayBase(dict[date, str]):
362
361
  self.language = language.lower() if language else None
363
362
  self.observed = observed
364
363
  self.subdiv = subdiv
365
- self.weekend_workdays = set()
364
+ self.weekend_workdays = getattr(self, "weekend_workdays", set())
366
365
 
367
366
  supported_languages = set(self.supported_languages)
368
367
  self.tr = (
@@ -585,6 +584,7 @@ class HolidayBase(dict[date, str]):
585
584
 
586
585
  to :class:`datetime.date`, which is how it's stored by the class."""
587
586
 
587
+ dt: Optional[date] = None
588
588
  # Try to catch `date` and `str` type keys first.
589
589
  # Using type() here to skip date subclasses.
590
590
  # Key is `date`.
@@ -593,10 +593,17 @@ class HolidayBase(dict[date, str]):
593
593
 
594
594
  # Key is `str` instance.
595
595
  elif isinstance(key, str):
596
- try:
597
- dt = parse(key).date()
598
- except (OverflowError, ValueError):
599
- raise ValueError(f"Cannot parse date from string '{key}'")
596
+ # key possibly contains a date in YYYY-MM-DD or YYYYMMDD format.
597
+ if len(key) in {8, 10}:
598
+ try:
599
+ dt = date.fromisoformat(key)
600
+ except ValueError:
601
+ pass
602
+ if dt is None:
603
+ try:
604
+ dt = parse(key).date()
605
+ except (OverflowError, ValueError):
606
+ raise ValueError(f"Cannot parse date from string '{key}'")
600
607
 
601
608
  # Key is `datetime` instance.
602
609
  elif isinstance(key, datetime):
Binary file
@@ -14,18 +14,17 @@
14
14
  #
15
15
  msgid ""
16
16
  msgstr ""
17
- "Project-Id-Version: Holidays 0.34\n"
17
+ "Project-Id-Version: Holidays 0.64\n"
18
18
  "POT-Creation-Date: 2023-02-15 20:06-0800\n"
19
- "PO-Revision-Date: 2023-09-27 18:49+0300\n"
20
- "Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
19
+ "PO-Revision-Date: 2024-12-26 19:18+0700\n"
20
+ "Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
21
21
  "Language-Team: Holidays Localization Team\n"
22
22
  "Language: be\n"
23
23
  "MIME-Version: 1.0\n"
24
24
  "Content-Type: text/plain; charset=UTF-8\n"
25
25
  "Content-Transfer-Encoding: 8bit\n"
26
- "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
27
26
  "Generated-By: Lingua 4.15.0\n"
28
- "X-Generator: Poedit 3.2.2\n"
27
+ "X-Generator: Poedit 3.5\n"
29
28
 
30
29
  #. Date format (see strftime() Format Codes)
31
30
  msgid "%d.%m.%Y"
@@ -36,36 +35,73 @@ msgstr ""
36
35
  msgid "Выходны (перанесены з %s)"
37
36
  msgstr ""
38
37
 
38
+ #. Constitution Day.
39
+ msgid "Дзень Канстытуцыі"
40
+ msgstr ""
41
+
42
+ #. Day of Unity of the Peoples of Belarus and Russia.
43
+ msgid "Дзень яднання народаў Беларусі і Расіі"
44
+ msgstr ""
45
+
46
+ #. Victory Day.
47
+ msgid "Дзень Перамогі"
48
+ msgstr ""
49
+
50
+ #. Day of the National Coat of Arms of the Republic of Belarus, the National
51
+ #. Flag of the Republic of
52
+ #. Belarus and the National Anthem of the Republic of Belarus.
53
+ msgid ""
54
+ "Дзень Дзяржаўнага сцяга, Дзяржаўнага герба і Дзяржаўнага гімна Рэспублікі "
55
+ "Беларусь"
56
+ msgstr ""
57
+
58
+ #. Independence Day of the Republic of Belarus (Day of the Republic).
59
+ msgid "Дзень Незалежнасці Рэспублікі Беларусь (Дзень Рэспублікі)"
60
+ msgstr ""
61
+
62
+ #. Day of People's Unity.
63
+ msgid "Дзень народнага адзінства"
64
+ msgstr ""
65
+
39
66
  #. New Year's Day.
40
67
  msgid "Новы год"
41
68
  msgstr ""
42
69
 
43
- #. Orthodox Christmas Day.
44
- msgid "Нараджэнне Хрыстова (праваслаўнае Раство)"
70
+ #. Day of the Fatherland's Defenders and the Armed Forces of the Republic of
71
+ #. Belarus.
72
+ msgid "Дзень абаронцаў Айчыны і Узброеных Сіл Рэспублікі Беларусь"
45
73
  msgstr ""
46
74
 
47
75
  #. Women's Day.
48
76
  msgid "Дзень жанчын"
49
77
  msgstr ""
50
78
 
51
- #. Radunitsa (Day of Rejoicing).
52
- msgid "Радаўніца"
53
- msgstr ""
54
-
55
79
  #. Labor Day.
56
80
  msgid "Свята працы"
57
81
  msgstr ""
58
82
 
59
- #. Victory Day.
60
- msgid "Дзень Перамогі"
83
+ #. October Revolution Day.
84
+ msgid "Дзень Кастрычніцкай рэвалюцыі"
61
85
  msgstr ""
62
86
 
63
- #. Independence Day.
64
- msgid "Дзень Незалежнасці Рэспублікі Беларусь (Дзень Рэспублікі)"
87
+ #. Orthodox Christmas Day.
88
+ msgid "Нараджэнне Хрыстова (праваслаўнае Раство)"
65
89
  msgstr ""
66
90
 
67
- #. October Revolution Day.
68
- msgid "Дзень Кастрычніцкай рэвалюцыі"
91
+ #. Catholic Easter.
92
+ msgid "Каталiцкi Вялiкдзень"
93
+ msgstr ""
94
+
95
+ #. Orthodox Easter.
96
+ msgid "Праваслаўны Вялiкдзень"
97
+ msgstr ""
98
+
99
+ #. Radunitsa (Day of Rejoicing).
100
+ msgid "Радаўніца"
101
+ msgstr ""
102
+
103
+ #. Dzyady (All Souls' Day).
104
+ msgid "Дзень памяці"
69
105
  msgstr ""
70
106
 
71
107
  #. Catholic Christmas Day.
Binary file
@@ -0,0 +1,102 @@
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 AUTHORS 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
+ # Montenegro holidays.
14
+ #
15
+ msgid ""
16
+ msgstr ""
17
+ "Project-Id-Version: Holidays 0.64\n"
18
+ "POT-Creation-Date: 2024-11-09 15:23+0200\n"
19
+ "PO-Revision-Date: 2024-12-24 15:25+0200\n"
20
+ "Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
21
+ "Language-Team: Holidays Localization Team\n"
22
+ "Language: cnr\n"
23
+ "MIME-Version: 1.0\n"
24
+ "Content-Type: text/plain; charset=UTF-8\n"
25
+ "Content-Transfer-Encoding: 8bit\n"
26
+ "Generated-By: Lingva 5.0.4\n"
27
+ "X-Generator: Poedit 3.5\n"
28
+
29
+ #. %s (estimated).
30
+ #, c-format
31
+ msgid "%s (procijenjeno)"
32
+ msgstr ""
33
+
34
+ #. %s (observed).
35
+ #, c-format
36
+ msgid "%s (neradni dan)"
37
+ msgstr ""
38
+
39
+ #. %s (observed, estimated).
40
+ #, c-format
41
+ msgid "%s (neradni dan, procijenjeno)"
42
+ msgstr ""
43
+
44
+ #. New Year's Day.
45
+ msgid "Nova godina"
46
+ msgstr ""
47
+
48
+ #. Labor Day.
49
+ msgid "Praznik rada"
50
+ msgstr ""
51
+
52
+ #. Independence Day.
53
+ msgid "Dan nezavisnosti"
54
+ msgstr ""
55
+
56
+ #. Statehood Day.
57
+ msgid "Dan državnosti"
58
+ msgstr ""
59
+
60
+ #. Njegos Day.
61
+ msgid "Njegošev dan"
62
+ msgstr ""
63
+
64
+ #. Good Friday.
65
+ msgid "Veliki petak"
66
+ msgstr ""
67
+
68
+ #. Easter.
69
+ msgid "Uskrs"
70
+ msgstr ""
71
+
72
+ #. All Saints' Day.
73
+ msgid "Svi Sveti"
74
+ msgstr ""
75
+
76
+ #. Christmas Eve.
77
+ msgid "Badnji dan"
78
+ msgstr ""
79
+
80
+ #. Christmas.
81
+ msgid "Božić"
82
+ msgstr ""
83
+
84
+ #. Pesach.
85
+ msgid "Pasha"
86
+ msgstr ""
87
+
88
+ #. Yom Kippur.
89
+ msgid "Jom Kipur"
90
+ msgstr ""
91
+
92
+ #. Eid al-Fitr.
93
+ msgid "Ramazanski bajram"
94
+ msgstr ""
95
+
96
+ #. Eid al-Adha.
97
+ msgid "Kurbanski bajram"
98
+ msgstr ""
99
+
100
+ #. Ecological State Day.
101
+ msgid "Dan Ekološke države"
102
+ msgstr ""
Binary file