holidays 0.81__py3-none-any.whl → 0.83__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 (141) hide show
  1. holidays/calendars/__init__.py +1 -0
  2. holidays/calendars/burmese.py +319 -0
  3. holidays/calendars/hebrew.py +2 -2
  4. holidays/calendars/islamic.py +26 -6
  5. holidays/calendars/thai.py +49 -2
  6. holidays/countries/__init__.py +11 -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/azerbaijan.py +1 -1
  11. holidays/countries/bouvet_island.py +31 -0
  12. holidays/countries/brazil.py +1 -1
  13. holidays/countries/british_indian_ocean_territory.py +31 -0
  14. holidays/countries/bulgaria.py +6 -1
  15. holidays/countries/canada.py +27 -13
  16. holidays/countries/chile.py +9 -8
  17. holidays/countries/cuba.py +3 -4
  18. holidays/countries/denmark.py +18 -6
  19. holidays/countries/djibouti.py +1 -1
  20. holidays/countries/fiji.py +2 -3
  21. holidays/countries/finland.py +3 -6
  22. holidays/countries/guyana.py +24 -32
  23. holidays/countries/heard_island_and_mcdonald_islands.py +31 -0
  24. holidays/countries/hungary.py +4 -5
  25. holidays/countries/india.py +27 -78
  26. holidays/countries/iran.py +133 -269
  27. holidays/countries/ireland.py +1 -1
  28. holidays/countries/israel.py +1 -1
  29. holidays/countries/japan.py +22 -18
  30. holidays/countries/jordan.py +6 -3
  31. holidays/countries/kuwait.py +6 -3
  32. holidays/countries/macau.py +5 -8
  33. holidays/countries/malaysia.py +14 -3
  34. holidays/countries/mauritius.py +10 -9
  35. holidays/countries/montserrat.py +1 -1
  36. holidays/countries/myanmar.py +194 -0
  37. holidays/countries/nepal.py +11 -30
  38. holidays/countries/netherlands.py +28 -24
  39. holidays/countries/new_zealand.py +75 -31
  40. holidays/countries/nigeria.py +53 -75
  41. holidays/countries/north_korea.py +161 -0
  42. holidays/countries/norway.py +24 -9
  43. holidays/countries/oman.py +6 -2
  44. holidays/countries/paraguay.py +70 -23
  45. holidays/countries/portugal.py +5 -6
  46. holidays/countries/qatar.py +5 -2
  47. holidays/countries/rwanda.py +8 -3
  48. holidays/countries/saudi_arabia.py +6 -5
  49. holidays/countries/serbia.py +5 -0
  50. holidays/countries/slovakia.py +23 -4
  51. holidays/countries/south_africa.py +96 -53
  52. holidays/countries/south_korea.py +6 -1
  53. holidays/countries/spain.py +4 -4
  54. holidays/countries/sri_lanka.py +21 -58
  55. holidays/countries/sudan.py +6 -3
  56. holidays/countries/suriname.py +1 -2
  57. holidays/countries/sweden.py +1 -1
  58. holidays/countries/switzerland.py +255 -6
  59. holidays/countries/taiwan.py +23 -3
  60. holidays/countries/tanzania.py +25 -30
  61. holidays/countries/thailand.py +29 -7
  62. holidays/countries/tonga.py +6 -1
  63. holidays/countries/trinidad_and_tobago.py +7 -2
  64. holidays/countries/ukraine.py +1 -1
  65. holidays/countries/united_arab_emirates.py +9 -2
  66. holidays/countries/united_kingdom.py +1 -1
  67. holidays/countries/united_states.py +18 -2
  68. holidays/countries/uruguay.py +6 -1
  69. holidays/countries/vietnam.py +6 -1
  70. holidays/countries/western_sahara.py +92 -0
  71. holidays/countries/yemen.py +6 -3
  72. holidays/groups/__init__.py +1 -0
  73. holidays/groups/balinese_saka.py +1 -1
  74. holidays/groups/buddhist.py +3 -3
  75. holidays/groups/burmese.py +273 -0
  76. holidays/groups/chinese.py +30 -2
  77. holidays/groups/christian.py +10 -0
  78. holidays/groups/custom.py +8 -2
  79. holidays/groups/eastern.py +26 -0
  80. holidays/groups/hebrew.py +16 -14
  81. holidays/groups/hindu.py +23 -15
  82. holidays/groups/international.py +1 -1
  83. holidays/groups/islamic.py +52 -50
  84. holidays/groups/mongolian.py +6 -3
  85. holidays/groups/sinhala.py +9 -11
  86. holidays/groups/tibetan.py +8 -6
  87. holidays/holiday_base.py +26 -26
  88. holidays/ical.py +6 -4
  89. holidays/locale/ar/LC_MESSAGES/DZ.mo +0 -0
  90. holidays/locale/ar/LC_MESSAGES/EH.mo +0 -0
  91. holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
  92. holidays/locale/de/LC_MESSAGES/CH.mo +0 -0
  93. holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
  94. holidays/locale/en_US/LC_MESSAGES/BR.mo +0 -0
  95. holidays/locale/en_US/LC_MESSAGES/CH.mo +0 -0
  96. holidays/locale/en_US/LC_MESSAGES/DZ.mo +0 -0
  97. holidays/locale/en_US/LC_MESSAGES/EH.mo +0 -0
  98. holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
  99. holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
  100. holidays/locale/en_US/LC_MESSAGES/JP.mo +0 -0
  101. holidays/locale/en_US/LC_MESSAGES/KP.mo +0 -0
  102. holidays/locale/en_US/LC_MESSAGES/MM.mo +0 -0
  103. holidays/locale/en_US/LC_MESSAGES/NL.mo +0 -0
  104. holidays/locale/en_US/LC_MESSAGES/PY.mo +0 -0
  105. holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
  106. holidays/locale/es/LC_MESSAGES/EH.mo +0 -0
  107. holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
  108. holidays/locale/es/LC_MESSAGES/PY.mo +0 -0
  109. holidays/locale/fr/LC_MESSAGES/CH.mo +0 -0
  110. holidays/locale/fr/LC_MESSAGES/DZ.mo +0 -0
  111. holidays/locale/fr/LC_MESSAGES/EH.mo +0 -0
  112. holidays/locale/fy/LC_MESSAGES/NL.mo +0 -0
  113. holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
  114. holidays/locale/it/LC_MESSAGES/CH.mo +0 -0
  115. holidays/locale/ja/LC_MESSAGES/JP.mo +0 -0
  116. holidays/locale/ko_KP/LC_MESSAGES/KP.mo +0 -0
  117. holidays/locale/my/LC_MESSAGES/MM.mo +0 -0
  118. holidays/locale/nl/LC_MESSAGES/NL.mo +0 -0
  119. holidays/locale/pt_BR/LC_MESSAGES/BR.mo +0 -0
  120. holidays/locale/th/LC_MESSAGES/CH.mo +0 -0
  121. holidays/locale/th/LC_MESSAGES/DK.mo +0 -0
  122. holidays/locale/th/LC_MESSAGES/JP.mo +0 -0
  123. holidays/locale/th/LC_MESSAGES/MM.mo +0 -0
  124. holidays/locale/th/LC_MESSAGES/NL.mo +0 -0
  125. holidays/locale/th/LC_MESSAGES/US.mo +0 -0
  126. holidays/locale/uk/LC_MESSAGES/BR.mo +0 -0
  127. holidays/locale/uk/LC_MESSAGES/CH.mo +0 -0
  128. holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
  129. holidays/locale/uk/LC_MESSAGES/NL.mo +0 -0
  130. holidays/locale/uk/LC_MESSAGES/PY.mo +0 -0
  131. holidays/no_holiday_base.py +21 -0
  132. holidays/observed_holiday_base.py +16 -4
  133. holidays/registry.py +8 -0
  134. holidays/utils.py +5 -5
  135. holidays/version.py +1 -1
  136. {holidays-0.81.dist-info → holidays-0.83.dist-info}/METADATA +63 -19
  137. {holidays-0.81.dist-info → holidays-0.83.dist-info}/RECORD +141 -118
  138. {holidays-0.81.dist-info → holidays-0.83.dist-info}/licenses/CONTRIBUTORS +2 -0
  139. {holidays-0.81.dist-info → holidays-0.83.dist-info}/WHEEL +0 -0
  140. {holidays-0.81.dist-info → holidays-0.83.dist-info}/licenses/LICENSE +0 -0
  141. {holidays-0.81.dist-info → holidays-0.83.dist-info}/top_level.txt +0 -0
