holidays 0.54__py3-none-any.whl → 0.56__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 (115) hide show
  1. holidays/__init__.py +1 -1
  2. holidays/countries/__init__.py +3 -0
  3. holidays/countries/algeria.py +11 -0
  4. holidays/countries/australia.py +1 -1
  5. holidays/countries/austria.py +10 -10
  6. holidays/countries/bangladesh.py +2 -0
  7. holidays/countries/bosnia_and_herzegovina.py +8 -12
  8. holidays/countries/brunei.py +23 -1
  9. holidays/countries/cambodia.py +20 -3
  10. holidays/countries/canada.py +6 -6
  11. holidays/countries/croatia.py +1 -1
  12. holidays/countries/cyprus.py +1 -1
  13. holidays/countries/dominica.py +130 -0
  14. holidays/countries/dominican_republic.py +7 -12
  15. holidays/countries/egypt.py +2 -0
  16. holidays/countries/haiti.py +134 -0
  17. holidays/countries/hongkong.py +1 -1
  18. holidays/countries/hungary.py +6 -0
  19. holidays/countries/ireland.py +6 -6
  20. holidays/countries/isle_of_man.py +1 -0
  21. holidays/countries/israel.py +2 -1
  22. holidays/countries/italy.py +113 -5
  23. holidays/countries/jordan.py +5 -0
  24. holidays/countries/kuwait.py +5 -0
  25. holidays/countries/laos.py +24 -62
  26. holidays/countries/liechtenstein.py +1 -1
  27. holidays/countries/luxembourg.py +1 -1
  28. holidays/countries/malaysia.py +16 -38
  29. holidays/countries/malta.py +3 -3
  30. holidays/countries/new_zealand.py +68 -43
  31. holidays/countries/philippines.py +215 -26
  32. holidays/countries/portugal.py +7 -7
  33. holidays/countries/russia.py +382 -3
  34. holidays/countries/samoa.py +72 -0
  35. holidays/countries/singapore.py +8 -0
  36. holidays/countries/slovakia.py +1 -1
  37. holidays/countries/spain.py +8 -8
  38. holidays/countries/switzerland.py +3 -3
  39. holidays/countries/ukraine.py +48 -43
  40. holidays/countries/united_kingdom.py +12 -22
  41. holidays/countries/united_states.py +2 -2
  42. holidays/groups/christian.py +19 -0
  43. holidays/locale/ar/LC_MESSAGES/CA.mo +0 -0
  44. holidays/locale/ar/LC_MESSAGES/CA.po +6 -6
  45. holidays/locale/ar/LC_MESSAGES/UA.mo +0 -0
  46. holidays/locale/ar/LC_MESSAGES/UA.po +26 -19
  47. holidays/locale/de/LC_MESSAGES/AT.po +6 -6
  48. holidays/locale/de/LC_MESSAGES/CH.po +3 -3
  49. holidays/locale/de/LC_MESSAGES/LI.po +1 -1
  50. holidays/locale/de/LC_MESSAGES/LU.po +1 -1
  51. holidays/locale/en_CA/LC_MESSAGES/CA.po +6 -6
  52. holidays/locale/en_US/LC_MESSAGES/AT.mo +0 -0
  53. holidays/locale/en_US/LC_MESSAGES/AT.po +14 -14
  54. holidays/locale/en_US/LC_MESSAGES/BG.mo +0 -0
  55. holidays/locale/en_US/LC_MESSAGES/BG.po +3 -3
  56. holidays/locale/en_US/LC_MESSAGES/CA.mo +0 -0
  57. holidays/locale/en_US/LC_MESSAGES/CA.po +11 -11
  58. holidays/locale/en_US/LC_MESSAGES/CH.mo +0 -0
  59. holidays/locale/en_US/LC_MESSAGES/CH.po +9 -8
  60. holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
  61. holidays/locale/en_US/LC_MESSAGES/ES.po +16 -16
  62. holidays/locale/en_US/LC_MESSAGES/HR.mo +0 -0
  63. holidays/locale/en_US/LC_MESSAGES/HR.po +4 -4
  64. holidays/locale/en_US/LC_MESSAGES/HT.mo +0 -0
  65. holidays/locale/en_US/LC_MESSAGES/HT.po +127 -0
  66. holidays/locale/en_US/LC_MESSAGES/LI.mo +0 -0
  67. holidays/locale/en_US/LC_MESSAGES/LI.po +4 -4
  68. holidays/locale/en_US/LC_MESSAGES/LU.mo +0 -0
  69. holidays/locale/en_US/LC_MESSAGES/LU.po +4 -4
  70. holidays/locale/en_US/LC_MESSAGES/MT.mo +0 -0
  71. holidays/locale/en_US/LC_MESSAGES/MT.po +8 -8
  72. holidays/locale/en_US/LC_MESSAGES/PT.mo +0 -0
  73. holidays/locale/en_US/LC_MESSAGES/PT.po +16 -16
  74. holidays/locale/en_US/LC_MESSAGES/SK.mo +0 -0
  75. holidays/locale/en_US/LC_MESSAGES/SK.po +4 -4
  76. holidays/locale/en_US/LC_MESSAGES/UA.mo +0 -0
  77. holidays/locale/en_US/LC_MESSAGES/UA.po +25 -19
  78. holidays/locale/es/LC_MESSAGES/ES.po +7 -7
  79. holidays/locale/es/LC_MESSAGES/HT.mo +0 -0
  80. holidays/locale/es/LC_MESSAGES/HT.po +127 -0
  81. holidays/locale/fr/LC_MESSAGES/CA.mo +0 -0
  82. holidays/locale/fr/LC_MESSAGES/CA.po +6 -6
  83. holidays/locale/fr/LC_MESSAGES/CH.po +3 -3
  84. holidays/locale/fr/LC_MESSAGES/LU.mo +0 -0
  85. holidays/locale/fr/LC_MESSAGES/LU.po +2 -2
  86. holidays/locale/fr_HT/LC_MESSAGES/HT.mo +0 -0
  87. holidays/locale/fr_HT/LC_MESSAGES/HT.po +127 -0
  88. holidays/locale/hr/LC_MESSAGES/HR.po +1 -1
  89. holidays/locale/ht/LC_MESSAGES/HT.mo +0 -0
  90. holidays/locale/ht/LC_MESSAGES/HT.po +127 -0
  91. holidays/locale/it/LC_MESSAGES/CH.po +3 -3
  92. holidays/locale/lb/LC_MESSAGES/LU.po +1 -1
  93. holidays/locale/mt/LC_MESSAGES/MT.po +3 -3
  94. holidays/locale/pt_PT/LC_MESSAGES/PT.po +7 -7
  95. holidays/locale/sk/LC_MESSAGES/SK.po +1 -1
  96. holidays/locale/th/LC_MESSAGES/CA.mo +0 -0
  97. holidays/locale/th/LC_MESSAGES/CA.po +6 -6
  98. holidays/locale/uk/LC_MESSAGES/AT.po +6 -6
  99. holidays/locale/uk/LC_MESSAGES/CH.po +3 -3
  100. holidays/locale/uk/LC_MESSAGES/ES.po +7 -7
  101. holidays/locale/uk/LC_MESSAGES/HR.po +1 -1
  102. holidays/locale/uk/LC_MESSAGES/LI.po +1 -1
  103. holidays/locale/uk/LC_MESSAGES/LU.po +1 -1
  104. holidays/locale/uk/LC_MESSAGES/PT.po +7 -7
  105. holidays/locale/uk/LC_MESSAGES/SK.po +1 -1
  106. holidays/locale/uk/LC_MESSAGES/UA.mo +0 -0
  107. holidays/locale/uk/LC_MESSAGES/UA.po +24 -18
  108. holidays/registry.py +3 -0
  109. holidays/utils.py +3 -3
  110. {holidays-0.54.dist-info → holidays-0.56.dist-info}/METADATA +24 -9
  111. {holidays-0.54.dist-info → holidays-0.56.dist-info}/RECORD +115 -104
  112. {holidays-0.54.dist-info → holidays-0.56.dist-info}/WHEEL +1 -1
  113. {holidays-0.54.dist-info → holidays-0.56.dist-info}/AUTHORS +0 -0
  114. {holidays-0.54.dist-info → holidays-0.56.dist-info}/LICENSE +0 -0
  115. {holidays-0.54.dist-info → holidays-0.56.dist-info}/top_level.txt +0 -0
