holidays 0.67__py3-none-any.whl → 0.69__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 (99) hide show
  1. holidays/calendars/__init__.py +1 -0
  2. holidays/calendars/balinese_saka.py +112 -0
  3. holidays/calendars/chinese.py +1 -1
  4. holidays/calendars/hindu.py +865 -1
  5. holidays/constants.py +1 -0
  6. holidays/countries/__init__.py +1 -0
  7. holidays/countries/afghanistan.py +8 -2
  8. holidays/countries/albania.py +8 -2
  9. holidays/countries/algeria.py +6 -2
  10. holidays/countries/american_samoa.py +6 -2
  11. holidays/countries/azerbaijan.py +26 -4
  12. holidays/countries/bahrain.py +8 -2
  13. holidays/countries/bosnia_and_herzegovina.py +8 -2
  14. holidays/countries/brunei.py +8 -2
  15. holidays/countries/burkina_faso.py +8 -2
  16. holidays/countries/burundi.py +6 -2
  17. holidays/countries/cameroon.py +8 -2
  18. holidays/countries/chad.py +8 -2
  19. holidays/countries/djibouti.py +6 -2
  20. holidays/countries/egypt.py +6 -2
  21. holidays/countries/ethiopia.py +8 -2
  22. holidays/countries/gabon.py +8 -2
  23. holidays/countries/ghana.py +6 -2
  24. holidays/countries/guam.py +6 -2
  25. holidays/countries/hongkong.py +38 -52
  26. holidays/countries/india.py +482 -166
  27. holidays/countries/indonesia.py +14 -58
  28. holidays/countries/iran.py +8 -2
  29. holidays/countries/jordan.py +6 -2
  30. holidays/countries/kazakhstan.py +8 -2
  31. holidays/countries/kenya.py +209 -47
  32. holidays/countries/kuwait.py +6 -2
  33. holidays/countries/kyrgyzstan.py +6 -2
  34. holidays/countries/macau.py +474 -0
  35. holidays/countries/malaysia.py +30 -6
  36. holidays/countries/maldives.py +6 -2
  37. holidays/countries/mauritania.py +6 -2
  38. holidays/countries/montenegro.py +8 -2
  39. holidays/countries/morocco.py +6 -2
  40. holidays/countries/nigeria.py +6 -2
  41. holidays/countries/north_macedonia.py +6 -2
  42. holidays/countries/northern_mariana_islands.py +6 -2
  43. holidays/countries/pakistan.py +8 -2
  44. holidays/countries/philippines.py +13 -3
  45. holidays/countries/poland.py +1 -1
  46. holidays/countries/puerto_rico.py +6 -2
  47. holidays/countries/saudi_arabia.py +6 -2
  48. holidays/countries/singapore.py +7 -2
  49. holidays/countries/spain.py +8 -2
  50. holidays/countries/sri_lanka.py +8 -2
  51. holidays/countries/taiwan.py +226 -29
  52. holidays/countries/tanzania.py +8 -2
  53. holidays/countries/timor_leste.py +21 -2
  54. holidays/countries/tunisia.py +6 -2
  55. holidays/countries/turkey.py +8 -2
  56. holidays/countries/united_arab_emirates.py +8 -2
  57. holidays/countries/united_states.py +84 -35
  58. holidays/countries/united_states_minor_outlying_islands.py +6 -2
  59. holidays/countries/united_states_virgin_islands.py +6 -2
  60. holidays/countries/uzbekistan.py +8 -2
  61. holidays/groups/__init__.py +1 -0
  62. holidays/groups/balinese_saka.py +45 -0
  63. holidays/groups/chinese.py +68 -3
  64. holidays/groups/hindu.py +255 -0
  65. holidays/groups/islamic.py +5 -2
  66. holidays/holiday_base.py +44 -29
  67. holidays/locale/de/LC_MESSAGES/PL.mo +0 -0
  68. holidays/locale/en_HK/LC_MESSAGES/HK.mo +0 -0
  69. holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
  70. holidays/locale/en_KE/LC_MESSAGES/KE.mo +0 -0
  71. holidays/locale/en_MO/LC_MESSAGES/MO.mo +0 -0
  72. holidays/locale/en_US/LC_MESSAGES/HK.mo +0 -0
  73. holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
  74. holidays/locale/en_US/LC_MESSAGES/KE.mo +0 -0
  75. holidays/locale/en_US/LC_MESSAGES/MO.mo +0 -0
  76. holidays/locale/en_US/LC_MESSAGES/MY.mo +0 -0
  77. holidays/locale/en_US/LC_MESSAGES/TW.mo +0 -0
  78. holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
  79. holidays/locale/ms_MY/LC_MESSAGES/MY.mo +0 -0
  80. holidays/locale/pt_MO/LC_MESSAGES/MO.mo +0 -0
  81. holidays/locale/sw/LC_MESSAGES/KE.mo +0 -0
  82. holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
  83. holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
  84. holidays/locale/th/LC_MESSAGES/MY.mo +0 -0
  85. holidays/locale/th/LC_MESSAGES/TW.mo +0 -0
  86. holidays/locale/zh_CN/LC_MESSAGES/HK.mo +0 -0
  87. holidays/locale/zh_CN/LC_MESSAGES/MO.mo +0 -0
  88. holidays/locale/zh_CN/LC_MESSAGES/TW.mo +0 -0
  89. holidays/locale/zh_HK/LC_MESSAGES/HK.mo +0 -0
  90. holidays/locale/zh_MO/LC_MESSAGES/MO.mo +0 -0
  91. holidays/locale/zh_TW/LC_MESSAGES/TW.mo +0 -0
  92. holidays/registry.py +1 -0
  93. holidays/version.py +1 -1
  94. {holidays-0.67.dist-info → holidays-0.69.dist-info}/AUTHORS +1 -0
  95. {holidays-0.67.dist-info → holidays-0.69.dist-info}/METADATA +24 -19
  96. {holidays-0.67.dist-info → holidays-0.69.dist-info}/RECORD +99 -83
  97. {holidays-0.67.dist-info → holidays-0.69.dist-info}/WHEEL +1 -1
  98. {holidays-0.67.dist-info → holidays-0.69.dist-info}/LICENSE +0 -0
  99. {holidays-0.67.dist-info → holidays-0.69.dist-info}/top_level.txt +0 -0