@@ -10,27 +10,50 @@
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.gregorian import THU, FRI, SAT, SUN
16
- from holidays.groups import InternationalHolidays, IslamicHolidays
19
+ from holidays.constants import CHRISTIAN, HEBREW, PUBLIC
20
+ from holidays.groups import (
21
+ ChristianHolidays,
22
+ HebrewCalendarHolidays,
23
+ InternationalHolidays,
24
+ IslamicHolidays,
25
+ )
17
26
  from holidays.holiday_base import HolidayBase
18
27
 
28
+ if TYPE_CHECKING:
29
+ from datetime import date
30
+
19
31
 
20
- class Algeria(HolidayBase, InternationalHolidays, IslamicHolidays):
32
+ class Algeria(
33
+ HolidayBase, ChristianHolidays, HebrewCalendarHolidays, InternationalHolidays, IslamicHolidays
34
+ ):
21
35
  """Algeria holidays.
22
36
 
23
37
  References:
24
38
  * <https://en.wikipedia.org/wiki/Public_holidays_in_Algeria>
25
- * <https://web.archive.org/web/20250427180223/https://www.horizons.dz/english/archives/amp/12021>
39
+ * [Loi n° 63-278 du 26 juillet 1963](https://web.archive.org/web/20250903142053/https://drive.google.com/file/d/1rWkxBEjs9aNkbiTTRXBET3Qo_3HQOJR9/view)
40
+ * [Ordonnance n° 68-419 du 26 juin 1968](https://web.archive.org/web/20250903142828/https://drive.google.com/file/d/1fMGyGVnunGkACWhm0tICANEZqao2pOV3/view)
41
+ * [Loi n° 05-06 du 17 Rabie El Aoeul 1426](https://web.archive.org/web/20250903143453/https://drive.google.com/file/d/1AXISrPGJzgDO8G3uB1TyICdtnOYW6ewm/view)
42
+ * [Loi n° 18-12 du 18 Chaoual 1439](https://web.archive.org/web/20250903141752/https://drive.google.com/file/d/1qxcrF3J-SUXmLdGZLVF0gdrN0aQWwykb/view)
43
+ * [Loi n° 23-10 du 8 Dhou El Hidja 1444](https://web.archive.org/web/20250903141052/https://drive.google.com/file/d/1hZJtxofzjFAphOX09dGGtvHxl6IN5aNz/view)
26
44
  * <https://web.archive.org/web/20241231091630/https://www.thenationalnews.com/mena/2021/12/07/when-is-the-weekend-in-the-arab-world/>
45
+ * <https://web.archive.org/web/20250903160618/https://www.lemonde.fr/afrique/article/2018/01/12/en-algerie-le-nouvel-an-berbere-ferie-pour-la-premiere-fois_5241028_3212.html>
27
46
  """