holidays/__init__.py CHANGED
@@ -23,7 +23,7 @@ from holidays.holiday_base import *
23
23
  from holidays.registry import EntityLoader
24
24
  from holidays.utils import *
25
25
 
26
- __version__ = "0.54"
26
+ __version__ = "0.56"
27
27
 
28
28
 
29
29
  EntityLoader.load("countries", globals())
@@ -53,6 +53,7 @@ from .cyprus import Cyprus, CY, CYP
53
53
  from .czechia import Czechia, CZ, CZE
54
54
  from .denmark import Denmark, DK, DNK
55
55
  from .djibouti import Djibouti, DJ, DJI
56
+ from .dominica import Dominica, DM, DMA
56
57
  from .dominican_republic import DominicanRepublic, DO, DOM
57
58
  from .ecuador import Ecuador, EC, ECU
58
59
  from .egypt import Egypt, EG, EGY
@@ -70,6 +71,7 @@ from .greece import Greece, GR, GRC
70
71
  from .greenland import Greenland, GL, GRL
71
72
  from .guam import Guam, GU, GUM, HolidaysGU
72
73
  from .guatemala import Guatemala, GT, GUA
74
+ from .haiti import Haiti, HT, HTI
73
75
  from .honduras import Honduras, HN, HND
74
76
  from .hongkong import HongKong, HK, HKG