@@ -36,6 +36,7 @@ class TimorLeste(
36
36
  - http://timor-leste.gov.tl/?p=31750&lang=pt # 2023 (pt_PT)
37
37
  - http://timor-leste.gov.tl/?p=31750&lang=tp # 2023 (tet)
38
38
  - http://timor-leste.gov.tl/?p=35833&lang=en # 2024
39
+ - https://timor-leste.gov.tl/?p=41492&lang=en # 2025
39
40
 
40
41
  Limitations:
41
42
 
@@ -51,10 +52,16 @@ class TimorLeste(
51
52
  # Law No. 10/2005 Of 10 August, Public Holidays and Official Commemorative Dates.
52
53
  start_year = 2006
53
54
 
54
- def __init__(self, *args, **kwargs):
55
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
56
+ """
57
+ :param islamic_show_estimated:
58
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
59
+ """
55
60
  ChristianHolidays.__init__(self)
56
61
  InternationalHolidays.__init__(self)
57
- IslamicHolidays.__init__(self, cls=TimorLesteIslamicHolidays)
62
+ IslamicHolidays.__init__(
63
+ self, cls=TimorLesteIslamicHolidays, show_estimated=islamic_show_estimated
64
+ )
58
65
  StaticHolidays.__init__(self, TimorLesteStaticHolidays)
59
66
  super().__init__(*args, **kwargs)
60
67
 
@@ -197,6 +204,7 @@ class TimorLesteIslamicHolidays(_CustomIslamicHolidays):
197
204
  2022: (JUL, 9),
198
205
  2023: (JUN, 29),
199
206
  2024: (JUN, 17),
207
+ 2025: (JUN, 6),
200
208
  }
201
209
 
202
210
  EID_AL_FITR_DATES = {
@@ -214,6 +222,7 @@ class TimorLesteIslamicHolidays(_CustomIslamicHolidays):
214
222
  2022: (MAY, 2),
215
223
  2023: (APR, 22),
216
224
  2024: (APR, 10),
225
+ 2025: (MAR, 31),
217
226
  }
218
227
 
219
228
 
@@ -482,5 +491,15 @@ class TimorLesteStaticHolidays:
482
491
  (OCT, 31, special_national_holidays),
483
492
  # https://timor-leste.gov.tl/?p=40955&lang=en
484
493
  (NOV, 29, special_national_holidays),
494
+ # https://timor-leste.gov.tl/?p=41325&lang=en
495
+ (DEC, 24, special_national_holidays),
496
+ ),
497
+ 2025: (
498
+ # https://timor-leste.gov.tl/?p=41361&lang=en
499
+ (JAN, 2, special_national_holidays),
500
+ # https://timor-leste.gov.tl/?p=41592&lang=en
501
+ (JAN, 29, special_national_holidays),
502
+ # https://timor-leste.gov.tl/?p=42076&lang=en
503
+ (MAR, 5, special_national_holidays),
485
504
  ),