28
47
 
29
48
  country = "DZ"
30
49
  default_language = "ar"
31
50
  # %s (estimated).
32
51
  estimated_label = tr("%s (المقدرة)")
52
+ # Loi n° 63-278 du 26 juillet 1963.
53
+ start_year = 1964
54
+ supported_categories = (CHRISTIAN, HEBREW, PUBLIC)
33
55
  supported_languages = ("ar", "en_US", "fr")
56
+ weekend = {FRI, SAT}
34
57
 
35
58
  def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
36
59
  """
@@ -39,24 +62,28 @@ class Algeria(HolidayBase, InternationalHolidays, IslamicHolidays):
39
62
  Whether to add "estimated" label to Islamic holidays name
40
63
  if holiday date is estimated.
41
64
  """
65
+ ChristianHolidays.__init__(self)
66
+ HebrewCalendarHolidays.__init__(self)
42
67
  InternationalHolidays.__init__(self)
43
68
  IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
44
69
  super().__init__(*args, **kwargs)
45
70
 
46
- def _populate_public_holidays(self):
71
+ def _get_weekend(self, dt: date) -> set[int]:
47
72
  # The resting days are Friday and Saturday since 2009.
48
73
  # Previously, these were on Thursday and Friday as implemented in 1976.
49
- if self._year >= 2009:
50
- self.weekend = {FRI, SAT}
51
- elif self._year >= 1976:
52
- self.weekend = {THU, FRI}
74
+ if dt.year >= 2009:
75
+ return {FRI, SAT}
76
+ elif dt.year >= 1976:
77
+ return {THU, FRI}
53
78
  else:
54
- self.weekend = {SAT, SUN}
79
+ return {SAT, SUN}
55
80
 
