holidays 0.26__py3-none-any.whl → 0.27__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 (256) hide show
  1. holidays/__init__.py +1 -1
  2. holidays/calendars/__init__.py +5 -7
  3. holidays/calendars/buddhist.py +1 -3
  4. holidays/calendars/chinese.py +1 -3
  5. holidays/calendars/custom.py +1 -3
  6. holidays/calendars/hindu.py +1 -3
  7. holidays/calendars/islamic.py +1341 -1345
  8. holidays/calendars/thai.py +217 -26
  9. holidays/countries/__init__.py +4 -0
  10. holidays/countries/albania.py +6 -17
  11. holidays/countries/andorra.py +2 -6
  12. holidays/countries/angola.py +53 -39
  13. holidays/countries/argentina.py +13 -24
  14. holidays/countries/aruba.py +109 -48
  15. holidays/countries/australia.py +31 -69
  16. holidays/countries/azerbaijan.py +30 -38
  17. holidays/countries/bahrain.py +5 -5
  18. holidays/countries/bangladesh.py +1 -3
  19. holidays/countries/belarus.py +1 -3
  20. holidays/countries/belize.py +4 -16
  21. holidays/countries/bolivia.py +2 -6
  22. holidays/countries/bosnia_and_herzegovina.py +5 -17
  23. holidays/countries/botswana.py +9 -18
  24. holidays/countries/brazil.py +2 -5
  25. holidays/countries/brunei.py +427 -0
  26. holidays/countries/bulgaria.py +2 -6
  27. holidays/countries/burkina_faso.py +141 -0
  28. holidays/countries/burundi.py +2 -5
  29. holidays/countries/cambodia.py +323 -0
  30. holidays/countries/cameroon.py +71 -77
  31. holidays/countries/canada.py +19 -28
  32. holidays/countries/chad.py +133 -0
  33. holidays/countries/chile.py +4 -11
  34. holidays/countries/china.py +1 -2
  35. holidays/countries/colombia.py +17 -15
  36. holidays/countries/costa_rica.py +2 -6
  37. holidays/countries/curacao.py +100 -46
  38. holidays/countries/cyprus.py +2 -6
  39. holidays/countries/czechia.py +4 -12
  40. holidays/countries/denmark.py +1 -3
  41. holidays/countries/dominican_republic.py +1 -3
  42. holidays/countries/ecuador.py +54 -54
  43. holidays/countries/egypt.py +2 -5
  44. holidays/countries/eswatini.py +34 -44
  45. holidays/countries/ethiopia.py +5 -14
  46. holidays/countries/finland.py +1 -3
  47. holidays/countries/gabon.py +49 -53
  48. holidays/countries/greece.py +1 -2
  49. holidays/countries/honduras.py +16 -13
  50. holidays/countries/hongkong.py +7 -8
  51. holidays/countries/hungary.py +93 -92
  52. holidays/countries/india.py +4 -11
  53. holidays/countries/indonesia.py +120 -114
  54. holidays/countries/ireland.py +5 -15
  55. holidays/countries/isle_of_man.py +9 -4
  56. holidays/countries/israel.py +6 -18
  57. holidays/countries/italy.py +1 -2
  58. holidays/countries/jamaica.py +10 -18
  59. holidays/countries/japan.py +10 -16
  60. holidays/countries/kazakhstan.py +7 -22
  61. holidays/countries/kenya.py +1 -3
  62. holidays/countries/kyrgyzstan.py +2 -5
  63. holidays/countries/latvia.py +2 -6
  64. holidays/countries/lesotho.py +52 -32
  65. holidays/countries/lithuania.py +4 -12
  66. holidays/countries/madagascar.py +3 -9
  67. holidays/countries/malawi.py +34 -26
  68. holidays/countries/malaysia.py +223 -248
  69. holidays/countries/marshall_islands.py +4 -9
  70. holidays/countries/mexico.py +1 -3
  71. holidays/countries/moldova.py +3 -6
  72. holidays/countries/monaco.py +16 -26
  73. holidays/countries/montenegro.py +23 -19
  74. holidays/countries/morocco.py +2 -5
  75. holidays/countries/mozambique.py +35 -31
  76. holidays/countries/namibia.py +54 -35
  77. holidays/countries/new_zealand.py +11 -21
  78. holidays/countries/nicaragua.py +26 -22
  79. holidays/countries/nigeria.py +6 -17
  80. holidays/countries/north_macedonia.py +3 -8
  81. holidays/countries/norway.py +1 -3
  82. holidays/countries/pakistan.py +71 -72
  83. holidays/countries/panama.py +25 -24
  84. holidays/countries/paraguay.py +54 -47
  85. holidays/countries/philippines.py +6 -2
  86. holidays/countries/poland.py +3 -9
  87. holidays/countries/portugal.py +3 -11
  88. holidays/countries/romania.py +3 -5
  89. holidays/countries/saudi_arabia.py +8 -22
  90. holidays/countries/serbia.py +19 -29
  91. holidays/countries/singapore.py +70 -74
  92. holidays/countries/slovakia.py +1 -4
  93. holidays/countries/south_africa.py +60 -62
  94. holidays/countries/south_korea.py +14 -23
  95. holidays/countries/spain.py +2 -5
  96. holidays/countries/sweden.py +1 -3
  97. holidays/countries/taiwan.py +2 -5
  98. holidays/countries/thailand.py +34 -81
  99. holidays/countries/turkey.py +1 -3
  100. holidays/countries/ukraine.py +6 -18
  101. holidays/countries/united_arab_emirates.py +21 -29
  102. holidays/countries/united_kingdom.py +47 -67
  103. holidays/countries/united_states.py +42 -72
  104. holidays/countries/vatican_city.py +1 -3
  105. holidays/countries/venezuela.py +8 -6
  106. holidays/countries/vietnam.py +6 -18
  107. holidays/countries/zambia.py +63 -33
  108. holidays/countries/zimbabwe.py +56 -37
  109. holidays/financial/european_central_bank.py +1 -3
  110. holidays/financial/ny_stock_exchange.py +31 -48
  111. holidays/groups/__init__.py +18 -0
  112. holidays/groups/buddhist.py +71 -0
  113. holidays/groups/chinese.py +235 -0
  114. holidays/groups/christian.py +483 -0
  115. holidays/groups/hindu.py +71 -0
  116. holidays/groups/international.py +157 -0
  117. holidays/groups/islamic.py +288 -0
  118. holidays/groups/thai.py +157 -0
  119. holidays/helpers.py +20 -0
  120. holidays/holiday_base.py +49 -75
  121. holidays/holiday_groups.py +11 -1190
  122. holidays/locale/am/LC_MESSAGES/ET.po +18 -15
  123. holidays/locale/ar/LC_MESSAGES/CA.po +43 -43
  124. holidays/locale/ar/LC_MESSAGES/ET.po +18 -15
  125. holidays/locale/ar/LC_MESSAGES/UA.po +16 -14
  126. holidays/locale/be/LC_MESSAGES/BY.po +9 -8
  127. holidays/locale/bg/LC_MESSAGES/BG.po +14 -12
  128. holidays/locale/da/LC_MESSAGES/DK.po +7 -6
  129. holidays/locale/el/LC_MESSAGES/CY.po +5 -3
  130. holidays/locale/el/LC_MESSAGES/GR.po +13 -13
  131. holidays/locale/en/LC_MESSAGES/CA.po +43 -43
  132. holidays/locale/en_US/LC_MESSAGES/AR.po +26 -25
  133. holidays/locale/en_US/LC_MESSAGES/AW.mo +0 -0
  134. holidays/locale/en_US/LC_MESSAGES/AW.po +87 -0
  135. holidays/locale/en_US/LC_MESSAGES/BG.po +14 -12
  136. holidays/locale/en_US/LC_MESSAGES/BN.mo +0 -0
  137. holidays/locale/en_US/LC_MESSAGES/BN.po +96 -0
  138. holidays/locale/en_US/LC_MESSAGES/BY.po +9 -8
  139. holidays/locale/en_US/LC_MESSAGES/CA.po +43 -43
  140. holidays/locale/en_US/LC_MESSAGES/CL.po +18 -18
  141. holidays/locale/en_US/LC_MESSAGES/CO.po +19 -19
  142. holidays/locale/en_US/LC_MESSAGES/CR.po +6 -5
  143. holidays/locale/en_US/LC_MESSAGES/CW.mo +0 -0
  144. holidays/locale/en_US/LC_MESSAGES/CW.po +82 -0
  145. holidays/locale/en_US/LC_MESSAGES/CY.po +5 -3
  146. holidays/locale/en_US/LC_MESSAGES/DK.po +7 -6
  147. holidays/locale/en_US/LC_MESSAGES/DO.po +12 -12
  148. holidays/locale/en_US/LC_MESSAGES/EC.po +11 -12
  149. holidays/locale/en_US/LC_MESSAGES/ET.po +18 -15
  150. holidays/locale/en_US/LC_MESSAGES/FI.po +13 -13
  151. holidays/locale/en_US/LC_MESSAGES/GR.po +13 -13
  152. holidays/locale/en_US/LC_MESSAGES/HN.mo +0 -0
  153. holidays/locale/en_US/LC_MESSAGES/HN.po +13 -13
  154. holidays/locale/en_US/LC_MESSAGES/HU.mo +0 -0
  155. holidays/locale/en_US/LC_MESSAGES/HU.po +109 -0
  156. holidays/locale/en_US/LC_MESSAGES/JP.po +19 -17
  157. holidays/locale/en_US/LC_MESSAGES/KH.mo +0 -0
  158. holidays/locale/en_US/LC_MESSAGES/KH.po +139 -0
  159. holidays/locale/en_US/LC_MESSAGES/MC.mo +0 -0
  160. holidays/locale/en_US/LC_MESSAGES/MC.po +16 -15
  161. holidays/locale/en_US/LC_MESSAGES/MD.po +5 -5
  162. holidays/locale/en_US/LC_MESSAGES/MX.po +3 -2
  163. holidays/locale/en_US/LC_MESSAGES/NI.mo +0 -0
  164. holidays/locale/en_US/LC_MESSAGES/NI.po +13 -13
  165. holidays/locale/en_US/LC_MESSAGES/NO.po +1 -1
  166. holidays/locale/en_US/LC_MESSAGES/PL.po +23 -21
  167. holidays/locale/en_US/LC_MESSAGES/PT.po +31 -31
  168. holidays/locale/en_US/LC_MESSAGES/PY.po +13 -11
  169. holidays/locale/en_US/LC_MESSAGES/RO.po +4 -3
  170. holidays/locale/en_US/LC_MESSAGES/RS.po +10 -10
  171. holidays/locale/en_US/LC_MESSAGES/SE.po +1 -1
  172. holidays/locale/en_US/LC_MESSAGES/SK.po +14 -14
  173. holidays/locale/en_US/LC_MESSAGES/TH.po +41 -41
  174. holidays/locale/en_US/LC_MESSAGES/UA.po +16 -14
  175. holidays/locale/en_US/LC_MESSAGES/VE.po +6 -6
  176. holidays/locale/es/LC_MESSAGES/AR.po +26 -25
  177. holidays/locale/es/LC_MESSAGES/CL.po +18 -18
  178. holidays/locale/es/LC_MESSAGES/CO.po +19 -19
  179. holidays/locale/es/LC_MESSAGES/CR.po +6 -5
  180. holidays/locale/es/LC_MESSAGES/DO.po +12 -12
  181. holidays/locale/es/LC_MESSAGES/EC.po +11 -12
  182. holidays/locale/es/LC_MESSAGES/HN.po +12 -12
  183. holidays/locale/es/LC_MESSAGES/MX.po +3 -2
  184. holidays/locale/es/LC_MESSAGES/NI.po +10 -10
  185. holidays/locale/es/LC_MESSAGES/PY.po +13 -11
  186. holidays/locale/es/LC_MESSAGES/VE.po +6 -6
  187. holidays/locale/fi/LC_MESSAGES/FI.po +13 -13
  188. holidays/locale/fr/LC_MESSAGES/CA.po +43 -43
  189. holidays/locale/fr/LC_MESSAGES/MC.po +15 -14
  190. holidays/locale/hu/LC_MESSAGES/HU.mo +0 -0
  191. holidays/locale/hu/LC_MESSAGES/HU.po +109 -0
  192. holidays/locale/ja/LC_MESSAGES/JP.po +19 -17
  193. holidays/locale/km/LC_MESSAGES/KH.mo +0 -0
  194. holidays/locale/km/LC_MESSAGES/KH.po +139 -0
  195. holidays/locale/ms/LC_MESSAGES/BN.mo +0 -0
  196. holidays/locale/ms/LC_MESSAGES/BN.po +96 -0
  197. holidays/locale/nl/LC_MESSAGES/AW.mo +0 -0
  198. holidays/locale/nl/LC_MESSAGES/AW.po +87 -0
  199. holidays/locale/nl/LC_MESSAGES/CW.mo +0 -0
  200. holidays/locale/nl/LC_MESSAGES/CW.po +82 -0
  201. holidays/locale/no/LC_MESSAGES/NO.po +1 -1
  202. holidays/locale/pap/LC_MESSAGES/AW.mo +0 -0
  203. holidays/locale/pap/LC_MESSAGES/AW.po +87 -0
  204. holidays/locale/pap/LC_MESSAGES/CW.mo +0 -0
  205. holidays/locale/pap/LC_MESSAGES/CW.po +82 -0
  206. holidays/locale/pl/LC_MESSAGES/PL.po +23 -21
  207. holidays/locale/pt_PT/LC_MESSAGES/PT.po +31 -31
  208. holidays/locale/ro/LC_MESSAGES/MD.po +5 -5
  209. holidays/locale/ro/LC_MESSAGES/RO.po +4 -3
  210. holidays/locale/sk/LC_MESSAGES/SK.po +14 -14
  211. holidays/locale/sr/LC_MESSAGES/RS.po +10 -10
  212. holidays/locale/sv/LC_MESSAGES/FI.po +13 -13
  213. holidays/locale/sv/LC_MESSAGES/SE.po +1 -1
  214. holidays/locale/th/LC_MESSAGES/BN.mo +0 -0
  215. holidays/locale/th/LC_MESSAGES/BN.po +96 -0
  216. holidays/locale/th/LC_MESSAGES/CA.po +43 -43
  217. holidays/locale/th/LC_MESSAGES/KH.mo +0 -0
  218. holidays/locale/th/LC_MESSAGES/KH.po +145 -0
  219. holidays/locale/th/LC_MESSAGES/TH.po +41 -41
  220. holidays/locale/uk/LC_MESSAGES/AR.po +26 -25
  221. holidays/locale/uk/LC_MESSAGES/AW.mo +0 -0
  222. holidays/locale/uk/LC_MESSAGES/AW.po +87 -0
  223. holidays/locale/uk/LC_MESSAGES/CL.po +18 -18
  224. holidays/locale/uk/LC_MESSAGES/CO.po +19 -19
  225. holidays/locale/uk/LC_MESSAGES/CR.po +6 -5
  226. holidays/locale/uk/LC_MESSAGES/CW.mo +0 -0
  227. holidays/locale/uk/LC_MESSAGES/CW.po +82 -0
  228. holidays/locale/uk/LC_MESSAGES/DK.po +7 -6
  229. holidays/locale/uk/LC_MESSAGES/DO.po +12 -12
  230. holidays/locale/uk/LC_MESSAGES/EC.po +11 -12
  231. holidays/locale/uk/LC_MESSAGES/FI.po +13 -13
  232. holidays/locale/uk/LC_MESSAGES/HN.mo +0 -0
  233. holidays/locale/uk/LC_MESSAGES/HN.po +13 -13
  234. holidays/locale/uk/LC_MESSAGES/HU.mo +0 -0
  235. holidays/locale/uk/LC_MESSAGES/HU.po +109 -0
  236. holidays/locale/uk/LC_MESSAGES/MC.po +15 -14
  237. holidays/locale/uk/LC_MESSAGES/MD.po +5 -5
  238. holidays/locale/uk/LC_MESSAGES/MX.po +3 -2
  239. holidays/locale/uk/LC_MESSAGES/NI.mo +0 -0
  240. holidays/locale/uk/LC_MESSAGES/NI.po +13 -13
  241. holidays/locale/uk/LC_MESSAGES/NO.po +1 -1
  242. holidays/locale/uk/LC_MESSAGES/PL.po +23 -21
  243. holidays/locale/uk/LC_MESSAGES/PY.po +13 -11
  244. holidays/locale/uk/LC_MESSAGES/RO.po +4 -3
  245. holidays/locale/uk/LC_MESSAGES/SE.po +1 -1
  246. holidays/locale/uk/LC_MESSAGES/SK.po +14 -14
  247. holidays/locale/uk/LC_MESSAGES/UA.po +16 -14
  248. holidays/locale/uk/LC_MESSAGES/VE.po +6 -6
  249. holidays/registry.py +7 -11
  250. holidays/utils.py +5 -15
  251. {holidays-0.26.dist-info → holidays-0.27.dist-info}/METADATA +25 -7
  252. holidays-0.27.dist-info/RECORD +449 -0
  253. holidays-0.26.dist-info/RECORD +0 -402
  254. {holidays-0.26.dist-info → holidays-0.27.dist-info}/LICENSE +0 -0
  255. {holidays-0.26.dist-info → holidays-0.27.dist-info}/WHEEL +0 -0
  256. {holidays-0.26.dist-info → holidays-0.27.dist-info}/top_level.txt +0 -0