75
77
  from .hungary import Hungary, HU, HUN
@@ -128,6 +130,7 @@ from .portugal import Portugal, PT, PRT
128
130
  from .puerto_rico import PuertoRico, PR, PRI, HolidaysPR
129
131
  from .romania import Romania, RO, ROU
130
132
  from .russia import Russia, RU, RUS
133
+ from .samoa import Samoa, WS, WSM
131
134
  from .san_marino import SanMarino, SM, SMR
132
135
  from .saudi_arabia import SaudiArabia, SA, SAU
133
136
  from .serbia import Serbia, RS, SRB
@@ -12,6 +12,7 @@
12
12
 
13
13
  from gettext import gettext as tr
14
14
 
15
+ from holidays.calendars.gregorian import THU, FRI, SAT, SUN
15
16
  from holidays.groups import InternationalHolidays, IslamicHolidays
16
17
  from holidays.holiday_base import HolidayBase
17
18
 
@@ -38,6 +39,16 @@ class Algeria(HolidayBase, InternationalHolidays, IslamicHolidays):
38
39
  super().__init__(*args, **kwargs)
39
40
 
40
41
  def _populate_public_holidays(self):
42
+ # The resting days are Friday and Saturday since 2009.
43
+ # Previously, these were on Thursday and Friday as implemented in 1976.
44
+ # https://www.thenationalnews.com/mena/2021/12/07/when-is-the-weekend-in-the-arab-world/
45
+ if self._year >= 2009:
46
+ self.weekend = {FRI, SAT}
47
+ elif self._year >= 1976:
48
+ self.weekend = {THU, FRI}
49
+ else:
50
+ self.weekend = {SAT, SUN}
51
+
41
52
  # New Year's Day.
42
53
  self._add_new_years_day(tr("رأس السنة الميلادية"))
43
54
 
