holidays 0.80__py3-none-any.whl → 0.82__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 (142) hide show
  1. holidays/calendars/__init__.py +1 -0
  2. holidays/calendars/burmese.py +319 -0
  3. holidays/calendars/chinese.py +39 -1
  4. holidays/calendars/hebrew.py +2 -2
  5. holidays/calendars/thai.py +49 -2
  6. holidays/countries/__init__.py +16 -0
  7. holidays/countries/afghanistan.py +7 -5
  8. holidays/countries/algeria.py +89 -24
  9. holidays/countries/antarctica.py +58 -0
  10. holidays/countries/bouvet_island.py +31 -0
  11. holidays/countries/brazil.py +1 -1
  12. holidays/countries/british_indian_ocean_territory.py +31 -0
  13. holidays/countries/bulgaria.py +6 -1
  14. holidays/countries/chile.py +9 -8
  15. holidays/countries/china.py +4 -0
  16. holidays/countries/cuba.py +3 -4
  17. holidays/countries/djibouti.py +1 -1
  18. holidays/countries/heard_island_and_mcdonald_islands.py +31 -0
  19. holidays/countries/hongkong.py +5 -1
  20. holidays/countries/hungary.py +4 -5
  21. holidays/countries/india.py +6 -0
  22. holidays/countries/japan.py +22 -18
  23. holidays/countries/jordan.py +6 -3
  24. holidays/countries/kuwait.py +6 -3
  25. holidays/countries/macau.py +9 -0
  26. holidays/countries/malaysia.py +14 -3
  27. holidays/countries/mongolia.py +2 -0
  28. holidays/countries/myanmar.py +195 -0
  29. holidays/countries/north_korea.py +161 -0
  30. holidays/countries/norway.py +23 -8
  31. holidays/countries/oman.py +6 -2
  32. holidays/countries/paraguay.py +70 -23
  33. holidays/countries/philippines.py +11 -2
  34. holidays/countries/portugal.py +5 -6
  35. holidays/countries/qatar.py +5 -2
  36. holidays/countries/rwanda.py +6 -1
  37. holidays/countries/saint_helena_ascension_and_tristan_da_cunha.py +197 -0
  38. holidays/countries/saudi_arabia.py +6 -5
  39. holidays/countries/serbia.py +5 -0
  40. holidays/countries/south_africa.py +96 -53
  41. holidays/countries/south_korea.py +10 -1
  42. holidays/countries/spain.py +26 -4
  43. holidays/countries/sudan.py +118 -0
  44. holidays/countries/switzerland.py +169 -3
  45. holidays/countries/taiwan.py +27 -3
  46. holidays/countries/tajikistan.py +1 -1
  47. holidays/countries/tanzania.py +6 -1
  48. holidays/countries/thailand.py +21 -0
  49. holidays/countries/tonga.py +6 -1
  50. holidays/countries/trinidad_and_tobago.py +6 -1
  51. holidays/countries/united_arab_emirates.py +9 -2
  52. holidays/countries/united_states.py +16 -0
  53. holidays/countries/uruguay.py +6 -1
  54. holidays/countries/vietnam.py +10 -1
  55. holidays/countries/yemen.py +6 -3
  56. holidays/groups/__init__.py +1 -0
  57. holidays/groups/balinese_saka.py +1 -1
  58. holidays/groups/buddhist.py +1 -1
  59. holidays/groups/burmese.py +273 -0
  60. holidays/groups/chinese.py +27 -14
  61. holidays/groups/custom.py +8 -2
  62. holidays/groups/eastern.py +25 -3
  63. holidays/groups/hebrew.py +16 -14
  64. holidays/groups/hindu.py +15 -13
  65. holidays/groups/islamic.py +52 -47
  66. holidays/groups/mongolian.py +1 -1
  67. holidays/groups/sinhala.py +4 -9
  68. holidays/groups/tibetan.py +3 -4
  69. holidays/holiday_base.py +5 -4
  70. holidays/ical.py +6 -4
  71. holidays/locale/ar/LC_MESSAGES/DZ.mo +0 -0
  72. holidays/locale/ar_SD/LC_MESSAGES/SD.mo +0 -0
  73. holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
  74. holidays/locale/en_GB/LC_MESSAGES/SH.mo +0 -0
  75. holidays/locale/en_HK/LC_MESSAGES/HK.mo +0 -0
  76. holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
  77. holidays/locale/en_MO/LC_MESSAGES/MO.mo +0 -0
  78. holidays/locale/en_PH/LC_MESSAGES/PH.mo +0 -0
  79. holidays/locale/en_US/LC_MESSAGES/BR.mo +0 -0
  80. holidays/locale/en_US/LC_MESSAGES/CN.mo +0 -0
  81. holidays/locale/en_US/LC_MESSAGES/DZ.mo +0 -0
  82. holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
  83. holidays/locale/en_US/LC_MESSAGES/HK.mo +0 -0
  84. holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
  85. holidays/locale/en_US/LC_MESSAGES/JP.mo +0 -0
  86. holidays/locale/en_US/LC_MESSAGES/KP.mo +0 -0
  87. holidays/locale/en_US/LC_MESSAGES/KR.mo +0 -0
  88. holidays/locale/en_US/LC_MESSAGES/MM.mo +0 -0
  89. holidays/locale/en_US/LC_MESSAGES/MN.mo +0 -0
  90. holidays/locale/en_US/LC_MESSAGES/MO.mo +0 -0
  91. holidays/locale/en_US/LC_MESSAGES/PH.mo +0 -0
  92. holidays/locale/en_US/LC_MESSAGES/PY.mo +0 -0
  93. holidays/locale/en_US/LC_MESSAGES/SD.mo +0 -0
  94. holidays/locale/en_US/LC_MESSAGES/SH.mo +0 -0
  95. holidays/locale/en_US/LC_MESSAGES/TW.mo +0 -0
  96. holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
  97. holidays/locale/en_US/LC_MESSAGES/VN.mo +0 -0
  98. holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
  99. holidays/locale/es/LC_MESSAGES/PY.mo +0 -0
  100. holidays/locale/fil/LC_MESSAGES/PH.mo +0 -0
  101. holidays/locale/fr/LC_MESSAGES/DZ.mo +0 -0
  102. holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
  103. holidays/locale/ja/LC_MESSAGES/JP.mo +0 -0
  104. holidays/locale/ko/LC_MESSAGES/KR.mo +0 -0
  105. holidays/locale/ko_KP/LC_MESSAGES/KP.mo +0 -0
  106. holidays/locale/mn/LC_MESSAGES/MN.mo +0 -0
  107. holidays/locale/my/LC_MESSAGES/MM.mo +0 -0
  108. holidays/locale/pt_BR/LC_MESSAGES/BR.mo +0 -0
  109. holidays/locale/pt_MO/LC_MESSAGES/MO.mo +0 -0
  110. holidays/locale/th/LC_MESSAGES/CN.mo +0 -0
  111. holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
  112. holidays/locale/th/LC_MESSAGES/JP.mo +0 -0
  113. holidays/locale/th/LC_MESSAGES/KR.mo +0 -0
  114. holidays/locale/th/LC_MESSAGES/MM.mo +0 -0
  115. holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
  116. holidays/locale/th/LC_MESSAGES/PH.mo +0 -0
  117. holidays/locale/th/LC_MESSAGES/TW.mo +0 -0
  118. holidays/locale/th/LC_MESSAGES/US.mo +0 -0
  119. holidays/locale/th/LC_MESSAGES/VN.mo +0 -0
  120. holidays/locale/uk/LC_MESSAGES/BR.mo +0 -0
  121. holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
  122. holidays/locale/uk/LC_MESSAGES/PY.mo +0 -0
  123. holidays/locale/vi/LC_MESSAGES/VN.mo +0 -0
  124. holidays/locale/zh_CN/LC_MESSAGES/CN.mo +0 -0
  125. holidays/locale/zh_CN/LC_MESSAGES/HK.mo +0 -0
  126. holidays/locale/zh_CN/LC_MESSAGES/MO.mo +0 -0
  127. holidays/locale/zh_CN/LC_MESSAGES/TW.mo +0 -0
  128. holidays/locale/zh_HK/LC_MESSAGES/HK.mo +0 -0
  129. holidays/locale/zh_MO/LC_MESSAGES/MO.mo +0 -0
  130. holidays/locale/zh_TW/LC_MESSAGES/CN.mo +0 -0
  131. holidays/locale/zh_TW/LC_MESSAGES/TW.mo +0 -0
  132. holidays/no_holiday_base.py +21 -0
  133. holidays/observed_holiday_base.py +1 -1
  134. holidays/registry.py +12 -0
  135. holidays/utils.py +5 -5
  136. holidays/version.py +1 -1
  137. {holidays-0.80.dist-info → holidays-0.82.dist-info}/METADATA +61 -5
  138. {holidays-0.80.dist-info → holidays-0.82.dist-info}/RECORD +142 -121
  139. {holidays-0.80.dist-info → holidays-0.82.dist-info}/licenses/CONTRIBUTORS +2 -0
  140. {holidays-0.80.dist-info → holidays-0.82.dist-info}/WHEEL +0 -0
  141. {holidays-0.80.dist-info → holidays-0.82.dist-info}/licenses/LICENSE +0 -0
  142. {holidays-0.80.dist-info → holidays-0.82.dist-info}/top_level.txt +0 -0