486
505
  }
@@ -25,9 +25,13 @@ class Tunisia(HolidayBase, InternationalHolidays, IslamicHolidays):
25
25
  estimated_label = tr("(تقدير) %s")
26
26
  supported_languages = ("ar", "en_US")
27
27
 
28
- def __init__(self, *args, **kwargs):
28
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
29
+ """
30
+ :param islamic_show_estimated:
31
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
32
+ """
29
33
  InternationalHolidays.__init__(self)
30
- IslamicHolidays.__init__(self)
34
+ IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
31
35
  super().__init__(*args, **kwargs)
32
36
 
33
37
  def _populate_public_holidays(self):
@@ -38,9 +38,15 @@ class Turkey(HolidayBase, InternationalHolidays, IslamicHolidays, StaticHolidays
38
38
  # Law 2739 of 27 May 1935.
39
39
  start_year = 1936
40
40
 
41
- def __init__(self, *args, **kwargs):
41
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
42
+ """
43
+ :param islamic_show_estimated:
44
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
45
+ """
42
46
  InternationalHolidays.__init__(self)
43
- IslamicHolidays.__init__(self, TurkeyIslamicHolidays)
47
+ IslamicHolidays.__init__(
48
+ self, cls=TurkeyIslamicHolidays, show_estimated=islamic_show_estimated
49
+ )
44
50
  StaticHolidays.__init__(self, TurkeyStaticHolidays)
45
51
  super().__init__(*args, **kwargs)
46
52
 
@@ -62,9 +62,15 @@ class UnitedArabEmirates(HolidayBase, InternationalHolidays, IslamicHolidays, St
62
62
  # Founded on DEC 2, 1971.
63
63
  start_year = 1972
64
64
 
65
- def __init__(self, *args, **kwargs):
65
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
66
+ """
67
+ :param islamic_show_estimated:
68
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
69
+ """
66
70
  InternationalHolidays.__init__(self)
67
- IslamicHolidays.__init__(self, cls=UnitedArabEmiratesIslamicHolidays)
71
+ IslamicHolidays.__init__(
72
+ self, cls=UnitedArabEmiratesIslamicHolidays, show_estimated=islamic_show_estimated
73
+ )
68
74
  StaticHolidays.__init__(self, UnitedArabEmiratesStaticHolidays)
69
75
  super().__init__(*args, **kwargs)
70
76
 
@@ -13,7 +13,7 @@
13
13
  from typing import Union
14
14
 
15
15
  from holidays.calendars.gregorian import MON, TUE, WED, THU, FRI, SAT, SUN
16
- from holidays.constants import PUBLIC, UNOFFICIAL
16
+ from holidays.constants import GOVERNMENT, PUBLIC, UNOFFICIAL
17
17
  from holidays.groups import ChristianHolidays, InternationalHolidays
18
18
  from holidays.observed_holiday_base import (
19
19
  ObservedHolidayBase,
@@ -35,6 +35,9 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
35
35
  """
36
36
  https://en.wikipedia.org/wiki/Public_holidays_in_the_United_States
37
37
 
38
+ Federal holidays:
39
+ - https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/
40
+
38
41
  For Northern Mariana Islands (subdivision MP):
39
42
  - https://governor.gov.mp/archived-news/executive-actions-archive/memorandum-2022-legal-holidays/
40
43
  - https://webcache.googleusercontent.com/search?q=cache:C17_7FBgPtQJ:https://governor.gov.mp/archived-news/executive-actions-archive/memorandum-2022-legal-holidays/&hl=en&gl=sg&strip=1&vwsrc=0
@@ -62,6 +65,7 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
62
65
  - IN: https://digital.statelib.lib.in.us/infoexpress/holidays.aspx
63
66
  https://www.in.gov/spd/benefits/state-holidays/
64
67
  - MD: https://msa.maryland.gov/msa/mdmanual/01glance/html/holidayl.html
68
+ - MI: https://www.michigan.gov/som/government/state-holidays
65
69
  - MN: https://www.revisor.mn.gov/statutes/cite/645.44
66
70
  - MT: https://archive.legmt.gov/bills/mca/title_0010/chapter_0010/part_0020/section_0160/0010-0010-0020-0160.html
67
71
  - NJ: https://nj.gov/nj/about/facts/holidays/
@@ -85,7 +89,7 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
85
89
  """
86
90
 
87
91
  country = "US"
88
- supported_categories = (PUBLIC, UNOFFICIAL)
92
+ supported_categories = (GOVERNMENT, PUBLIC, UNOFFICIAL)
89
93
  observed_label = "%s (observed)"
90
94
  subdivisions: Union[tuple[()], tuple[str, ...]] = (
91
95
  "AK", # Alaska.
@@ -160,20 +164,35 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
160
164
  kwargs.setdefault("observed_rule", SAT_TO_PREV_FRI + SUN_TO_NEXT_MON)
161
165
  super().__init__(*args, **kwargs)
162
166
 
163
- def _populate_public_holidays(self):
167
+ def _populate_common(self, include_federal: bool = False):
168
+ """
169
+ Populates common US holidays.
170
+
171
+ :param include_federal:
172
+ Whether to include federal-specific holidays.
173
+ """
164
174
  # New Year's Day
165
175
  if self._year >= 1871:
166
176
  name = "New Year's Day"
167
177
  self._add_observed(self._add_new_years_day(name))
168
178
  self._add_observed(self._next_year_new_years_day, name=name)
169
179
 
180
+ if include_federal:
181
+ # Birthday of Martin Luther King, Jr.
182
+ if self._year >= 1986:
183
+ self._add_holiday_3rd_mon_of_jan("Birthday of Martin Luther King, Jr.")
184
+
185
+ # Washington's Birthday
186
+ if self._year >= 1879:
187
+ name = "Washington's Birthday"
188
+ if self._year >= 1971:
189
+ self._add_holiday_3rd_mon_of_feb(name)
190
+ else:
191
+ self._add_holiday_feb_22(name)
192
+
170
193
  # Memorial Day
171
- if self._year >= 1888:
172
- name = "Memorial Day"
173
- if self._year >= 1971:
174
- self._add_holiday_last_mon_of_may(name)
175
- else:
176
- self._add_holiday_may_30(name)
194
+ if self._year >= 1971:
195
+ self._add_holiday_last_mon_of_may("Memorial Day")
177
196
 
178
197
  # Juneteenth Day
179
198
  if self._year >= 2021:
@@ -187,6 +206,11 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
187
206
  if self._year >= 1894:
188
207
  self._add_holiday_1st_mon_of_sep("Labor Day")
189
208
 
209
+ if include_federal:
210
+ # Columbus Day
211
+ if self._year >= 1971:
212
+ self._add_holiday_2nd_mon_of_oct("Columbus Day")
213
+
190
214
  # Veterans Day
191
215
  if self._year >= 1938:
192
216
  name = "Veterans Day" if self._year >= 1954 else "Armistice Day"
@@ -195,14 +219,21 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
195
219
  else:
196
220
  self._add_observed(self._add_remembrance_day(name))
197
221
 
198
- # Thanksgiving
222
+ # Thanksgiving Day
199
223
  if self._year >= 1871:
200
- self._add_holiday_4th_thu_of_nov("Thanksgiving")
224
+ self._add_holiday_4th_thu_of_nov("Thanksgiving Day")
201
225
 
202
226
  # Christmas Day
203
227
  if self._year >= 1871:
204
228
  self._add_observed(self._add_christmas_day("Christmas Day"))
205
229
 
230
+ def _populate_public_holidays(self):
231
+ self._populate_common()
232
+
233
+ # Memorial Day
234
+ if 1888 <= self._year <= 1970:
235
+ self._add_holiday_may_30("Memorial Day")
236
+
206
237
  def _add_christmas_eve_holiday(self):
207
238
  # Christmas Eve
208
239
  # If on Friday, observed on Thursday
@@ -324,11 +355,12 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
324
355
  self._add_holiday_3rd_mon_of_jan("Martin Luther King, Jr & Robert E. Lee's Birthday")
325
356
 
326
357
  # Washington's Birthday
327
- name = "George Washington & Thomas Jefferson's Birthday"
328
- if self._year >= 1971:
329
- self._add_holiday_3rd_mon_of_feb(name)
330
- else:
331
- self._add_holiday_feb_22(name)
358
+ if self._year >= 1879:
359
+ name = "George Washington & Thomas Jefferson's Birthday"
360
+ if self._year >= 1971:
361
+ self._add_holiday_3rd_mon_of_feb(name)
362
+ else:
363
+ self._add_holiday_feb_22(name)
332
364
 
333
365
  # Confederate Memorial Day
334
366
  if self._year >= 1866:
@@ -356,11 +388,12 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
356
388
  )
357
389
 
358
390
  # Washington's Birthday
359
- name = "George Washington's Birthday and Daisy Gatson Bates Day"
360
- if self._year >= 1971:
361
- self._add_holiday_3rd_mon_of_feb(name)
362
- else:
363
- self._add_holiday_feb_22(name)
391
+ if self._year >= 1879:
392
+ name = "George Washington's Birthday and Daisy Gatson Bates Day"
393
+ if self._year >= 1971:
394
+ self._add_holiday_3rd_mon_of_feb(name)
395
+ else:
396
+ self._add_holiday_feb_22(name)
364
397
 
365
398
  def _populate_subdiv_as_public_holidays(self):
366
399
  # American Samoa Flag Day
@@ -493,10 +526,11 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
493
526
  )
494
527
 
495
528
  # Washington's Birthday
496
- self._add_holiday(
497
- "Washington's Birthday",
498
- self._get_observed_date(self._christmas_day, rule=GA_IN_WASHINGTON_BIRTHDAY),
499
- )
529
+ if self._year >= 1879:
530
+ self._add_holiday(
531
+ "Washington's Birthday",
532
+ self._get_observed_date(self._christmas_day, rule=GA_IN_WASHINGTON_BIRTHDAY),
533
+ )
500
534
 
501
535
  def _populate_subdiv_gu_public_holidays(self):
502
536
  # Guam Discovery Day
@@ -587,10 +621,11 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
587
621
  self._add_holiday_1_day_past_4th_thu_of_nov("Lincoln's Birthday")
588
622
 
589
623
  # Washington's Birthday
590
- self._add_holiday(
591
- "Washington's Birthday",
592
- self._get_observed_date(self._christmas_day, rule=GA_IN_WASHINGTON_BIRTHDAY),
593
- )
624
+ if self._year >= 1879:
625
+ self._add_holiday(
626
+ "Washington's Birthday",
627
+ self._get_observed_date(self._christmas_day, rule=GA_IN_WASHINGTON_BIRTHDAY),
628
+ )
594
629
 
595
630
  def _populate_subdiv_ks_public_holidays(self):
596
631
  # Christmas Eve
@@ -684,6 +719,14 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
684
719
  # New Year's Eve
685
720
  self._add_observed(self._add_new_years_eve("New Year's Eve"))
686
721
 
722
+ # Election Day
723
+ if self._year >= 2008 and self._year % 2 == 0:
724
+ self._add_holiday_1_day_past_1st_mon_of_nov("Election Day")
725
+
726
+ # Day after Thanksgiving
727
+ if self._year >= 2017:
728
+ self._add_holiday_1_day_past_4th_thu_of_nov("Day After Thanksgiving")
729
+
687
730
  def _populate_subdiv_mn_public_holidays(self):
688
731
  # Washington's Birthday
689
732
  if self._year >= 1971:
@@ -872,7 +915,8 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
872
915
  self._add_epiphany_day("Epiphany")
873
916
 
874
917
  # Washington's Birthday
875
- self._add_holiday_3rd_mon_of_feb("Presidents' Day")
918
+ if self._year >= 1971:
919
+ self._add_holiday_3rd_mon_of_feb("Presidents' Day")
876
920
 
877
921
  # Emancipation Day
878
922
  self._add_observed(self._add_holiday_mar_22("Emancipation Day"), rule=SUN_TO_NEXT_MON)
@@ -1015,11 +1059,12 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
1015
1059
  self._add_epiphany_day("Three Kings Day")
1016
1060
 
1017
1061
  # Washington's Birthday
1018
- name = "Presidents' Day"
1019
- if self._year >= 1971:
1020
- self._add_holiday_3rd_mon_of_feb(name)
1021
- else:
1022
- self._add_holiday_feb_22(name)
1062
+ if self._year >= 1879:
1063
+ name = "Presidents' Day"
1064
+ if self._year >= 1971:
1065
+ self._add_holiday_3rd_mon_of_feb(name)
1066
+ else:
1067
+ self._add_holiday_feb_22(name)
1023
1068
 
1024
1069
  # Transfer Day
1025
1070
  self._add_holiday_mar_31("Transfer Day")
@@ -1102,6 +1147,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
1102
1147
  if self._year >= 1971:
1103
1148
  self._add_holiday_3rd_mon_of_feb("President's Day")
1104
1149
 
1150
+ def _populate_government_holidays(self):
1151
+ # Federal holidays in the United States.
1152
+ self._populate_common(include_federal=True)
1153
+
1105
1154
  def _populate_unofficial_holidays(self):
1106
1155
  # Very common celebrated cultural days, but no official observance.
1107
1156
  # Due to its nature, no in-lieus are observed.
@@ -10,7 +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
+ from holidays.constants import GOVERNMENT, PUBLIC, UNOFFICIAL
14
14
  from holidays.countries.united_states import US
15
15
 
16
16
 
@@ -20,13 +20,17 @@ class HolidaysUM(US):
20
20
  # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1
21
21
 
22
22
  country = "UM"
23
- supported_categories = (PUBLIC, UNOFFICIAL)
23
+ supported_categories = (GOVERNMENT, PUBLIC, UNOFFICIAL)
24
24
  subdivisions = () # Override US subdivisions.
25
25
 
26
26
  def _populate_public_holidays(self) -> None:
27
27
  self.subdiv = "UM"
28
28
  super()._populate_public_holidays()
29
29
 
30
+ def _populate_government_holidays(self) -> None:
31
+ self.subdiv = "UM"
32
+ super()._populate_government_holidays()
33
+
30
34
  def _populate_unofficial_holidays(self) -> None:
31
35
  self.subdiv = "UM"
32
36
  super()._populate_unofficial_holidays()
@@ -10,7 +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
+ from holidays.constants import GOVERNMENT, PUBLIC, UNOFFICIAL
14
14
  from holidays.countries.united_states import US
15
15
 
16
16
 
@@ -20,13 +20,17 @@ class HolidaysVI(US):
20
20
  # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1
21
21
 
22
22
  country = "VI"
23
- supported_categories = (PUBLIC, UNOFFICIAL)
23
+ supported_categories = (GOVERNMENT, PUBLIC, UNOFFICIAL)
24
24
  subdivisions = () # Override US subdivisions.
25
25
 
26
26
  def _populate_public_holidays(self) -> None:
27
27
  self.subdiv = "VI"
28
28
  super()._populate_public_holidays()
29
29
 
30
+ def _populate_government_holidays(self) -> None:
31
+ self.subdiv = "VI"
32
+ super()._populate_government_holidays()
33
+
30
34
  def _populate_unofficial_holidays(self) -> None:
31
35
  self.subdiv = "VI"
32
36
  super()._populate_unofficial_holidays()
@@ -38,9 +38,15 @@ class Uzbekistan(ObservedHolidayBase, InternationalHolidays, IslamicHolidays, St
38
38
  supported_languages = ("en_US", "uk", "uz")
39
39
  start_year = 1992
40
40
 
41
- def __init__(self, *args, **kwargs):
41
+ def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs):
42
+ """
43
+ :param islamic_show_estimated:
44
+ Whether to add "estimated" label to Islamic holidays name if holiday date is estimated.
45
+ """
42
46
  InternationalHolidays.__init__(self)
43
- IslamicHolidays.__init__(self, UzbekistanIslamicHolidays)
47
+ IslamicHolidays.__init__(
48
+ self, cls=UzbekistanIslamicHolidays, show_estimated=islamic_show_estimated
49
+ )
44
50
  StaticHolidays.__init__(self, UzbekistanStaticHolidays)
45
51
  kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_WORKDAY)
46
52
  super().__init__(*args, **kwargs)
@@ -12,6 +12,7 @@
12
12
 
13
13
  # flake8: noqa: F401
14
14
 
15
+ from holidays.groups.balinese_saka import BalineseSakaCalendarHolidays
15
16
  from holidays.groups.buddhist import BuddhistCalendarHolidays
16
17
  from holidays.groups.chinese import ChineseCalendarHolidays
17
18
  from holidays.groups.christian import ChristianHolidays
@@ -0,0 +1,45 @@
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 datetime import date
14
+ from typing import Optional
15
+
16
+ from holidays.calendars import _BalineseSakaLunar
17
+
18
+
19
+ class BalineseSakaCalendarHolidays:
20
+ """
21
+ Balinese Saka lunar calendar holidays.
22
+ """
23
+
24
+ def __init__(self) -> None:
25
+ self._balinese_saka_calendar = _BalineseSakaLunar()
26
+
27
+ def _add_balinese_saka_calendar_holiday(self, name: str, dt: Optional[date]) -> Optional[date]:
28
+ """
29
+ Add Balinese Saka calendar holiday.
30
+ """
31
+ if dt is None:
32
+ return None
33
+ return self._add_holiday(name, dt)
34
+
35
+ def _add_nyepi(self, name) -> Optional[date]:
36
+ """
37
+ Add Nyepi (Day following the 9th of Dark Moon (Tilem)).
38
+
39
+ Nyepi is a Balinese "Day of Silence" that is commemorated every
40
+ Isakawarsa (Saka new year) according to the Balinese calendar.
41
+ https://en.wikipedia.org/wiki/Nyepi
42
+ """
43
+ return self._add_balinese_saka_calendar_holiday(
44
+ name, self._balinese_saka_calendar.nyepi_date(self._year)
45
+ )
@@ -14,7 +14,7 @@ from datetime import date
14
14
  from typing import Optional
15
15
 
16
16
  from holidays.calendars import _ChineseLunisolar
17
- from holidays.calendars.gregorian import APR
17
+ from holidays.calendars.gregorian import APR, DEC
18
18
  from holidays.groups.eastern import EasternCalendarHolidays
19
19
 
20
20
 
@@ -35,7 +35,10 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
35
35
  return self._chinese_calendar.lunar_new_year_date(self._year)[0]
36
36
 
37
37
  @property
38
- def _qingming_date(self):
38
+ def _qingming_festival(self):
39
+ """
40
+ Return Qingming Festival (15th day after the Spring Equinox) date.
41
+ """
39
42
  day = 5
40
43
  if (self._year % 4 < 1) or (self._year % 4 < 2 and self._year >= 2009):
41
44
  day = 4
@@ -48,6 +51,47 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
48
51
  """
49
52
  return self._chinese_calendar.mid_autumn_date(self._year)[0]
50
53
 
54
+ @property
55
+ def _chinese_birthday_of_buddha(self):
56
+ """
57
+ Return Add Birthday of the Buddha by Chinese lunar calendar (8th day of the
58
+ 4th lunar month).
59
+ """
60
+ return self._chinese_calendar.buddha_birthday_date(self._year)[0]
61
+
62
+ @property
63
+ def _dragon_boat_festival(self):
64
+ """
65
+ Return Dragon Boat Festival (5th day of 5th lunar month) date.
66
+ """
67
+ return self._chinese_calendar.dragon_boat_date(self._year)[0]
68
+
69
+ @property
70
+ def _double_ninth_festival(self):
71
+ """
72
+ Return Double Ninth Festival (9th day of 9th lunar month) date.
73
+ """
74
+ return self._chinese_calendar.double_ninth_date(self._year)[0]
75
+
76
+ @property
77
+ def _dongzhi_festival(self):
78
+ """
79
+ Return Dongzhi Festival (Chinese Winter Solstice) date.
80
+
81
+ This approximation is reliable for 1952-2099 years.
82
+ """
83
+ #
84
+ if (
85
+ (self._year % 4 == 0 and self._year >= 1988)
86
+ or (self._year % 4 == 1 and self._year >= 2021)
87
+ or (self._year % 4 == 2 and self._year >= 2058)
88
+ or (self._year % 4 == 3 and self._year >= 2091)
89
+ ):
90
+ day = 21
91
+ else:
92
+ day = 22
93
+ return date(self._year, DEC, day)
94
+
51
95
  def _add_chinese_calendar_holiday(
52
96
  self, name: str, dt_estimated: tuple[Optional[date], bool], days_delta: int = 0
53
97
  ) -> Optional[date]:
@@ -128,6 +172,27 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
128
172
  name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+3
129
173
  )
130
174
 
175
+ def _add_chinese_new_years_day_five(self, name) -> Optional[date]:
176
+ """
177
+ Add Chinese New Year's Day Five.
178
+
179
+ https://en.wikipedia.org/wiki/Chinese_New_Year
180
+ """
181
+ return self._add_chinese_calendar_holiday(
182
+ name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+4
183
+ )
184
+
185
+ def _add_dongzhi_festival(self, name) -> Optional[date]:
186
+ """
187
+ Add Dongzhi Festival (Chinese Winter Solstice).
188
+
189
+ The Dongzhi Festival or Winter Solstice Festival is a traditional
190
+ Chinese festival celebrated during the Dongzhi solar term
191
+ (winter solstice), which falls between December 21 and 23.
192
+ https://en.wikipedia.org/wiki/Dongzhi_Festival
193
+ """
194
+ return self._add_holiday(name, self._dongzhi_festival)
195
+
131
196
  def _add_qingming_festival(self, name) -> date:
132
197
  """
133
198
  Add Qingming Festival (15th day after the Spring Equinox).
@@ -136,7 +201,7 @@ class ChineseCalendarHolidays(EasternCalendarHolidays):
136
201
  Tomb-Sweeping Day in English, is a traditional Chinese festival.
137
202
  https://en.wikipedia.org/wiki/Qingming_Festival
138
203
  """
139
- return self._add_holiday(name, self._qingming_date)
204
+ return self._add_holiday(name, self._qingming_festival)
140
205
 
141
206
  def _add_double_ninth_festival(self, name) -> Optional[date]:
142
207
  """