81
+ def _populate_public_holidays(self):
56
82
  # New Year's Day.
57
83
  self._add_new_years_day(tr("رأس السنة الميلادية"))
58
84
 
59
- # In January 2018, Algeria declared Yennayer a national holiday.
85
+ # First Celebrated in 2018.
86
+ # Reaffirmed via Loi n° 18-12 du 18 Chaoual 1439.
60
87
  if self._year >= 2018:
61
88
  # Amazigh New Year.
62
89
  self._add_holiday_jan_12(tr("رأس السنة الأمازيغية"))
@@ -64,13 +91,17 @@ class Algeria(HolidayBase, InternationalHolidays, IslamicHolidays):
64
91
  # Labor Day.
65
92
  self._add_labor_day(tr("عيد العمال"))
66
93
 
67
- if self._year >= 1962:
94
+ # Name changed in Loi n° 05-06 du 17 Rabie El Aoeul 1426.
95
+ self._add_holiday_jul_5(
68
96
  # Independence Day.
69
- self._add_holiday_jul_5(tr("عيد الإستقلال"))
97
+ tr("عيد الاستقلال")
98
+ if self._year >= 2005
99
+ # Independence and National Liberation Front Day.
100
+ else tr("عيد الاستقلال وجبهة التحرير الوطني")
101
+ )
70
102
 
71
- if self._year >= 1963:
72
- # Revolution Day.
73
- self._add_holiday_nov_1(tr("عيد الثورة"))
103
+ # Revolution Day.
104
+ self._add_holiday_nov_1(tr("عيد الثورة"))
74
105
 
75
106
  # Islamic New Year.
76
107
  self._add_islamic_new_year_day(tr("رأس السنة الهجرية"))
@@ -82,18 +113,52 @@ class Algeria(HolidayBase, InternationalHolidays, IslamicHolidays):
82
113
  self._add_mawlid_day(tr("عيد المولد النبوي"))
83
114
 
84
115
  # Eid al-Fitr.
85
- self._add_eid_al_fitr_day(tr("عيد الفطر"))
86
- # Eid al-Fitr Holiday.
87
- self._add_eid_al_fitr_day_two(tr("عطلة عيد الفطر"))
116
+ name = tr("عيد الفطر")
117
+ self._add_eid_al_fitr_day(name)
118
+ self._add_eid_al_fitr_day_two(name)
119
+ # Added via Loi n° 23-10 du 8 Dhou El Hidja 1444.
88
120
  if self._year >= 2024:
89
- self._add_eid_al_fitr_day_three(tr("عطلة عيد الفطر"))
121
+ self._add_eid_al_fitr_day_three(name)
90
122
 
91
123
  # Eid al-Adha.
92
- self._add_eid_al_adha_day(tr("عيد الأضحى"))
93
- # Eid al-Adha Holiday.
94
- self._add_eid_al_adha_day_two(tr("عطلة عيد الأضحى"))
95
- if self._year >= 2023:
96
- self._add_eid_al_adha_day_three(tr("عطلة عيد الأضحى"))
124
+ name = tr("عيد الأضحى")
125
+ self._add_eid_al_adha_day(name)
126
+ # Added via Ordonnance n° 68-419 du 26 juin 1968.
127
+ if self._year >= 1969:
128
+ self._add_eid_al_adha_day_two(name)
129
+ # Added via Loi n° 23-10 du 8 Dhou El Hidja 1444.
130
+ if self._year >= 2023:
131
+ self._add_eid_al_adha_day_three(name)
132
+
133
+ def _populate_christian_holidays(self):
134
+ # As outlined in Loi n° 63-278 du 26 juillet 1963.
135
+
136
+ # Easter Monday.
137
+ self._add_easter_monday(tr("إثنين الفصح"))
138
+
139
+ # Ascension Day.
140
+ self._add_ascension_thursday(tr("عيد الصعود"))
141
+
142
+ # Whit Monday.
143
+ self._add_whit_monday(tr("إثنين العنصرة"))
144
+
145
+ # Assumption Day.
146
+ self._add_assumption_of_mary_day(tr("عيد انتقال السيدة العذراء"))
147
+
148
+ # Christmas Day.
149
+ self._add_christmas_day(tr("عيد الميلاد"))
150
+
151
+ def _populate_hebrew_holidays(self):
152
+ # As outlined in Loi n° 63-278 du 26 juillet 1963.
153
+
154
+ # Rosh Hashanah.
155
+ self._add_rosh_hashanah(tr("رأس السنة العبرية"))
156
+
157
+ # Yom Kippur.
158
+ self._add_yom_kippur(tr("يوم الغفران"))
159
+
160
+ # Pesach.
161
+ self._add_passover(tr("عيد الفصح اليهودي"))
97
162
 