@@ -10,7 +10,10 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from __future__ import annotations
14
+
13
15
  from gettext import gettext as tr
16
+ from typing import TYPE_CHECKING
14
17
 
15
18
  from holidays.calendars import (
16
19
  _CustomBuddhistHolidays,
@@ -51,6 +54,9 @@ from holidays.observed_holiday_base import (
51
54
  SUN_TO_NEXT_WORKDAY,
52
55
  )
53
56
 
57
+ if TYPE_CHECKING:
58
+ from datetime import date
59
+
54
60
 
55
61
  class Malaysia(
56
62
  ObservedHolidayBase,
@@ -163,6 +169,14 @@ class Malaysia(
163
169
  kwargs.setdefault("observed_rule", SUN_TO_NEXT_WORKDAY)
164
170
  super().__init__(*args, **kwargs)
165
171
 
172
+ def _get_weekend(self, dt: date) -> set[int]:
173
+ if (
174
+ self.subdiv == "01" and (dt.year <= 1994 or 2014 <= dt.year <= 2024)
175
+ ) or self.subdiv in {"02", "03", "11"}:
176
+ return {FRI, SAT}
177
+ else:
178
+ return {SAT, SUN}
179
+
166
180
  def _populate_public_holidays(self):
167
181
  self.dts_observed = set()
168
182
 
@@ -229,13 +243,10 @@ class Malaysia(
229
243
  self.subdiv == "01" and (self._year <= 1994 or 2014 <= self._year <= 2024)
230
244
  ) or self.subdiv == "02":
231
245
  self._observed_rule = FRI_TO_NEXT_WORKDAY
232
- self.weekend = {FRI, SAT}
233
246
  elif self.subdiv in {"03", "11"}:
234
247
  self._observed_rule = SAT_TO_NEXT_WORKDAY
235
- self.weekend = {FRI, SAT}
236
248
  else:
237
249
  self._observed_rule = SUN_TO_NEXT_WORKDAY
238
- self.weekend = {SAT, SUN}
239
250
 
240
251
  if self.observed:
241
252
  self._populate_observed(self.dts_observed)
@@ -32,6 +32,8 @@ class Mongolia(HolidayBase, InternationalHolidays, MongolianCalendarHolidays):
32
32
 
33
33
  country = "MN"
34
34
  default_language = "mn"
35
+ # %s (estimated).
36
+ estimated_label = tr("%s (урьдчилсан)")
35
37
  start_year = 2004
36
38
  supported_categories = (PUBLIC, WORKDAY)
37
39
  supported_languages = ("en_US", "mn")
@@ -0,0 +1,195 @@
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 gettext import gettext as tr
14
+
15
+ from holidays.calendars import _CustomIslamicHolidays
16
+ from holidays.calendars.gregorian import JAN, MAR, JUN, JUL, AUG, NOV, DEC
17
+ from holidays.groups import (
18
+ BurmeseCalendarHolidays,
19
+ ChineseCalendarHolidays,
20
+ ChristianHolidays,
21
+ InternationalHolidays,
22
+ IslamicHolidays,
23
+ StaticHolidays,
24
+ )
25
+ from holidays.holiday_base import HolidayBase
26
+
27
+
28
+ class Myanmar(
29
+ HolidayBase,
30
+ BurmeseCalendarHolidays,
31
+ ChineseCalendarHolidays,
32
+ ChristianHolidays,
33
+ InternationalHolidays,
34
+ IslamicHolidays,
35
+ StaticHolidays,
36
+ ):
37
+ """Myanmar holidays.
38
+
39
+ References:
40
+ * <https://en.wikipedia.org/wiki/Public_holidays_in_Myanmar>
41
+ * <https://my.wikipedia.org/wiki/မြန်မာနိုင်ငံရှိ_အားလပ်ရက်များ>
42
+ * [Algorithm, Program and Calculation of Myanmar Calendar](https://web.archive.org/web/20250510011425/http://cool-emerald.blogspot.com/2013/06/algorithm-program-and-calculation-of.html)
43
+ * [2025 International and Chinese New Year](https://web.archive.org/web/20240709104600/https://www.moi.gov.mm/news/58594)
44
+ * [Armed Forces Day](https://web.archive.org/web/20250522010622/https://burma.irrawaddy.com/on-this-day/2019/03/27/187691.html)
45
+ * [2021-2024](https://web.archive.org/web/20241112125406/https://evisa.moip.gov.mm/home/publicholiday)
46
+ * [2013-2025 (Webarchive)](https://web.archive.org/web/20250711015428/http://www.myanmarembassy.sg/contact-us/holidays/)
47
+ """
48
+
49
+ country = "MM"
50
+ default_language = "my"
51
+ # %s (estimated).
52
+ estimated_label = tr("%s (ခန့်မှန်း)")
53
+ supported_languages = ("en_US", "my", "th")
54
+ # Myanmar gained its independence from British rule on January 4, 1948.
55
+ start_year = 1948
56
+
57
+ def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
58
+ """
59
+ Args:
60
+ islamic_show_estimated:
61
+ Whether to add "estimated" label to Islamic holidays name
62
+ if holiday date is estimated.
63
+ """
64
+ BurmeseCalendarHolidays.__init__(self)
65
+ ChineseCalendarHolidays.__init__(self)
66
+ ChristianHolidays.__init__(self)
67
+ InternationalHolidays.__init__(self)
68
+ IslamicHolidays.__init__(
69
+ self, cls=MyanmarIslamicHolidays, show_estimated=islamic_show_estimated
70
+ )
71
+ StaticHolidays.__init__(self, cls=MyanmarStaticHolidays)
72
+ super().__init__(*args, **kwargs)
73
+
74
+ def _populate_public_holidays(self):
75
+ if self._year >= 2025:
76
+ # New Year's Day.
77
+ self._add_new_years_day(tr("နိုင်ငံတကာနှစ်သစ်ကူးနေ့"))
78
+
79
+ # Independence Day.
80
+ self._add_holiday_jan_4(tr("လွတ်လပ်ရေးနေ့"))
81
+
82
+ # Union Day.
83
+ self._add_holiday_feb_12(tr("ပြည်ထောင်စုနေ့"))
84
+
85
+ # Peasants' Day.
86
+ name = tr("တောင်သူလယ်သမားနေ့")
87
+ if self._year >= 1965:
88
+ self._add_holiday_mar_2(name)
89
+ elif self._year >= 1963:
90
+ self._add_holiday_jan_1(name)
91
+
92
+ self._add_holiday_mar_27(
93
+ # Armed Forces Day.
94
+ tr("တပ်မတော်နေ့")
95
+ if self._year >= 1955
96
+ # Revolution Day.
97
+ else tr("တော်လှန်ရေးနေ့")
98
+ )
99
+
100
+ # May Day.
101
+ self._add_labor_day(tr("မေဒေးနေ့"))
102
+
103
+ # Martyrs' Day.
104
+ self._add_holiday_jul_19(tr("အာဇာနည်နေ့"))
105
+
106
+ # Christmas Day.
107
+ self._add_christmas_day(tr("ခရစ္စမတ်နေ့"))
108
+
109
+ # Eid al-Adha.
110
+ self._add_eid_al_adha_day(tr("အီဒုလ်အဿွဟာနေ့"))
111
+
112
+ if self._year >= 2025:
113
+ # Chinese New Year.
114
+ self._add_chinese_new_years_day(tr("တရုတ်နှစ်သစ်ကူးနေ့"))
115
+
116
+ # Myanmar New Year.
117
+ name = tr("မြန်မာနှစ်သစ်ကူး ရုံးပိတ်ရက်များ")
118
+ if self._year >= 2024:
119
+ self._add_myanmar_new_year(name, extra_days_after=8)
120
+ elif self._year >= 2022:
121
+ self._add_myanmar_new_year(name, extra_days_before=4)
122
+ elif 2007 <= self._year <= 2016:
123
+ self._add_myanmar_new_year(name, extra_days_before=1, extra_days_after=8)
124
+ else:
125
+ self._add_myanmar_new_year(name)
126
+
127
+ # Full Moon Day of Tabaung.
128
+ self._add_tabaung_full_moon_day(tr("တပေါင်းလပြည့်နေ့"))
129
+
130
+ # Full Moon Day of Kason.
131
+ self._add_kason_full_moon_day(tr("ကဆုန်လပြည့်နေ့"))
132
+
133
+ # Full Moon Day of Waso.
134
+ self._add_waso_full_moon_day(tr("ဝါဆိုလပြည့်နေ့"))
135
+
136
+ # Thadingyut Holidays.
137
+ name = tr("သီတင်းကျွတ်ပိတ်ရက်များ")
138
+ self._add_thadingyut_full_moon_eve(name)
139
+ self._add_thadingyut_full_moon_day(name)
140
+ self._add_thadingyut_full_moon_day_two(name)
141
+
142
+ # Diwali.
143
+ self._add_myanmar_diwali(tr("ဒီပါဝလီနေ့"))
144
+
145
+ # Full Moon Day of Tazaungmon.
146
+ self._add_tazaungmon_full_moon_day(tr("တန်ဆောင်တိုင်လပြည့်နေ့"))
147
+
148
+ # National Day.
149
+ self._add_myanmar_national_day(tr("အမျိုးသားနေ့"))
150
+
151
+ # Karen New Year.
152
+ self._add_karen_new_year(tr("ကရင်နှစ်သစ်ကူးနေ့"))
153
+
154
+
155
+ class MM(Myanmar):
156
+ pass
157
+
158
+
159
+ class MMR(Myanmar):
160
+ pass
161
+
162
+
163
+ class MyanmarIslamicHolidays(_CustomIslamicHolidays):
164
+ EID_AL_ADHA_DATES = {
165
+ 2020: (AUG, 1),
166
+ 2021: (JUL, 21),
167
+ 2022: (JUL, 10),
168
+ 2023: (JUN, 29),
169
+ 2024: (JUN, 17),
170
+ 2025: (JUN, 7),
171
+ }
172
+
173
+
174
+ class MyanmarStaticHolidays:
175
+ """Myanmar special holidays.
176
+
177
+ References:
178
+ * [2025](https://web.archive.org/web/20241221214023/https://www.gnlm.com.mm/govt-designates-continuous-public-days-for-2024-2025-to-ease-travel-and-extend-leisure/)
179
+ """
180
+
181
+ # Substituted date format.
182
+ substituted_date_format = tr("%d-%m-%Y")
183
+
184
+ # Day off (substituted from %s).
185
+ substituted_label = tr("အလုပ်ပိတ်ရက် (%s မှ ပြန်လဲထားသည်)")
186
+
187
+ special_public_holidays = {
188
+ 2024: (DEC, 31, JAN, 11, 2025),
189
+ 2025: (
190
+ (MAR, 12, MAR, 22),
191
+ (MAR, 14, MAR, 29),
192
+ (NOV, 3, NOV, 8),
193
+ (DEC, 26, JAN, 3, 2026),
194
+ ),
195
+ }
@@ -0,0 +1,161 @@
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 gettext import gettext as tr
14
+
15
+ from holidays.calendars.chinese import KOREAN_CALENDAR
16
+ from holidays.groups import ChineseCalendarHolidays, InternationalHolidays
17
+ from holidays.holiday_base import HolidayBase
18
+
19
+
20
+ class NorthKorea(HolidayBase, ChineseCalendarHolidays, InternationalHolidays):
21
+ """North Korea holidays.
22
+
23
+ References:
24
+ * <https://en.wikipedia.org/wiki/Public_holidays_in_North_Korea>
25
+ * <https://en.wikipedia.org/wiki/Day_of_Songun>
26
+ * <https://en.wikipedia.org/wiki/Dano_(festival)>
27
+ * <https://en.wikipedia.org/wiki/Cold_Food_Festival>
28
+ * <https://ko.wikipedia.org/wiki/조국해방전쟁_승리_기념일>
29
+ * [2025 Holidays](https://namu.wiki/w/공휴일/북한)
30
+ * [Korean People's Army](https://web.archive.org/web/20250824194534/https://namu.wiki/w/조선인민군)
31
+ * [Founding Day of the Korean People's Revolutionary Army](https://web.archive.org/web/20250909074255/https://www.nocutnews.co.kr/news/1091995)
32
+ * [Holidays and Anniversaries](http://archive.today/2025.09.21-064344/https://unikorea.go.kr/nkhr/current/life/living/daily/?boardId=bbs_0000000000000078&mode=view&cntId=51400)
33
+ * [Day of Songun](http://archive.today/2025.09.21-063344/https://namu.wiki/w/선군절)
34
+ * [2013 North Korea Calendar](https://web.archive.org/web/20250921062305/https://nk.chosun.com/news/articleView.html?idxno=151905)
35
+ * [Daeboreum in North Korea](https://web.archive.org/web/20230210091341/https://www.newsis.com/view/?id=NISX20200207_0000911479)
36
+ * [Day of the Shining Star](https://web.archive.org/web/20250921063234/https://www.munhwa.com/article/11412228)
37
+ * [Day of the Sun](http://archive.today/2025.09.21-063705/https://namu.wiki/w/태양절)
38
+ * [Cheongmyeong Festival](https://web.archive.org/web/20250324201145/https://namu.wiki/w/청명)
39
+ """
40
+
41
+ country = "KP"
42
+ default_language = "ko_KP"
43
+ # %s (estimated).
44
+ estimated_label = tr("%s (추정된)")
45
+ start_year = 1948
46
+ supported_languages = ("en_US", "ko_KP")
47
+
48
+ def __init__(self, *args, **kwargs):
49
+ ChineseCalendarHolidays.__init__(self, calendar=KOREAN_CALENDAR)
50
+ InternationalHolidays.__init__(self)
51
+ super().__init__(*args, **kwargs)
52
+
53
+ def _populate_public_holidays(self):
54
+ # New Year's Day.
55
+ self._add_new_years_day(tr("양력설"))
56
+
57
+ if self._year <= 1967 or self._year >= 1989:
58
+ # Korean New Year.
59
+ self._add_chinese_new_years_day(tr("설명절"))
60
+
61
+ if self._year >= 2003:
62
+ # Daeboreum.
63
+ self._add_daeboreum_day(tr("대보름"))
64
+
65
+ if self._year <= 1977 or self._year >= 2018:
66
+ # Founding Day of the Korean People's Army.
67
+ self._add_holiday_feb_8(tr("조선인민군창건일"))
68
+
69
+ if self._year >= 1975:
70
+ name = (
71
+ # Day of the Shining Star.
72
+ tr("광명성절")
73
+ if self._year >= 2012
74
+ # Kim Jong Il's Birthday.
75
+ else tr("김정일의 생일")
76
+ )
77
+ self._add_holiday_feb_16(name)
78
+ if self._year >= 1986:
79
+ self._add_holiday_feb_17(name)
80
+
81
+ # International Women's Day.
82
+ self._add_womens_day(tr("국제부녀절"))
83
+
84
+ if self._year >= 2012:
85
+ # Cheongmyeong Festival.
86
+ self._add_qingming_festival(tr("청명"))
87
+
88
+ if self._year <= 1967:
89
+ # Hanshi Festival.
90
+ self._add_hanshi_festival(tr("한식"))
91
+
92
+ if self._year == 1962 or self._year >= 1968:
93
+ name = (
94
+ # Day of the Sun.
95
+ tr("태양절")
96
+ if self._year >= 1998
97
+ # Kim Il-Sung's Birthday.
98
+ else tr("김일성의 생일")
99
+ )
100
+ self._add_holiday_apr_15(name)
101
+ if self._year >= 1998:
102
+ self._add_holiday_apr_16(name)
103
+
104
+ if self._year >= 1978:
105
+ self._add_holiday_apr_25(
106
+ # Founding Day of the Korean People's Revolutionary Army.
107
+ tr("조선인민혁명군 창건일")
108
+ if self._year >= 2018
109
+ # Armed Forces Day.
110
+ else tr("건군절")
111
+ )
112
+
113
+ # International Workers' Day.
114
+ self._add_labor_day(tr("전세계근로자들의 국제적명절"))
115
+
116
+ if self._year <= 1967:
117
+ # Dano.
118
+ self._add_dragon_boat_festival(tr("단오"))
119
+
120
+ # Foundation Day of the Korean Children's Union.
121
+ self._add_holiday_jun_6(tr("조선소년단 창립절"))
122
+
123
+ if self._year >= 1996:
124
+ # Day of Victory in the Great Fatherland Liberation War.
125
+ self._add_holiday_jul_27(tr("조국해방전쟁승리기념일"))
126
+
127
+ # Liberation Day.
128
+ self._add_holiday_aug_15(tr("조국해방절"))
129
+
130
+ if self._year <= 1966 or self._year >= 1989:
131
+ # Chuseok.
132
+ self._add_mid_autumn_festival(tr("추석"))
133
+
134
+ if self._year >= 2013:
135
+ # Day of Songun.
136
+ self._add_holiday_aug_25(tr("선군절"))
137
+
138
+ # Youth Day.
139
+ self._add_holiday_aug_28(tr("청년절"))
140
+
141
+ # Founding Day of the DPRK.
142
+ self._add_holiday_sep_9(tr("조선민주주의인민공화국창건일"))
143
+
144
+ # Foundation Day of the Workers' Party of Korea.
145
+ self._add_holiday_oct_10(tr("조선로동당창건일"))
146
+
147
+ if self._year >= 2012:
148
+ # Mother's Day.
149
+ self._add_holiday_nov_16(tr("어머니날"))
150
+
151
+ if self._year >= 1972:
152
+ # Socialist Constitution Day.
153
+ self._add_holiday_dec_27(tr("사회주의헌법절"))
154
+
155
+
156
+ class KP(NorthKorea):
157
+ pass
158
+
159
+
160
+ class PRK(NorthKorea):
161
+ pass
@@ -41,13 +41,17 @@ class Norway(HolidayBase, ChristianHolidays, InternationalHolidays):
41
41
  "18", # Nordland.
42
42
  "21", # Svalbard.
43
43
  "22", # Jan Mayen.
44
- "30", # Viken.
44
+ "31", # Østfold.
45
+ "32", # Akershus.
46
+ "33", # Buskerud.
45
47
  "34", # Innlandet.
46
- "38", # Vestfold og Telemark.
48
+ "39", # Vestfold.
49
+ "40", # Telemark.
47
50
  "42", # Agder.
48
51
  "46", # Vestland.
49
52
  "50", # Trøndelag (Trööndelage).
50
- "54", # Troms og Finnmark (Romssa ja Finnmárkku, Tromssan ja Finmarkun).
53
+ "55", # Troms (Romssa, Tromssan).
54
+ "56", # Finnmark (Finnmárkku, Finmarkun).
51
55
  )
52
56
  subdivisions_aliases = {
53
57
  "Oslo": "03",
@@ -56,18 +60,29 @@ class Norway(HolidayBase, ChristianHolidays, InternationalHolidays):
56
60
  "Nordland": "18",
57
61
  "Svalbard": "21",
58
62
  "Jan Mayen": "22",
59
- "Viken": "30",
63
+ "Østfold": "31",
64
+ "Akershus": "32",
65
+ "Buskerud": "33",
60
66
  "Innlandet": "34",
61
- "Vestfold og Telemark": "38",
67
+ "Vestfold": "39",
68
+ "Telemark": "40",
62
69
  "Agder": "42",
63
70
  "Vestland": "46",
64
71
  "Trööndelage": "50",
65
72
  "Trøndelag": "50",
66
- "Romssa ja Finnmárkku": "54",
67
- "Troms og Finnmark": "54",
68
- "Tromssan ja Finmarkun": "54",
73
+ "Romssa": "55",
74
+ "Troms": "55",
75
+ "Tromssan": "55",
76
+ "Finmarkun": "56",
77
+ "Finnmark": "56",
78
+ "Finnmárkku": "56",
69
79
  }
70
80
  supported_languages = ("en_US", "no", "th", "uk")
81
+ _deprecated_subdivisions = (
82
+ "30",
83
+ "38",
84
+ "54",
85
+ )
71
86
 
72
87
  def __init__(self, include_sundays: bool = False, *args, **kwargs):
73
88
  """
@@ -10,6 +10,7 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from datetime import date
13
14
  from gettext import gettext as tr
14
15
 
15
16
  from holidays.calendars import _CustomIslamicHolidays
@@ -17,6 +18,7 @@ from holidays.calendars.gregorian import (
17
18
  FEB,
18
19
  MAR,
19
20
  APR,
21
+ MAY,
20
22
  JUN,
21
23
  JUL,
22
24
  AUG,
@@ -49,6 +51,7 @@ class Oman(HolidayBase, IslamicHolidays):
49
51
  estimated_label = tr("%s (المقدرة)")
50
52
  start_year = 1970
51
53
  supported_languages = ("ar", "en_US")
54
+ weekend = {FRI, SAT}
52
55
 
53
56
  def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
54
57
  """
@@ -62,10 +65,11 @@ class Oman(HolidayBase, IslamicHolidays):
62
65
  )
63
66
  super().__init__(*args, **kwargs)
64
67
 
65
- def _populate_public_holidays(self):
68
+ def _get_weekend(self, dt: date) -> set[int]:
66
69
  # Oman switches from THU-FRI to FRI-SAT on May 1, 2013.
67
- self.weekend = {THU, FRI} if self._year <= 2013 else {FRI, SAT}
70
+ return {FRI, SAT} if dt >= date(2013, MAY, 1) else {THU, FRI}
68
71
 
72
+ def _populate_public_holidays(self):
69
73
  if self._year >= 2020:
70
74
  # Sultan's Accession Day.
71
75
  self._add_holiday_jan_11(tr("اليوم الوطني لتولي السلطان"))