@@ -13,19 +13,16 @@ from datetime import date
13
13
  from datetime import timedelta as td
14
14
  from gettext import gettext as tr
15
15
 
16
- from holidays.calendars import _ThaiLunisolar
17
- from holidays.constants import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP
18
- from holidays.constants import OCT, NOV, DEC
16
+ from holidays.constants import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
19
17
  from holidays.holiday_base import HolidayBase
20
- from holidays.holiday_groups import InternationalHolidays
18
+ from holidays.holiday_groups import InternationalHolidays, ThaiCalendarHolidays
21
19
 
22
20
 
23
- class Thailand(HolidayBase, InternationalHolidays):
21
+ class Thailand(HolidayBase, InternationalHolidays, ThaiCalendarHolidays):
24
22
  """
25
23
  A subclass of :py:class:`HolidayBase` representing public holidays
26
24
  in Thailand. (Based on South Korean and Singaporean Implementation)
27
25
 
28
-
29
26
  References:
30
27
 
31
28
  - Based on: https://en.wikipedia.org/wiki/Public_holidays_in_Thailand
@@ -125,20 +122,13 @@ class Thailand(HolidayBase, InternationalHolidays):
125
122
  # Special Cases.
126
123
 
127
124
  rama_ix_golden_jubilee = tr("พระราชพิธีกาญจนาภิเษก พ.ศ. 2539")
128
- rama_ix_sixty_accession = tr(
129
- "พระราชพิธีฉลองสิริราชสมบัติครบ 60 ปี พ.ศ. 2549"
130
- )
125
+ rama_ix_sixty_accession = tr("พระราชพิธีฉลองสิริราชสมบัติครบ 60 ปี พ.ศ. 2549")
131
126
  thai_military_emergency_lockdown = tr("วันหยุดพิเศษ (คมช.)")
132
127
  thai_political_emergency_lockdown = tr("วันหยุดพิเศษ (การเมือง)")
133
- thai_flood_2011_emergency_lockdown = tr(
134
- "วันหยุดพิเศษ (มหาอุทกภัย พ.ศ. 2554)"
135
- )
136
- rama_ix_mourning = tr(
137
- "วันหยุดพิเศษ (ร่วมถวายอาลัย ส่งดวงพระวิญญาณพระบรมศพ)"
138
- )
128
+ thai_flood_2011_emergency_lockdown = tr("วันหยุดพิเศษ (มหาอุทกภัย พ.ศ. 2554)")
129
+ rama_ix_mourning = tr("วันหยุดพิเศษ (ร่วมถวายอาลัย ส่งดวงพระวิญญาณพระบรมศพ)")
139
130
  rama_ix_cremation = tr(
140
- "วันพระราชพิธีถวายพระเพลิงพระบรมศพ"
141
- "พระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช"
131
+ "วันพระราชพิธีถวายพระเพลิงพระบรมศพพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช"
142
132
  )
143
133
  rama_x_coronation_celebrations = tr(
144
134
  "พระราชพิธีบรมราชาภิเษก พระบาทสมเด็จพระวชิรเกล้าเจ้าอยู่หัว"
@@ -165,7 +155,7 @@ class Thailand(HolidayBase, InternationalHolidays):
165
155
  (DEC, 12, thai_special_in_lieu_holidays),
166
156
  ),
167
157
  # 1995-1997 (Bank of Thailand Data).
168
- 1996: ((JUN, 10, rama_ix_golden_jubilee),),
158
+ 1996: (JUN, 10, rama_ix_golden_jubilee),
169
159
  # 1998-2000 (include In Lieus, Checked with Bank of Thailand Data).
170
160
  1998: (
171
161
  (MAY, 11, thai_special_in_lieu_holidays),
@@ -192,7 +182,7 @@ class Thailand(HolidayBase, InternationalHolidays):
192
182
  (JUN, 13, rama_ix_sixty_accession),
193
183
  (SEP, 20, thai_military_emergency_lockdown),
194
184
  ),
195
- 2007: ((DEC, 24, thai_election_in_lieu),),
185
+ 2007: (DEC, 24, thai_election_in_lieu),
196
186
  2009: (
197
187
  (JAN, 2, thai_bridge_public_holiday),
198
188
  (APR, 10, thai_political_emergency_lockdown),
@@ -213,9 +203,9 @@ class Thailand(HolidayBase, InternationalHolidays):
213
203
  (OCT, 30, thai_flood_2011_emergency_lockdown),
214
204
  (OCT, 31, thai_flood_2011_emergency_lockdown),
215
205
  ),
216
- 2012: ((APR, 9, thai_bridge_public_holiday),),
217
- 2013: ((DEC, 30, thai_bridge_public_holiday),),
218
- 2014: ((AUG, 11, thai_bridge_public_holiday),),
206
+ 2012: (APR, 9, thai_bridge_public_holiday),
207
+ 2013: (DEC, 30, thai_bridge_public_holiday),
208
+ 2014: (AUG, 11, thai_bridge_public_holiday),
219
209
  2015: (
220
210
  (JAN, 2, thai_bridge_public_holiday),
221
211
  (MAY, 4, thai_bridge_public_holiday),
@@ -225,8 +215,8 @@ class Thailand(HolidayBase, InternationalHolidays):
225
215
  (JUL, 18, thai_bridge_public_holiday),
226
216
  (OCT, 14, rama_ix_mourning),
227
217
  ),
228
- 2017: ((OCT, 26, rama_ix_cremation),),
229
- 2019: ((MAY, 6, rama_x_coronation_celebrations),),
218
+ 2017: (OCT, 26, rama_ix_cremation),
219
+ 2019: (MAY, 6, rama_x_coronation_celebrations),
230
220
  2020: (
231
221
  (JUL, 27, songkran_festival_in_lieu_covid),
232
222
  (SEP, 4, songkran_festival_in_lieu_covid),
@@ -246,13 +236,13 @@ class Thailand(HolidayBase, InternationalHolidays):
246
236
  (OCT, 14, thai_bridge_public_holiday),
247
237
  (DEC, 30, thai_bridge_public_holiday),
248
238
  ),
249
- 2023: ((MAY, 5, thai_bridge_public_holiday),),
239
+ 2023: (MAY, 5, thai_bridge_public_holiday),
250
240
  }
251
241
  supported_languages = ("en_US", "th")
252
242
 
253
243
  def __init__(self, **kwargs) -> None:
254
244
  InternationalHolidays.__init__(self)
255
- self.thls = _ThaiLunisolar()
245
+ ThaiCalendarHolidays.__init__(self)
256
246
  super().__init__(**kwargs)
257
247
 
258
248
  def _populate(self, year):
@@ -282,11 +272,7 @@ class Thailand(HolidayBase, InternationalHolidays):
282
272
  if (
283
273
  self.observed
284
274
  and self._is_weekend(dt)
285
- and (
286
- 1961 <= year <= 1973
287
- or 1995 <= year <= 1997
288
- or year >= 2001
289
- )
275
+ and (1961 <= year <= 1973 or 1995 <= year <= 1997 or year >= 2001)
290
276
  ):
291
277
  in_lieu = dt + td(days=+2 if self._is_saturday(dt) else +1)
292
278
  for name in self.get_list(dt):
@@ -347,9 +333,7 @@ class Thailand(HolidayBase, InternationalHolidays):
347
333
  if year >= 1948:
348
334
  songkran_festival = tr("วันสงกรานต์")
349
335
  if year <= 1953 or (1957 <= year != 2020):
350
- dt = self._add_holiday(
351
- songkran_festival, APR, 12 if 1989 <= year <= 1997 else 13
352
- )
336
+ dt = self._add_holiday(songkran_festival, APR, 12 if 1989 <= year <= 1997 else 13)
353
337
  if 1957 <= year <= 1988:
354
338
  _add_observed(dt)
355
339
  else:
@@ -368,17 +352,11 @@ class Thailand(HolidayBase, InternationalHolidays):
368
352
 
369
353
  songkran_festival_in_lieu = self.tr("ชดเชย%s") % songkran_festival
370
354
 
371
- if self.observed and (
372
- 1995 <= year <= 1997 or 2001 <= year != 2020
373
- ):
355
+ if self.observed and (1995 <= year <= 1997 or 2001 <= year != 2020):
374
356
  if self._is_thursday(dt):
375
- self._add_holiday(
376
- songkran_festival_in_lieu, dt + td(days=+4)
377
- )
357
+ self._add_holiday(songkran_festival_in_lieu, dt + td(days=+4))
378
358
  elif self._is_friday(dt) or self._is_saturday(dt):
379
- self._add_holiday(
380
- songkran_festival_in_lieu, dt + td(days=+3)
381
- )
359
+ self._add_holiday(songkran_festival_in_lieu, dt + td(days=+3))
382
360
 
383
361
  # National Labour day.
384
362
  # วันแรงงานแห่งชาติ
@@ -398,11 +376,7 @@ class Thailand(HolidayBase, InternationalHolidays):
398
376
  # Replaced by Rama IX's birthday in 1960 (B.E. 2503) by Sarit Thanarat.
399
377
  # TODO: Add check for 1939 if we support earlier dates.
400
378
 
401
- _add_observed(
402
- self._add_holiday(
403
- tr("วันชาติ"), *((JUN, 24) if year <= 1959 else (DEC, 5))
404
- )
405
- )
379
+ _add_observed(self._add_holiday(tr("วันชาติ"), *((JUN, 24) if year <= 1959 else (DEC, 5))))
406
380
 
407
381
  # Coronation Day.
408
382
  # วันฉัตรมงคล
@@ -464,10 +438,7 @@ class Thailand(HolidayBase, InternationalHolidays):
464
438
  name = (
465
439
  tr("วันเฉลิมพระชนมพรรษาสมเด็จพระบรมราชชนนีพันปีหลวง")
466
440
  if year >= 2017
467
- else tr(
468
- "วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ "
469
- "พระบรมราชินีนาถ"
470
- )
441
+ else tr("วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถ")
471
442
  )
472
443
  _add_observed(self._add_holiday(name, AUG, 12))
473
444
 
@@ -499,10 +470,7 @@ class Thailand(HolidayBase, InternationalHolidays):
499
470
  "มหาภูมิพลอดุลยเดชมหาราช บรมนาถบพิตร"
500
471
  )
501
472
  if year >= 2019
502
- else tr(
503
- "วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพล"
504
- "อดุลยเดช บรมนาถบพิตร"
505
- )
473
+ else tr("วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร")
506
474
  )
507
475
  _add_observed(self._add_holiday(name, OCT, 13))
508
476
 
@@ -536,8 +504,7 @@ class Thailand(HolidayBase, InternationalHolidays):
536
504
  )
537
505
  if year >= 2016
538
506
  else tr(
539
- "วันเฉลิมพระชนมพรรษา"
540
- "พระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร"
507
+ "วันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร"
541
508
  )
542
509
  )
543
510
  )
@@ -573,50 +540,38 @@ class Thailand(HolidayBase, InternationalHolidays):
573
540
  self._add_new_years_eve(tr("วันสิ้นปี"))
574
541
 
575
542
  # Thai Lunar Calendar Holidays
543
+ # See `_ThaiLunisolar` in holidays/utils.py for more details.
544
+ # Thai Lunar Calendar Holidays only work from 1941 to 2057.
576
545
 
577
- """
578
- See `_ThaiLunisolar` in holidays/utils.py for more details.
579
-
580
- Thai Lunar Calendar Holidays only work from 1941 (B.E. 2484) onwards
581
- until 2057 (B.E. 2600).
582
- """
583
546
  # Makha Bucha.
584
547
  # วันมาฆบูชา
585
548
  # Status: In-Use.
586
549
 
587
- makha_bucha_date = self.thls.makha_bucha_date(year)
550
+ makha_bucha_date = self._add_makha_bucha(tr("วันมาฆบูชา"))
588
551
  if makha_bucha_date:
589
- _add_observed(
590
- self._add_holiday(tr("วันมาฆบูชา"), makha_bucha_date)
591
- )
552
+ _add_observed(makha_bucha_date)
592
553
 
593
554
  # Visakha Bucha.
594
555
  # วันวิสาขบูชา
595
556
  # Status: In-Use.
596
557
 
597
- visakha_bucha_date = self.thls.visakha_bucha_date(year)
558
+ visakha_bucha_date = self._add_visakha_bucha(tr("วันวิสาขบูชา"))
598
559
  if visakha_bucha_date:
599
- _add_observed(
600
- self._add_holiday(tr("วันวิสาขบูชา"), visakha_bucha_date)
601
- )
560
+ _add_observed(visakha_bucha_date)
602
561
 
603
562
  # Asarnha Bucha.
604
563
  # วันอาสาฬหบูชา
605
564
  # Status: In-Use.
606
565
  # This has its own in-lieu trigger.
607
566
 
608
- asarnha_bucha_date = self.thls.asarnha_bucha_date(year)
609
- if asarnha_bucha_date:
610
- self._add_holiday(tr("วันอาสาฬหบูชา"), asarnha_bucha_date)
567
+ asarnha_bucha_date = self._add_asarnha_bucha(tr("วันอาสาฬหบูชา"))
611
568
 
612
569
  # Buddhist Lent Day.
613
570
  # วันเข้าพรรษา
614
571
  # Status: In-Use.
615
572
  # This has its own in-lieu trigger.
616
573
 
617
- khao_phansa_date = self.thls.khao_phansa_date(year)
618
- if khao_phansa_date:
619
- self._add_holiday(tr("วันเข้าพรรษา"), khao_phansa_date)
574
+ self._add_khao_phansa(tr("วันเข้าพรรษา"))
620
575
 
621
576
  # Asarnha Bucha/Buddhist Lent Day (in lieu).
622
577
  # วันหยุดชดเชยวันอาสาฬหบูชา
@@ -688,9 +643,7 @@ class Thailand(HolidayBase, InternationalHolidays):
688
643
  }
689
644
  # For years with exact date data.
690
645
  if year in raeknakhwan_dates:
691
- _add_observed(
692
- self._add_holiday(raeknakhwan, *raeknakhwan_dates[year])
693
- )
646
+ _add_observed(self._add_holiday(raeknakhwan, *raeknakhwan_dates[year]))
694
647
  # Approx. otherwise for 1957-2013.
695
648
  elif 1957 <= year <= 1996:
696
649
  _add_observed(self._add_holiday(raeknakhwan, MAY, 13))
@@ -39,9 +39,7 @@ class Turkey(HolidayBase, IslamicHolidays, InternationalHolidays):
39
39
  self._add_labor_day("Labour Day")
40
40
 
41
41
  # 19th of May.
42
- self._add_holiday(
43
- "Commemoration of Ataturk, Youth and Sports Day", MAY, 19
44
- )
42
+ self._add_holiday("Commemoration of Ataturk, Youth and Sports Day", MAY, 19)
45
43
 
46
44
  # 15th of Jul.
47
45
  # Became a national holiday after 15 Jul 2016 coup d'etat attempt.
@@ -59,17 +59,13 @@ class Ukraine(HolidayBase, ChristianHolidays, InternationalHolidays):
59
59
  )
60
60
 
61
61
  # International Women's Day.
62
- observed_dates.add(
63
- self._add_womens_day(tr("Міжнародний жіночий день"))
64
- )
62
+ observed_dates.add(self._add_womens_day(tr("Міжнародний жіночий день")))
65
63
 
66
64
  # There is no holidays from March 15, 2022
67
65
  # https://zakon.rada.gov.ua/laws/show/2136-20#n26
68
66
  if year <= 2021:
69
67
  # Easter Sunday (Pascha).
70
- observed_dates.add(
71
- self._add_easter_sunday(tr("Великдень (Пасха)"))
72
- )
68
+ observed_dates.add(self._add_easter_sunday(tr("Великдень (Пасха)")))
73
69
 
74
70
  # Holy Trinity Day.
75
71
  observed_dates.add(self._add_whit_sunday(tr("Трійця")))
@@ -84,16 +80,11 @@ class Ukraine(HolidayBase, ChristianHolidays, InternationalHolidays):
84
80
  may_1 = self._add_labor_day(name)
85
81
  observed_dates.add(may_1)
86
82
  if year <= 2017:
87
- observed_dates.add(
88
- self._add_holiday(name, may_1 + td(days=+1))
89
- )
83
+ observed_dates.add(self._add_holiday(name, may_1 + td(days=+1)))
90
84
 
91
85
  name = (
92
86
  # Day of Victory over Nazism in World War II (Victory Day).
93
- tr(
94
- "День перемоги над нацизмом у Другій світовій війні "
95
- "(День перемоги)"
96
- )
87
+ tr("День перемоги над нацизмом у Другій світовій війні (День перемоги)")
97
88
  if year >= 2016
98
89
  # Victory Day.
99
90
  else tr("День перемоги")
@@ -147,12 +138,9 @@ class Ukraine(HolidayBase, ChristianHolidays, InternationalHolidays):
147
138
  if self.observed:
148
139
  for dt in sorted(observed_dates):
149
140
  if self._is_weekend(dt) and (
150
- date(1995, JAN, 27) <= dt <= date(1998, JAN, 9)
151
- or dt >= date(1999, APR, 23)
141
+ date(1995, JAN, 27) <= dt <= date(1998, JAN, 9) or dt >= date(1999, APR, 23)
152
142
  ):
153
- obs_date = dt + td(
154
- days=+2 if self._is_saturday(dt) else +1
155
- )
143
+ obs_date = dt + td(days=+2 if self._is_saturday(dt) else +1)
156
144
  while obs_date in self:
157
145
  obs_date += td(days=+1)
158
146
  hol_name = self.tr("%s (вихідний)") % self[dt]
@@ -43,9 +43,7 @@ class UnitedArabEmirates(HolidayBase, InternationalHolidays, IslamicHolidays):
43
43
 
44
44
  def __init__(self, *args, **kwargs):
45
45
  InternationalHolidays.__init__(self)
46
- IslamicHolidays.__init__(
47
- self, calendar=UnitedArabEmiratesIslamicCalendar()
48
- )
46
+ IslamicHolidays.__init__(self, calendar=UnitedArabEmiratesIslamicCalendar())
49
47
  super().__init__(*args, **kwargs)
50
48
 
51
49
  def _populate(self, year):
@@ -56,9 +54,7 @@ class UnitedArabEmirates(HolidayBase, InternationalHolidays, IslamicHolidays):
56
54
 
57
55
  # Commemoration Day.
58
56
  if year >= 2015:
59
- self._add_holiday(
60
- "Commemoration Day", *((DEC, 1) if year >= 2019 else (NOV, 30))
61
- )
57
+ self._add_holiday("Commemoration Day", *((DEC, 1) if year >= 2019 else (NOV, 30)))
62
58
 
63
59
  # National Day.
64
60
  self._add_holiday("National Day", DEC, 2)
@@ -83,15 +79,11 @@ class UnitedArabEmirates(HolidayBase, InternationalHolidays, IslamicHolidays):
83
79
 
84
80
  # Leilat al-Miraj.
85
81
  if year <= 2018: # The UAE government removed this starting 2019.
86
- self._add_isra_and_miraj_day(
87
- "Leilat al-Miraj - The Prophet's ascension"
88
- )
82
+ self._add_isra_and_miraj_day("Leilat al-Miraj - The Prophet's ascension")
89
83
 
90
84
  # Prophet Muhammad's Birthday.
91
85
  if year <= 2019: # The UAE government removed this starting 2020.
92
- self._add_mawlid_day(
93
- "Mawlud al-Nabi - Prophet Mohammad's Birthday"
94
- )
86
+ self._add_mawlid_day("Mawlud al-Nabi - Prophet Mohammad's Birthday")
95
87
 
96
88
 
97
89
  class AE(UnitedArabEmirates):
@@ -104,33 +96,33 @@ class ARE(UnitedArabEmirates):
104
96
 
105
97
  class UnitedArabEmiratesIslamicCalendar(_CustomIslamicCalendar):
106
98
  EID_AL_ADHA_DATES = {
107
- 2017: ((SEP, 1),),
108
- 2018: ((AUG, 21),),
109
- 2019: ((AUG, 11),),
110
- 2020: ((JUL, 31),),
99
+ 2017: (SEP, 1),
100
+ 2018: (AUG, 21),
101
+ 2019: (AUG, 11),
102
+ 2020: (JUL, 31),
111
103
  }
112
104
 
113
105
  EID_AL_FITR_DATES = {
114
- 2017: ((JUN, 25),),
115
- 2018: ((JUN, 14),),
116
- 2019: ((JUN, 3),),
117
- 2020: ((MAY, 24),),
106
+ 2017: (JUN, 25),
107
+ 2018: (JUN, 14),
108
+ 2019: (JUN, 3),
109
+ 2020: (MAY, 24),
118
110
  }
119
111
 
120
112
  HIJRI_NEW_YEAR_DATES = {
121
- 2017: ((SEP, 22),),
122
- 2018: ((SEP, 11),),
123
- 2019: ((AUG, 31),),
124
- 2020: ((AUG, 23),),
113
+ 2017: (SEP, 22),
114
+ 2018: (SEP, 11),
115
+ 2019: (AUG, 31),
116
+ 2020: (AUG, 23),
125
117
  }
126
118
 
127
119
  ISRA_AND_MIRAJ_DATES = {
128
- 2017: ((APR, 23),),
129
- 2018: ((APR, 13),),
120
+ 2017: (APR, 23),
121
+ 2018: (APR, 13),
130
122
  }
131
123
 
132
124
  MAWLID_DATES = {
133
- 2017: ((NOV, 30),),
134
- 2018: ((NOV, 19),),
135
- 2019: ((NOV, 9),),
125
+ 2017: (NOV, 30),
126
+ 2018: (NOV, 19),
127
+ 2019: (NOV, 9),
136
128
  }
@@ -13,7 +13,7 @@ from datetime import date
13
13
  from datetime import timedelta as td
14
14
  from typing import Tuple, Union
15
15
 
16
- from holidays.calendars import _get_nth_weekday_from, _get_nth_weekday_of_month
16
+ from holidays.calendars import _get_nth_weekday_of_month
17
17
  from holidays.constants import MAR, APR, MAY, JUN, JUL, AUG, SEP, NOV, DEC, MON
18
18
  from holidays.holiday_base import HolidayBase
19
19
  from holidays.holiday_groups import ChristianHolidays, InternationalHolidays
@@ -26,19 +26,25 @@ class UnitedKingdom(HolidayBase, ChristianHolidays, InternationalHolidays):
26
26
 
27
27
  country = "GB"
28
28
  special_holidays = {
29
- 1977: ((JUN, 7, "Silver Jubilee of Elizabeth II"),),
30
- 1981: ((JUL, 29, "Wedding of Charles and Diana"),),
31
- 1999: ((DEC, 31, "Millennium Celebrations"),),
32
- 2002: ((JUN, 3, "Golden Jubilee of Elizabeth II"),),
33
- 2011: ((APR, 29, "Wedding of William and Catherine"),),
34
- 2012: ((JUN, 5, "Diamond Jubilee of Elizabeth II"),),
29
+ 1977: (JUN, 7, "Silver Jubilee of Elizabeth II"),
30
+ 1981: (JUL, 29, "Wedding of Charles and Diana"),
31
+ 1999: (DEC, 31, "Millennium Celebrations"),
32
+ 2002: (JUN, 3, "Golden Jubilee of Elizabeth II"),
33
+ 2011: (APR, 29, "Wedding of William and Catherine"),
34
+ 2012: (JUN, 5, "Diamond Jubilee of Elizabeth II"),
35
35
  2022: (
36
36
  (JUN, 3, "Platinum Jubilee of Elizabeth II"),
37
37
  (SEP, 19, "State Funeral of Queen Elizabeth II"),
38
38
  ),
39
- 2023: ((MAY, 8, "Coronation of Charles III"),),
39
+ 2023: (MAY, 8, "Coronation of Charles III"),
40
40
  }
41
41
  subdivisions: Union[Tuple[()], Tuple[str, ...]] = (
42
+ "ENG", # England
43
+ "NIR", # Northern Ireland
44
+ "SCT", # Scotland
45
+ "WLS", # Wales
46
+ )
47
+ _deprecated_subdivisions: Tuple[str, ...] = (
42
48
  "England",
43
49
  "Northern Ireland",
44
50
  "Scotland",
@@ -49,17 +55,14 @@ class UnitedKingdom(HolidayBase, ChristianHolidays, InternationalHolidays):
49
55
  def __init__(self, *args, **kwargs):
50
56
  ChristianHolidays.__init__(self)
51
57
  InternationalHolidays.__init__(self)
52
- # default subdiv to UK; state for backwards compatibility
53
- if not kwargs.get("subdiv", kwargs.get("state")):
54
- kwargs["subdiv"] = "UK"
55
58
  super().__init__(*args, **kwargs)
56
59
 
57
- def _add_observed(self, dt: date) -> None:
60
+ def _add_observed(self, dt: date, days: int = +1) -> None:
58
61
  if self.observed and self._is_weekend(dt):
59
- obs_date = _get_nth_weekday_from(1, MON, dt)
60
- if obs_date in self:
61
- obs_date += td(days=+1)
62
- self._add_holiday("%s (Observed)" % self[dt], obs_date)
62
+ self._add_holiday(
63
+ "%s (Observed)" % self[dt],
64
+ dt + td(days=+2 if self._is_saturday(dt) else days),
65
+ )
63
66
 
64
67
  def _populate(self, year: int) -> None:
65
68
  super()._populate(year)
@@ -84,28 +87,33 @@ class UnitedKingdom(HolidayBase, ChristianHolidays, InternationalHolidays):
84
87
  2012: date(year, JUN, 4),
85
88
  2022: date(year, JUN, 2),
86
89
  }
87
- dt = spring_bank_dates.get(
88
- year, _get_nth_weekday_of_month(-1, MON, MAY, year)
89
- )
90
+ dt = spring_bank_dates.get(year, _get_nth_weekday_of_month(-1, MON, MAY, year))
90
91
  self._add_holiday("Spring Bank Holiday", dt)
91
92
 
92
93
  # Christmas Day
93
- dec_25 = self._add_christmas_day("Christmas Day")
94
+ self._add_observed(self._add_christmas_day("Christmas Day"), days=+2)
94
95
 
95
96
  # Boxing Day
96
- dec_26 = self._add_christmas_day_two("Boxing Day")
97
+ self._add_observed(self._add_christmas_day_two("Boxing Day"), days=+2)
97
98
 
98
- self._add_observed(dec_25)
99
- self._add_observed(dec_26)
99
+ if self.subdiv == "England":
100
+ self._add_subdiv_eng_holidays()
101
+ elif self.subdiv == "Northern Ireland":
102
+ self._add_subdiv_nir_holidays()
103
+ elif self.subdiv == "Scotland":
104
+ self._add_subdiv_sct_holidays()
105
+ elif self.subdiv == "Wales":
106
+ self._add_subdiv_wls_holidays()
100
107
 
101
108
  def _add_subdiv_holidays(self):
102
- # New Year's Day
103
- if self._year >= 1974:
104
- self._add_observed(self._add_new_years_day("New Year's Day"))
109
+ if self.subdiv not in {"SCT", "Scotland"}:
110
+ # New Year's Day
111
+ if self._year >= 1974:
112
+ self._add_observed(self._add_new_years_day("New Year's Day"))
105
113
 
106
114
  super()._add_subdiv_holidays()
107
115
 
108
- def _add_subdiv_england_holidays(self):
116
+ def _add_subdiv_eng_holidays(self):
109
117
  # Easter Monday
110
118
  self._add_easter_monday("Easter Monday")
111
119
 
@@ -116,7 +124,7 @@ class UnitedKingdom(HolidayBase, ChristianHolidays, InternationalHolidays):
116
124
  _get_nth_weekday_of_month(-1, MON, AUG, self._year),
117
125
  )
118
126
 
119
- def _add_subdiv_northern_ireland_holidays(self):
127
+ def _add_subdiv_nir_holidays(self):
120
128
  # St. Patrick's Day
121
129
  self._add_observed(self._add_holiday("St. Patrick's Day", MAR, 17))
122
130
 
@@ -133,7 +141,16 @@ class UnitedKingdom(HolidayBase, ChristianHolidays, InternationalHolidays):
133
141
  _get_nth_weekday_of_month(-1, MON, AUG, self._year),
134
142
  )
135
143
 
136
- def _add_subdiv_scotland_holidays(self):
144
+ def _add_subdiv_sct_holidays(self):
145
+ # New Year's Day
146
+ name = "New Year's Day"
147
+ jan_1 = self._add_new_years_day(name)
148
+ if self.observed and self._is_weekend(jan_1):
149
+ self._add_holiday(
150
+ "%s (Observed)" % name,
151
+ jan_1 + td(days=+3 if self._is_saturday(jan_1) else +1),
152
+ )
153
+
137
154
  # New Year Holiday
138
155
  name = "New Year Holiday"
139
156
  jan_2 = self._add_new_years_day_two(name)
@@ -150,44 +167,7 @@ class UnitedKingdom(HolidayBase, ChristianHolidays, InternationalHolidays):
150
167
  # St. Andrew's Day
151
168
  self._add_holiday("St. Andrew's Day", NOV, 30)
152
169
 
153
- def _add_subdiv_uk_holidays(self):
154
- # New Year Holiday
155
- name = "New Year Holiday [Scotland]"
156
- jan_2 = self._add_new_years_day_two(name)
157
- self._add_observed(jan_2)
158
- if self.observed and self._is_monday(jan_2):
159
- self._add_new_years_day_three("%s (Observed)" % name)
160
-
161
- # St. Patrick's Day
162
- self._add_observed(
163
- self._add_holiday("St. Patrick's Day [Northern Ireland]", MAR, 17)
164
- )
165
-
166
- # Easter Monday
167
- self._add_easter_monday(
168
- "Easter Monday [England/Wales/Northern Ireland]"
169
- )
170
-
171
- # Battle of the Boyne
172
- self._add_holiday("Battle of the Boyne [Northern Ireland]", JUL, 12)
173
-
174
- # Summer bank holiday (first Monday in August)
175
- self._add_holiday(
176
- "Summer Bank Holiday [Scotland]",
177
- _get_nth_weekday_of_month(1, MON, AUG, self._year),
178
- )
179
-
180
- # Late Summer bank holiday (last Monday in August)
181
- if self._year >= 1971:
182
- self._add_holiday(
183
- "Late Summer Bank Holiday [England/Wales/Northern Ireland]",
184
- _get_nth_weekday_of_month(-1, MON, AUG, self._year),
185
- )
186
-
187
- # St. Andrew's Day
188
- self._add_holiday("St. Andrew's Day [Scotland]", NOV, 30)
189
-
190
- def _add_subdiv_wales_holidays(self):
170
+ def _add_subdiv_wls_holidays(self):
191
171
  # Easter Monday
192
172
  self._add_easter_monday("Easter Monday")
193
173