98
163
 
99
164
  class DZ(Algeria):
@@ -0,0 +1,58 @@
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 holidays.groups import ChristianHolidays, InternationalHolidays
14
+ from holidays.holiday_base import HolidayBase
15
+
16
+
17
+ class Antarctica(HolidayBase, ChristianHolidays, InternationalHolidays):
18
+ """Antarctica holidays.
19
+
20
+ References:
21
+ * <https://en.wikipedia.org/wiki/Antarctica_Day>
22
+ * <https://en.wikipedia.org/wiki/Midwinter_Day>
23
+ """
24
+
25
+ country = "AQ"
26
+ # The Antarctica Treaty System became active on June 23rd, 1961.
27
+ start_year = 1962
28
+
29
+ def __init__(self, *args, **kwargs):
30
+ ChristianHolidays.__init__(self)
31
+ InternationalHolidays.__init__(self)
32
+ super().__init__(*args, **kwargs)
33
+
34
+ def _populate_public_holidays(self):
35
+ # New Year's Day.
36
+ self._add_new_years_day("New Year's Day")
37
+
38
+ # Midwinter Day.
39
+ name = "Midwinter Day"
40
+ if self._is_leap_year():
41
+ self._add_holiday_jun_20(name)
42
+ else:
43
+ self._add_holiday_jun_21(name)
44
+
45
+ if self._year >= 2010:
46
+ # Antarctica Day.
47
+ self._add_holiday_dec_1("Antarctica Day")
48
+
49
+ # Christmas Day.
50
+ self._add_christmas_day("Christmas Day")
51
+
52
+
53
+ class AQ(Antarctica):
54
+ pass
55
+
56
+
57
+ class ATA(Antarctica):
58
+ pass
@@ -172,7 +172,7 @@ class Azerbaijan(ObservedHolidayBase, InternationalHolidays, IslamicHolidays, St
172
172
  continue
173
173
  for holiday_name in dt_holidays:
174
174
  if any(bayrami_name in holiday_name for bayrami_name in bayrami_names):
175
- self._add_observed(dt_observed, holiday_name, WORKDAY_TO_NEXT_WORKDAY)
175
+ self._add_observed(dt_observed, holiday_name, rule=WORKDAY_TO_NEXT_WORKDAY)
176
176
 
177
177
  def _populate_workday_holidays(self):
178
178
  if self._year >= 2021:
@@ -0,0 +1,31 @@
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 holidays.no_holiday_base import NoHolidayBase
14
+
15
+
16
+ class BouvetIsland(NoHolidayBase):
17
+ """Bouvet Island holidays.
18
+
19
+ References:
20
+ * <https://en.wikipedia.org/wiki/Bouvet_Island>
21
+ """
22
+
23
+ country = "BV"
24
+
25
+
26
+ class BV(BouvetIsland):
27
+ pass
28
+
29
+
30
+ class BVT(BouvetIsland):
31
+ pass
@@ -106,7 +106,7 @@ class Brazil(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
106
106
 
107
107
  if 1892 <= self._year <= 1930:
108
108
  # Republic Constitution Day.
109
- self._add_holiday_feb_24(tr("Constituição da Republica"))
109
+ self._add_holiday_feb_24(tr("Constituição da República"))
110
110
 
111
111
  # Good Friday.
112
112
  self._add_good_friday(tr("Sexta-feira Santa"))
@@ -0,0 +1,31 @@
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 holidays.no_holiday_base import NoHolidayBase
14
+
15
+
16
+ class BritishIndianOceanTerritory(NoHolidayBase):
17
+ """British Indian Ocean Territory holidays.
18
+
19
+ References:
20
+ * <https://en.wikipedia.org/wiki/British_Indian_Ocean_Territory>
21
+ """
22
+
23
+ country = "IO"
24
+
25
+
26
+ class IO(BritishIndianOceanTerritory):
27
+ pass
28
+
29
+
30
+ class IOT(BritishIndianOceanTerritory):
31
+ pass
@@ -10,14 +10,19 @@
10
10
  # Website: https://github.com/vacanza/holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
13
+ from __future__ import annotations
14
+
14
15
  from gettext import gettext as tr
16
+ from typing import TYPE_CHECKING
15
17
 
16
18
  from holidays.calendars.julian_revised import JULIAN_REVISED_CALENDAR
17
19
  from holidays.constants import PUBLIC, SCHOOL
18
20
  from holidays.groups import ChristianHolidays, InternationalHolidays
19
21
  from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NEXT_WORKDAY
20
22
 
23
+ if TYPE_CHECKING:
24
+ from datetime import date
25
+
21
26
 
22
27
  class Bulgaria(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
23
28
  """Bulgaria holidays.
@@ -12,9 +12,8 @@
12
12
 
13
13
  from datetime import date
14
14
  from gettext import gettext as tr
15
- from typing import Optional
16
15
 
17
- from holidays.calendars.gregorian import MAR, APR, JUN, JUL, SEP
16
+ from holidays.calendars.gregorian import APR, SEP
18
17
  from holidays.constants import GOVERNMENT, OPTIONAL, PUBLIC
19
18
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
20
19
  from holidays.observed_holiday_base import (
@@ -101,9 +100,6 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
101
100
  kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
102
101
  super().__init__(*args, **kwargs)
103
102
 
104
- def _get_nearest_monday(self, *args) -> Optional[date]:
105
- return self._get_observed_date(date(self._year, *args), rule=ALL_TO_NEAREST_MON)
106
-
107
103
  def _add_statutory_holidays(self):
108
104
  """Nationwide statutory holidays."""
109
105
 
@@ -336,24 +332,42 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
336
332
 
337
333
  def _populate_subdiv_nl_optional_holidays(self):
338
334
  if self._year >= 1900:
339
- # Saint Patrick's Day.
340
- self._add_holiday(tr("Saint Patrick's Day"), self._get_nearest_monday(MAR, 17))
335
+ self._move_holiday_forced(
336
+ # Saint Patrick's Day.
337
+ self._add_saint_patricks_day(tr("Saint Patrick's Day")),
338
+ rule=ALL_TO_NEAREST_MON,
339
+ )
341
340
 
342
341
  if self._year >= 1990:
343
342
  # Nearest Monday to April 23
344
343
  # 4/26 is the Monday closer to 4/23 in 2010
345
344
  # but the holiday was observed on 4/19? Crazy Newfies!
346
- dt = date(2010, APR, 19) if self._year == 2010 else self._get_nearest_monday(APR, 23)
345
+
347
346
  # Saint George's Day.
348
- self._add_holiday(tr("Saint George's Day"), dt)
347
+ name = tr("Saint George's Day")
348
+
349
+ if self._year == 2010:
350
+ self._add_holiday_apr_19(name)
351
+ else:
352
+ # Prevents overlap with Good Friday.
353
+ self._add_holiday(
354
+ name,
355
+ self._get_observed_date(date(self._year, APR, 23), rule=ALL_TO_NEAREST_MON),
356
+ )
349
357
 
350
358
  if self._year >= 1997:
351
- # Discovery Day.
352
- self._add_holiday(tr("Discovery Day"), self._get_nearest_monday(JUN, 24))
359
+ self._move_holiday_forced(
360
+ # Discovery Day.
361
+ self._add_holiday_jun_24(tr("Discovery Day")),
362
+ rule=ALL_TO_NEAREST_MON,
363
+ )
353
364
 
354
365
  if self._year >= 1900:
355
- # Orangemen's Day.
356
- self._add_holiday(tr("Orangemen's Day"), self._get_nearest_monday(JUL, 12))
366
+ self._move_holiday_forced(
367
+ # Orangemen's Day.
368
+ self._add_holiday_jul_12(tr("Orangemen's Day")),
369
+ rule=ALL_TO_NEAREST_MON,
370
+ )
357
371
 
358
372
  self._add_thanksgiving_day()
359
373
 
@@ -118,6 +118,7 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
118
118
  # New Year's Day.
119
119
  self._add_new_years_day(tr("Año Nuevo"))
120
120
  if self._year >= 2017:
121
+ # National Holiday.
121
122
  self._add_observed(self._add_new_years_day_two(tr("Feriado nacional")), rule=MON_ONLY)
122
123
 
123
124
  # Good Friday.
@@ -171,12 +172,18 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
171
172
  # Day of National Unity.
172
173
  self._add_holiday_1st_mon_of_sep(tr("Día de la Unidad Nacional"))
173
174
 
175
+ # National Holiday.
176
+ name = tr("Fiestas Patrias")
177
+
174
178
  if self._year >= 2007:
175
179
  self._add_observed(
176
- # National Holiday.
177
- self._add_holiday_sep_17(tr("Fiestas Patrias")),
180
+ self._add_holiday_sep_17(name),
178
181
  rule=MON_FRI_ONLY if self._year >= 2017 else MON_ONLY,
179
182
  )
183
+ if self._year >= 2008:
184
+ self._add_observed(self._add_holiday_sep_20(name), rule=FRI_ONLY)
185
+ elif 1932 <= self._year <= 1944:
186
+ self._add_holiday_sep_20(name)
180
187
 
181
188
  # Independence Day.
182
189
  self._add_holiday_sep_18(tr("Día de la Independencia"))
@@ -184,12 +191,6 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
184
191
  # Army Day.
185
192
  self._add_holiday_sep_19(tr("Día de las Glorias del Ejército"))
186
193
 
187
- if self._year >= 2008:
188
- self._add_observed(self._add_holiday_sep_20(tr("Fiestas Patrias")), rule=FRI_ONLY)
189
-
190
- if 1932 <= self._year <= 1944:
191
- self._add_holiday_sep_20(tr("Fiestas Patrias"))
192
-
193
194
  if self._year >= 1922 and self._year != 1973:
194
195
  self._move_holiday(
195
196
  self._add_columbus_day(
@@ -80,14 +80,13 @@ class Cuba(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
80
80
  self._add_observed(self._add_labor_day(tr("Día Internacional de los Trabajadores")))
81
81
 
82
82
  # Commemoration of the Assault of the Moncada garrison.
83
- self._add_holiday_jul_25(tr("Conmemoración del asalto a Moncada"))
83
+ name = tr("Conmemoración del asalto a Moncada")
84
+ self._add_holiday_jul_25(name)
85
+ self._add_holiday_jul_27(name)
84
86
 
85
87
  # Day of the National Rebellion.
86
88
  self._add_holiday_jul_26(tr("Día de la Rebeldía Nacional"))
87
89
 
88
- # Commemoration of the Assault of the Moncada garrison.
89
- self._add_holiday_jul_27(tr("Conmemoración del asalto a Moncada"))
90
-
91
90
  # Independence Day.
92
91
  self._add_observed(self._add_holiday_oct_10(tr("Inicio de las Guerras de Independencia")))
93
92
 
@@ -22,14 +22,21 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
22
22
 
23
23
  References:
24
24
  * <https://en.wikipedia.org/wiki/Public_holidays_in_Denmark>
25
+ * <https://da.wikipedia.org/wiki/Danske_helligdage>
26
+ * <https://da.wikipedia.org/wiki/Helligdagsreformen_af_1770>
25
27
  * <https://web.archive.org/web/20250422010005/https://www.norden.org/en/info-norden/public-holidays-denmark>
26
28
  * <https://web.archive.org/web/20231219155820/http://www.ft.dk/samling/20222/lovforslag/l13/index.htm>
29
+ * <https://web.archive.org/web/20250119084025/https://www.retsinformation.dk/eli/lta/2023/214>
30
+ * <https://web.archive.org/web/20251016080453/https://cphpost.dk/2025-05-01/life-in-denmark/what-happens-on-the-1st-of-may/>
31
+ * <https://web.archive.org/web/20140202200655/https://bibliotek.kk.dk/biblioteker/blog/grundlovsdag-dens-traditioner>
27
32
  """
28
33
 
29
34
  country = "DK"
30
35
  default_language = "da"
36
+ # The Helligdagsreformen af 1770 was in effect from October 16th, 1770 onwards.
37
+ start_year = 1771
31
38
  supported_categories = (OPTIONAL, PUBLIC)
32
- supported_languages = ("da", "en_US", "uk")
39
+ supported_languages = ("da", "en_US", "th", "uk")
33
40
 
34
41
  def __init__(self, *args, **kwargs):
35
42
  ChristianHolidays.__init__(self)
@@ -52,6 +59,7 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
52
59
  # Easter Monday.
53
60
  self._add_easter_monday(tr("Anden påskedag"))
54
61
 
62
+ # Removed via Act no. 214 of 06/03/2023, in effect January 1st, 2024.
55
63
  if self._year <= 2023:
56
64
  # Great Day of Prayers.
57
65
  self._add_holiday_26_days_past_easter(tr("Store bededag"))
@@ -72,11 +80,15 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
72
80
  self._add_christmas_day_two(tr("Anden juledag"))
73
81
 
74
82
  def _populate_optional_holidays(self):
75
- # Workers' Day.
76
- self._add_labor_day(tr("Arbejdernes kampdag"))
77
-
78
- # Constitution Day.
79
- self._add_holiday_jun_5(tr("Grundlovsdag"))
83
+ # First observance in 1890.
84
+ if self._year >= 1890:
85
+ # Workers' Day.
86
+ self._add_labor_day(tr("Arbejdernes kampdag"))
87
+
88
+ # Gained its statutory day-off status in 1891.
89
+ if self._year >= 1891:
90
+ # Constitution Day.
91
+ self._add_holiday_jun_5(tr("Grundlovsdag"))
80
92
 
81
93
  # Christmas Eve.
82
94
  self._add_christmas_eve(tr("Juleaftensdag"))
@@ -17,7 +17,7 @@ from holidays.groups import ChristianHolidays, IslamicHolidays, InternationalHol
17
17
  from holidays.holiday_base import HolidayBase
18
18
 
19
19
 
20
- class Djibouti(HolidayBase, ChristianHolidays, IslamicHolidays, InternationalHolidays):
20
+ class Djibouti(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays):
21
21
  """Djibouti holidays."""
22
22
 
23
23
  country = "DJ"
@@ -108,11 +108,10 @@ class Fiji(
108
108
  self._add_observed(self._add_holiday_sep_7("Constitution Day"))
109
109
 
110
110
  if self._year >= 2023:
111
- # Girmit Day.
112
- self._move_holiday(
111
+ self._move_holiday_forced(
112
+ # Girmit Day.
113
113
  self._add_holiday_may_14("Girmit Day"),
114
114
  rule=ALL_TO_NEAREST_MON,
115
- show_observed_label=False,
116
115
  )
117
116
 
118
117
  # Ratu Sir Lala Sukuna Day.
@@ -215,14 +215,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
215
215
  # Become a Flag Day in 1952.
216
216
  # Also considered the "Day of Finnish Heritage" from 1978 onward.
217
217
  if self._year >= 1952:
218
- name = (
218
+ self._add_holiday_may_12(
219
219
  # J. V. Snellman Day, Day of Finnish Heritage.
220
220
  tr("J.V. Snellmanin päivä, suomalaisuuden päivä")
221
221
  if self._year >= 1978
222
222
  # J. V. Snellman Day.
223
223
  else tr("J.V. Snellmanin päivä")
224
224
  )
225
- self._add_holiday_may_12(name)
226
225
 
227
226
  # Become a Flag Day in 1977.
228
227
  if self._year >= 1977:
@@ -248,14 +247,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
248
247
  # Become a Flag Day in 1950.
249
248
  # Also considered the "Day of Finnish Literature" from 1978 onward.
250
249
  if self._year >= 1950:
251
- name = (
250
+ self._add_holiday_oct_10(
252
251
  # Aleksis Kivi Day, Day of Finnish Literature.
253
252
  tr("Aleksis Kiven päivä, suomalaisen kirjallisuuden päivä")
254
253
  if self._year >= 1978
255
254
  # Aleksis Kivi Day.
256
255
  else tr("Aleksis Kiven päivä")
257
256
  )
258
- self._add_holiday_oct_10(name)
259
257
 
260
258
  # Become a Flag Day in 1987.
261
259
  if self._year >= 1987:
@@ -310,14 +308,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
310
308
  # Become a Flag Day in 1942.
311
309
  # Got its current name in 1950.
312
310
  if self._year >= 1942:
313
- name = (
311
+ self._add_holiday_jun_6(
314
312
  # Flag Day of the Finnish Defense Forces.
315
313
  tr("Puolustusvoimain lippujuhlan päivä")
316
314
  if self._year >= 1950
317
315
  # Birthday of the Marshal of Finland.
318
316
  else tr("Suomen marsalkan syntymäpäivä")
319
317
  )
320
- self._add_holiday_jun_6(name)
321
318
 
322
319
  # Day of the Finnish Flag was first created in 1934.
323
320
  # This coincides with Midsummer Day.