@@ -696,7 +696,7 @@ class Australia(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
696
696
 
697
697
  # Easter Tuesday.
698
698
  if self._year <= 2010:
699
- self._add_holiday_2_days_past_easter("Easter Tuesday")
699
+ self._add_easter_tuesday("Easter Tuesday")
700
700
 
701
701
  # ANZAC Day.
702
702
  if self._year >= 1921:
@@ -107,7 +107,7 @@ class Austria(HolidayBase, ChristianHolidays, InternationalHolidays):
107
107
  # Christmas Day.
108
108
  self._add_christmas_day(tr("Christtag"))
109
109
 
110
- # St. Stephen's Day.
110
+ # Saint Stephen's Day.
111
111
  self._add_christmas_day_two(tr("Stefanitag"))
112
112
 
113
113
  def _populate_bank_holidays(self):
@@ -121,43 +121,43 @@ class Austria(HolidayBase, ChristianHolidays, InternationalHolidays):
121
121
  self._add_new_years_eve(tr("Silvester"))
122
122
 
123
123
  def _populate_subdiv_1_bank_holidays(self):
124
- # St. Martin's Day.
124
+ # Saint Martin's Day.
125
125
  self._add_holiday_nov_11(tr("Hl. Martin"))
126
126
 
127
127
  def _populate_subdiv_2_bank_holidays(self):
128
- # St. Joseph's Day.
128
+ # Saint Joseph's Day.
129
129
  self._add_saint_josephs_day(tr("Hl. Josef"))
130
130
 
131
131
  # 1920 Carinthian plebiscite.
132
132
  self._add_holiday_oct_10(tr("Tag der Volksabstimmung"))
133
133
 
134
134
  def _populate_subdiv_3_bank_holidays(self):
135
- # St. Leopold's Day.
135
+ # Saint Leopold's Day.
136
136
  self._add_holiday_nov_15(tr("Hl. Leopold"))
137
137
 
138
138
  def _populate_subdiv_4_bank_holidays(self):
139
139
  if self._year >= 2004:
140
- # St. Florian's Day.
140
+ # Saint Florian's Day.
141
141
  self._add_holiday_may_4(tr("Hl. Florian"))
142
142
 
143
143
  def _populate_subdiv_5_bank_holidays(self):
144
- # St. Rupert's Day.
144
+ # Saint Rupert's Day.
145
145
  self._add_holiday_sep_24(tr("Hl. Rupert"))
146
146
 
147
147
  def _populate_subdiv_6_bank_holidays(self):
148
- # St. Joseph's Day.
148
+ # Saint Joseph's Day.
149
149
  self._add_saint_josephs_day(tr("Hl. Josef"))
150
150
 
151
151
  def _populate_subdiv_7_bank_holidays(self):
152
- # St. Joseph's Day.
152
+ # Saint Joseph's Day.
153
153
  self._add_saint_josephs_day(tr("Hl. Josef"))
154
154
 
155
155
  def _populate_subdiv_8_bank_holidays(self):
156
- # St. Joseph's Day.
156
+ # Saint Joseph's Day.
157
157
  self._add_saint_josephs_day(tr("Hl. Josef"))
158
158
 
159
159
  def _populate_subdiv_9_bank_holidays(self):
160
- # St. Leopold's Day.
160
+ # Saint Leopold's Day.
161
161
  self._add_holiday_nov_15(tr("Hl. Leopold"))
162
162
 
163
163
 
@@ -10,6 +10,7 @@
10
10
  # Website: https://github.com/vacanza/python-holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
+ from holidays.calendars.gregorian import FRI, SAT
13
14
  from holidays.groups import InternationalHolidays
14
15
  from holidays.holiday_base import HolidayBase
15
16
 
@@ -22,6 +23,7 @@ class Bangladesh(HolidayBase, InternationalHolidays):
22
23
  """
23
24
 
24
25
  country = "BD"
26
+ weekend = {FRI, SAT}
25
27
 
26
28
  def __init__(self, *args, **kwargs):
27
29
  InternationalHolidays.__init__(self)
@@ -64,11 +64,14 @@ class BosniaAndHerzegovina(
64
64
  "BRC", # Brčko distrikt
65
65
  "SRP", # Republika Srpska
66
66
  )
67
- _deprecated_subdivisions = (
68
- "BD",
69
- "FBiH",
70
- "RS",
71
- )
67
+ subdivisions_aliases = {
68
+ "Federacija Bosne i Hercegovine": "BIH",
69
+ "FBiH": "BIH",
70
+ "Brčko distrikt": "BRC",
71
+ "BD": "BRC",
72
+ "Republika Srpska": "SRP",
73
+ "RS": "SRP",
74
+ }
72
75
 
73
76
  def __init__(self, *args, **kwargs):
74
77
  ChristianHolidays.__init__(self, JULIAN_CALENDAR)
@@ -90,13 +93,6 @@ class BosniaAndHerzegovina(
90
93
  # Eid al-Adha.
91
94
  self._add_eid_al_adha_day(tr("Kurban Bajram"))
92
95
 
93
- if self.subdiv == "BD":
94
- self._populate_subdiv_brc_public_holidays()
95
- elif self.subdiv == "FBiH":
96
- self._populate_subdiv_bih_public_holidays()
97
- elif self.subdiv == "RS":
98
- self._populate_subdiv_srp_public_holidays()
99
-
100
96
  def _populate_subdiv_holidays(self):
101
97
  if not self.subdiv:
102
98
  # New Year's Day.
@@ -13,7 +13,22 @@
13
13
  from gettext import gettext as tr
14
14
 
15
15
  from holidays.calendars import _CustomIslamicHolidays
16
- from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
16
+ from holidays.calendars.gregorian import (
17
+ JAN,
18
+ FEB,
19
+ MAR,
20
+ APR,
21
+ MAY,
22
+ JUN,
23
+ JUL,
24
+ AUG,
25
+ SEP,
26
+ OCT,
27
+ NOV,
28
+ DEC,
29
+ FRI,
30
+ SUN,
31
+ )
17
32
  from holidays.groups import (
18
33
  ChineseCalendarHolidays,
19
34
  ChristianHolidays,
@@ -75,6 +90,7 @@ class Brunei(
75
90
  # %s (observed, estimated).
76
91
  observed_estimated_label = tr("%s (diperhatikan, anggaran)")
77
92
  supported_languages = ("en_US", "ms", "th")
93
+ weekend = {FRI, SUN}
78
94
 
79
95
  def __init__(self, *args, **kwargs):
80
96
  ChineseCalendarHolidays.__init__(self)
@@ -233,6 +249,7 @@ class BruneiIslamicHolidays(_CustomIslamicHolidays):
233
249
  2021: (JUL, 20),
234
250
  2022: (JUL, 10),
235
251
  2023: (JUN, 29),
252
+ 2024: (JUN, 17),
236
253
  }
237
254
 
238
255
  EID_AL_FITR_DATES = {
@@ -288,6 +305,7 @@ class BruneiIslamicHolidays(_CustomIslamicHolidays):
288
305
  2021: (AUG, 10),
289
306
  2022: (JUL, 30),
290
307
  2023: (JUL, 19),
308
+ 2024: (JUL, 7),
291
309
  }
292
310
 
293
311
  ISRA_AND_MIRAJ_DATES = {
@@ -315,6 +333,7 @@ class BruneiIslamicHolidays(_CustomIslamicHolidays):
315
333
  2021: (MAR, 11),
316
334
  2022: (MAR, 1),
317
335
  2023: (FEB, 18),
336
+ 2024: (FEB, 8),
318
337
  }
319
338
 
320
339
  MAWLID_DATES = {
@@ -342,6 +361,7 @@ class BruneiIslamicHolidays(_CustomIslamicHolidays):
342
361
  2021: (OCT, 19),
343
362
  2022: (OCT, 8),
344
363
  2023: (SEP, 28),
364
+ 2024: (SEP, 16),
345
365
  }
346
366
 
347
367
  NUZUL_AL_QURAN_DATES = {
@@ -369,6 +389,7 @@ class BruneiIslamicHolidays(_CustomIslamicHolidays):
369
389
  2021: (APR, 29),
370
390
  2022: (APR, 19),
371
391
  2023: (APR, 8),
392
+ 2024: (MAR, 28),
372
393
  }
373
394
 
374
395
  RAMADAN_BEGINNING_DATES = {
@@ -396,6 +417,7 @@ class BruneiIslamicHolidays(_CustomIslamicHolidays):
396
417
  2021: (APR, 13),
397
418
  2022: (APR, 3),
398
419
  2023: (MAR, 23),
420
+ 2024: (MAR, 12),
399
421
  }
400
422
 
401
423
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  from gettext import gettext as tr
14
14
 
15
- from holidays.calendars.gregorian import MAY, AUG, SEP, _timedelta
15
+ from holidays.calendars.gregorian import APR, MAY, AUG, SEP, _timedelta
16
16
  from holidays.calendars.thai import KHMER_CALENDAR
17
17
  from holidays.groups import InternationalHolidays, StaticHolidays, ThaiCalendarHolidays
18
18
  from holidays.holiday_base import HolidayBase
@@ -86,12 +86,25 @@ class Cambodia(HolidayBase, InternationalHolidays, StaticHolidays, ThaiCalendarH
86
86
 
87
87
  # ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ
88
88
  # Status: In-Use.
89
- # Usually falls on April 13th except for 2017-2018 and 2021-2023 for years 2001-2050.
89
+ # Usually falls on April 13th except for 2017-2018, 2021-2023, 2025-2027, 2029-2031
90
+ # for years 2001-2050.
90
91
 
91
92
  if self._year != 2020:
92
93
  # Khmer New Year's Day
93
94
  sangkranta = tr("ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ")
94
- sangkranta_years_apr_14 = {2017, 2018, 2021, 2022, 2023}
95
+ sangkranta_years_apr_14 = {
96
+ 2017,
97
+ 2018,
98
+ 2021,
99
+ 2022,
100
+ 2023,
101
+ 2025,
102
+ 2026,
103
+ 2027,
104
+ 2029,
105
+ 2030,
106
+ 2031,
107
+ }
95
108
  dt = (
96
109
  self._add_holiday_apr_14(sangkranta)
97
110
  if self._year in sangkranta_years_apr_14
@@ -284,6 +297,9 @@ class CambodiaStaticHolidays:
284
297
  # Special Public Holiday
285
298
  special_in_lieu_holidays = tr("ថ្ងៃឈប់សម្រាកសងជំនួស")
286
299
 
300
+ # Khmer New Year's Day
301
+ sangkranta = tr("ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ")
302
+
287
303
  special_public_holidays = {
288
304
  2016: (
289
305
  (MAY, 2, special_in_lieu_holidays),
@@ -299,4 +315,5 @@ class CambodiaStaticHolidays:
299
315
  (AUG, 20, sangkranta_in_lieu_covid),
300
316
  (AUG, 21, sangkranta_in_lieu_covid),
301
317
  ),
318
+ 2024: (APR, 16, sangkranta),
302
319
  }
@@ -294,16 +294,16 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
294
294
 
295
295
  def _populate_subdiv_nl_optional_holidays(self):
296
296
  if self._year >= 1900:
297
- # St. Patrick's Day.
298
- self._add_holiday(tr("St. Patrick's Day"), self._get_nearest_monday(MAR, 17))
297
+ # Saint Patrick's Day.
298
+ self._add_holiday(tr("Saint Patrick's Day"), self._get_nearest_monday(MAR, 17))
299
299
 
300
300
  if self._year >= 1990:
301
301
  # Nearest Monday to April 23
302
302
  # 4/26 is the Monday closer to 4/23 in 2010
303
303
  # but the holiday was observed on 4/19? Crazy Newfies!
304
304
  dt = date(2010, APR, 19) if self._year == 2010 else self._get_nearest_monday(APR, 23)
305
- # St. George's Day.
306
- self._add_holiday(tr("St. George's Day"), dt)
305
+ # Saint George's Day.
306
+ self._add_holiday(tr("Saint George's Day"), dt)
307
307
 
308
308
  if self._year >= 1997:
309
309
  # Discovery Day.
@@ -429,8 +429,8 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
429
429
 
430
430
  if self._year >= 1925:
431
431
  self._add_observed(
432
- # St. Jean Baptiste Day.
433
- self._add_saint_johns_day(tr("St. Jean Baptiste Day")),
432
+ # Saint John the Baptist Day.
433
+ self._add_saint_johns_day(tr("Saint Jean Baptiste Day")),
434
434
  rule=SUN_TO_NEXT_MON,
435
435
  )
436
436
 
@@ -100,7 +100,7 @@ class Croatia(HolidayBase, ChristianHolidays, InternationalHolidays):
100
100
  # Christmas Day.
101
101
  self._add_christmas_day(tr("Božić"))
102
102
 
103
- # St. Stephen's Day.
103
+ # Saint Stephen's Day.
104
104
  self._add_christmas_day_two(tr("Sveti Stjepan"))
105
105
 
106
106
 
@@ -92,7 +92,7 @@ class Cyprus(HolidayBase, ChristianHolidays, InternationalHolidays):
92
92
  return None
93
93
 
94
94
  # Easter Tuesday.
95
- self._add_holiday_2_days_past_easter(tr("Τρίτη της Διακαινησίμου"))
95
+ self._add_easter_tuesday(tr("Τρίτη της Διακαινησίμου"))
96
96
 
97
97
  def _populate_optional_holidays(self):
98
98
  if self._year <= 1960:
@@ -0,0 +1,130 @@
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/python-holidays
11
+ # License: MIT (see LICENSE file)
12
+
13
+ from holidays.calendars.gregorian import JAN, JUL, SEP
14
+ from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
15
+ from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON, SUN_TO_NEXT_TUE
16
+
17
+
18
+ class Dominica(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
19
+ """
20
+ References:
21
+ - https://www.dominica.gov.dm/laws/chapters/chap19-10.pdf
22
+ - https://pressroomopm.gov.dm/notice-public-holiday-order-2022/
23
+ - https://en.wikipedia.org/wiki/Public_holidays_in_Dominica
24
+ - https://dominica.gov.dm/laws/1998/sro1-1998.pdf
25
+
26
+ Cross-Checked With:
27
+ - https://www.dominica-weekly.com/images/dominica-calendar-2010/1600-1280.jpg # 2010
28
+ - https://dominicaconsulategreece.com/dominica/public-holidays/ # 2011-2020
29
+ - http://www.q95da.com/news/q95-news-received-on-december-29-2020-at-731pm-the-official-public-holiday-calendar-for-2021-approved-by-the-government-of-dominica
30
+ - https://dominica.gov.dm/about-dominica/public-holidays # 2022-2024
31
+
32
+ While Labour Day is listed in the 1990 amendment as May 1st, this has, de facto, been
33
+ made 1st Monday of May since at least 2010.
34
+
35
+ Where in any year two public holidays fall on the same day, then the next succeeding day
36
+ not being itself a public holiday shall be observed as a public holiday. In practice, this
37
+ only applies to Holidays which falls on Saturday or Sunday.
38
+ """
39
+
40
+ country = "DM"
41
+ observed_label = "%s (observed)"
42
+
43
+ def __init__(self, *args, **kwargs):
44
+ ChristianHolidays.__init__(self)
45
+ InternationalHolidays.__init__(self)
46
+ StaticHolidays.__init__(self, DominicaStaticHolidays)
47
+ kwargs.setdefault("observed_rule", SUN_TO_NEXT_MON)
48
+ super().__init__(*args, **kwargs)
49
+
50
+ def _populate_public_holidays(self):
51
+ # Public Holidays Act, L.I. 12 of 1990 Amendment.
52
+ if self._year <= 1989:
53
+ return None
54
+
55
+ # New Year's Day.
56
+ self._add_observed(self._add_new_years_day("New Year's Day"))
57
+
58
+ # Carnival Monday.
59
+ self._add_carnival_monday("Carnival Monday")
60
+
61
+ # Carnival Tuesday.
62
+ self._add_carnival_tuesday("Carnival Tuesday")
63
+
64
+ # Good Friday.
65
+ self._add_good_friday("Good Friday")
66
+
67
+ # Easter Monday.
68
+ self._add_easter_monday("Easter Monday")
69
+
70
+ # Labour Day.
71
+ labour_day_name = "Labour Day"
72
+ if self._year >= 2010:
73
+ self._add_holiday_1st_mon_of_may(labour_day_name)
74
+ else:
75
+ self._add_observed(self._add_labor_day(labour_day_name))
76
+
77
+ # Whit Monday.
78
+ self._add_whit_monday("Whit Monday")
79
+
80
+ first_monday_of_august_holiday_name = (
81
+ # Emancipation Day.
82
+ "Emancipation Day"
83
+ if self._year >= 1998
84
+ # First Monday of August.
85
+ else "First Monday of August"
86
+ )
87
+ self._add_holiday_1st_mon_of_aug(first_monday_of_august_holiday_name)
88
+
89
+ # Independence Day.
90
+ self._add_observed(self._add_holiday_nov_3("Independence Day"), rule=SUN_TO_NEXT_TUE)
91
+
92
+ # National Day of Community Service .
93
+ self._add_observed(self._add_holiday_nov_4("National Day of Community Service"))
94
+
95
+ # Christmas Day.
96
+ self._add_observed(self._add_christmas_day("Christmas Day"), rule=SUN_TO_NEXT_TUE)
97
+
98
+ # Boxing Day.
99
+ self._add_observed(self._add_christmas_day_two("Boxing Day"))
100
+
101
+
102
+ class DM(Dominica):
103
+ pass
104
+
105
+
106
+ class DMA(Dominica):
107
+ pass
108
+
109
+
110
+ class DominicaStaticHolidays:
111
+ """
112
+ References
113
+ - https://qppstudio-public-holidays-news.blogspot.com/2009/07/dominica-declares-july-28-public.html
114
+ - https://dominica.gov.dm/laws/2009/sro35-2009.pdf
115
+ - https://dominica.gov.dm/laws/2009/sro55-2009.pdf
116
+ - https://emonewsdm.com/thursday-september-19-2019-declared-public-holiday-in-dominica/
117
+ """
118
+
119
+ # Special Public Holidays.
120
+ special_public_holiday_name = "Special Public Holiday"
121
+
122
+ special_public_holidays = {
123
+ 2009: (
124
+ (JUL, 28, special_public_holiday_name),
125
+ (SEP, 3, special_public_holiday_name),
126
+ ),
127
+ 2010: (JAN, 4, special_public_holiday_name),
128
+ # Post-Hurricane Maria Thanksgiving Celebrations.
129
+ 2019: (SEP, 19, "Post-Hurricane Maria Thanksgiving Celebrations"),
130
+ }
@@ -10,10 +10,8 @@
10
10
  # Website: https://github.com/vacanza/python-holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
14
13
  from gettext import gettext as tr
15
14
 
16
- from holidays.calendars.gregorian import JUN
17
15
  from holidays.groups import ChristianHolidays, InternationalHolidays
18
16
  from holidays.observed_holiday_base import (
19
17
  ObservedHolidayBase,
@@ -39,11 +37,11 @@ class DominicanRepublic(ObservedHolidayBase, ChristianHolidays, InternationalHol
39
37
  kwargs.setdefault("observed_rule", TUE_WED_TO_PREV_MON + THU_FRI_TO_NEXT_MON)
40
38
  super().__init__(*args, **kwargs)
41
39
 
42
- def _is_observed(self, dt: date) -> bool:
43
- # Law No. 139-97 - Holidays Dominican Republic - Jun 27, 1997
44
- return dt >= date(1997, JUN, 27)
45
-
46
40
  def _populate_public_holidays(self):
41
+ # Law No. 139-97 - Holidays Dominican Republic (Jun 27, 1997).
42
+ if self._year <= 1997:
43
+ return None
44
+
47
45
  # New Year's Day.
48
46
  self._add_new_years_day(tr("Año Nuevo"))
49
47
 
@@ -72,12 +70,9 @@ class DominicanRepublic(ObservedHolidayBase, ChristianHolidays, InternationalHol
72
70
  self._add_corpus_christi_day(tr("Corpus Christi"))
73
71
 
74
72
  # Restoration Day.
75
- name = tr("Día de la Restauración")
76
- # Judgment No. 14 of Feb 20, 2008 of the Supreme Court of Justice
77
- if self._year <= 2007 and self._year % 4 == 0:
78
- self._add_holiday_aug_16(name)
79
- else:
80
- self._move_holiday(self._add_holiday_aug_16(name))
73
+ aug_16 = self._add_holiday_aug_16(tr("Día de la Restauración"))
74
+ if self._year % 4 != 0:
75
+ self._move_holiday(aug_16)
81
76
 
82
77
  # Our Lady of Mercedes Day.
83
78
  self._add_holiday_sep_24(tr("Día de las Mercedes"))
@@ -12,6 +12,7 @@
12
12
 
13
13
  from gettext import gettext as tr
14
14
 
15
+ from holidays.calendars.gregorian import FRI, SAT
15
16
  from holidays.calendars.julian import JULIAN_CALENDAR
16
17
  from holidays.groups import ChristianHolidays, IslamicHolidays, InternationalHolidays
17
18
  from holidays.holiday_base import HolidayBase
@@ -32,6 +33,7 @@ class Egypt(HolidayBase, ChristianHolidays, IslamicHolidays, InternationalHolida
32
33
  # %s (estimated).
33
34
  estimated_label = tr("(تقدير) %s")
34
35
  supported_languages = ("ar", "en_US")
36
+ weekend = {FRI, SAT}
35
37
 
36
38
  def __init__(self, *args, **kwargs):
37
39
  ChristianHolidays.__init__(self, JULIAN_CALENDAR)