holidays 0.76__py3-none-any.whl → 0.77__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 (85) hide show
  1. holidays/countries/__init__.py +19 -0
  2. holidays/countries/australia.py +6 -8
  3. holidays/countries/british_virgin_islands.py +6 -6
  4. holidays/countries/cabo_verde.py +293 -0
  5. holidays/countries/cayman_islands.py +162 -0
  6. holidays/countries/central_african_republic.py +143 -0
  7. holidays/countries/christmas_island.py +215 -0
  8. holidays/countries/cocos_islands.py +4 -4
  9. holidays/countries/dr_congo.py +139 -0
  10. holidays/countries/faroe_islands.py +102 -0
  11. holidays/countries/georgia.py +11 -5
  12. holidays/countries/gibraltar.py +219 -0
  13. holidays/countries/guernsey.py +6 -6
  14. holidays/countries/japan.py +6 -8
  15. holidays/countries/jersey.py +2 -2
  16. holidays/countries/lebanon.py +448 -0
  17. holidays/countries/mali.py +151 -0
  18. holidays/countries/montserrat.py +177 -0
  19. holidays/countries/nepal.py +8 -8
  20. holidays/countries/new_zealand.py +2 -2
  21. holidays/countries/niue.py +115 -0
  22. holidays/countries/norfolk_island.py +129 -0
  23. holidays/countries/palau.py +1 -1
  24. holidays/countries/palestine.py +177 -0
  25. holidays/countries/peru.py +12 -0
  26. holidays/countries/saint_vincent_and_the_grenadines.py +130 -0
  27. holidays/countries/seychelles.py +1 -1
  28. holidays/countries/solomon_islands.py +2 -2
  29. holidays/countries/tokelau.py +66 -0
  30. holidays/countries/turks_and_caicos_islands.py +2 -2
  31. holidays/countries/united_kingdom.py +2 -2
  32. holidays/countries/united_states.py +2 -5
  33. holidays/groups/christian.py +10 -10
  34. holidays/groups/hebrew.py +2 -2
  35. holidays/groups/islamic.py +17 -0
  36. holidays/holiday_base.py +1 -1
  37. holidays/locale/ar/LC_MESSAGES/LB.mo +0 -0
  38. holidays/locale/ar/LC_MESSAGES/PS.mo +0 -0
  39. holidays/locale/da/LC_MESSAGES/FO.mo +0 -0
  40. holidays/locale/de/LC_MESSAGES/CV.mo +0 -0
  41. holidays/locale/en_CX/LC_MESSAGES/CX.mo +0 -0
  42. holidays/locale/en_GB/LC_MESSAGES/GI.mo +0 -0
  43. holidays/locale/en_GB/LC_MESSAGES/KY.mo +0 -0
  44. holidays/locale/en_MS/LC_MESSAGES/MS.mo +0 -0
  45. holidays/locale/en_NF/LC_MESSAGES/NF.mo +0 -0
  46. holidays/locale/en_NU/LC_MESSAGES/NU.mo +0 -0
  47. holidays/locale/en_TK/LC_MESSAGES/TK.mo +0 -0
  48. holidays/locale/en_US/LC_MESSAGES/CD.mo +0 -0
  49. holidays/locale/en_US/LC_MESSAGES/CF.mo +0 -0
  50. holidays/locale/en_US/LC_MESSAGES/CV.mo +0 -0
  51. holidays/locale/en_US/LC_MESSAGES/CX.mo +0 -0
  52. holidays/locale/en_US/LC_MESSAGES/FO.mo +0 -0
  53. holidays/locale/en_US/LC_MESSAGES/GI.mo +0 -0
  54. holidays/locale/en_US/LC_MESSAGES/KY.mo +0 -0
  55. holidays/locale/en_US/LC_MESSAGES/LB.mo +0 -0
  56. holidays/locale/en_US/LC_MESSAGES/ML.mo +0 -0
  57. holidays/locale/en_US/LC_MESSAGES/MS.mo +0 -0
  58. holidays/locale/en_US/LC_MESSAGES/NF.mo +0 -0
  59. holidays/locale/en_US/LC_MESSAGES/NU.mo +0 -0
  60. holidays/locale/en_US/LC_MESSAGES/PE.mo +0 -0
  61. holidays/locale/en_US/LC_MESSAGES/PS.mo +0 -0
  62. holidays/locale/en_US/LC_MESSAGES/TK.mo +0 -0
  63. holidays/locale/en_US/LC_MESSAGES/VC.mo +0 -0
  64. holidays/locale/en_VC/LC_MESSAGES/VC.mo +0 -0
  65. holidays/locale/es/LC_MESSAGES/CV.mo +0 -0
  66. holidays/locale/fo/LC_MESSAGES/FO.mo +0 -0
  67. holidays/locale/fr/LC_MESSAGES/CD.mo +0 -0
  68. holidays/locale/fr/LC_MESSAGES/CF.mo +0 -0
  69. holidays/locale/fr/LC_MESSAGES/CV.mo +0 -0
  70. holidays/locale/fr/LC_MESSAGES/ML.mo +0 -0
  71. holidays/locale/is/LC_MESSAGES/FO.mo +0 -0
  72. holidays/locale/no/LC_MESSAGES/FO.mo +0 -0
  73. holidays/locale/pt_CV/LC_MESSAGES/CV.mo +0 -0
  74. holidays/locale/sv/LC_MESSAGES/FO.mo +0 -0
  75. holidays/locale/tkl/LC_MESSAGES/TK.mo +0 -0
  76. holidays/locale/uk/LC_MESSAGES/PE.mo +0 -0
  77. holidays/observed_holiday_base.py +3 -1
  78. holidays/registry.py +15 -0
  79. holidays/version.py +1 -1
  80. {holidays-0.76.dist-info → holidays-0.77.dist-info}/METADATA +107 -2
  81. {holidays-0.76.dist-info → holidays-0.77.dist-info}/RECORD +85 -32
  82. {holidays-0.76.dist-info → holidays-0.77.dist-info}/licenses/CONTRIBUTORS +3 -0
  83. {holidays-0.76.dist-info → holidays-0.77.dist-info}/WHEEL +0 -0
  84. {holidays-0.76.dist-info → holidays-0.77.dist-info}/licenses/LICENSE +0 -0
  85. {holidays-0.76.dist-info → holidays-0.77.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,219 @@
1
+ # holidays
2
+ # --------
3
+ # A fast, efficient Python library for generating country, province and state
4
+ # specific sets of holidays on the fly. It aims to make determining whether a
5
+ # specific date is a holiday as fast and flexible as possible.
6
+ #
7
+ # Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
8
+ # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
9
+ # ryanss <ryanssdev@icloud.com> (c) 2014-2017
10
+ # Website: https://github.com/vacanza/holidays
11
+ # License: MIT (see LICENSE file)
12
+
13
+ from gettext import gettext as tr
14
+
15
+ from holidays.calendars.gregorian import JAN, FEB, APR, MAY, JUN, AUG, SEP
16
+ from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
17
+ from holidays.observed_holiday_base import (
18
+ ObservedHolidayBase,
19
+ SAT_SUN_TO_NEXT_MON,
20
+ SAT_SUN_TO_NEXT_MON_TUE,
21
+ )
22
+
23
+
24
+ class Gibraltar(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
25
+ """Gibraltar holidays.
26
+
27
+ References:
28
+ * <https://en.wikipedia.org/wiki/Public_holidays_in_Gibraltar>
29
+ * [2000](https://web.archive.org/web/20250714134510/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/1999s073.pdf)
30
+ * [2001](https://web.archive.org/web/20250714134609/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2000s041.pdf)
31
+ * [2003](https://web.archive.org/web/20250713064759/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2002s094.pdf)
32
+ * [2004](https://web.archive.org/web/20250713065008/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2003s105.pdf)
33
+ * [2005](https://web.archive.org/web/20250713071914/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2004s069.pdf)
34
+ * [2006](https://web.archive.org/web/20250713072021/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2005s111.pdf)
35
+ * [2007](https://web.archive.org/web/20250713072021/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2006s122.pdf)
36
+ * [2008](https://web.archive.org/web/20250713072026/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2007s113.pdf)
37
+ * [2009](https://web.archive.org/web/20250713072221/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2008s073.pdf)
38
+ * [2010](https://web.archive.org/web/20250713072222/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2009s049.pdf)
39
+ * [2011](https://web.archive.org/web/20250713072228/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2010s149.pdf)
40
+ * [2012](https://web.archive.org/web/20250713073334/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2011s189.pdf)
41
+ * [2013](https://web.archive.org/web/20250713162959/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2012s146.pdf)
42
+ * [2014](https://web.archive.org/web/20250713103345/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2013s149.pdf)
43
+ * [2015](https://web.archive.org/web/20250713163521/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2014s203.pdf)
44
+ * [2016](https://web.archive.org/web/20250713164519/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2015s196.pdf)
45
+ * [2017](https://web.archive.org/web/20250713073752/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2016s217.pdf)
46
+ * [2018](https://web.archive.org/web/20250714135250/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2017s224.pdf)
47
+ * [2019](https://web.archive.org/web/20250713071343/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2018s229.pdf)
48
+ * [2020](https://web.archive.org/web/20250714135425/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2019s217.pdf)
49
+ * [2021](https://web.archive.org/web/20250421063152/https://www.gibraltarlaws.gov.gi/legislations/bank-and-public-holidays-order-2020-5593/download)
50
+ * [2022](https://web.archive.org/web/20250414134257/https://www.gibraltarlaws.gov.gi/legislations/bank-and-public-holidays-order-2021-6286/version/21-10-2021/download)
51
+ * [2023](https://web.archive.org/web/20240831014104/https://www.gibraltarlaws.gov.gi/legislations/bank-and-public-holidays-order-2022-6735/version/22-02-2023/download)
52
+ * [2024](https://web.archive.org/web/20250502030403/https://www.gibraltarlaws.gov.gi/legislations/bank-and-public-holidays-order-2023-7215/version/06-11-2023/download)
53
+ * [2025](https://web.archive.org/web/20250714135600/https://www.gibraltarlaws.gov.gi/legislations/bank-and-public-holidays-order-2024-7456/download)
54
+ """
55
+
56
+ country = "GI"
57
+ default_language = "en_GB"
58
+ # %s (observed).
59
+ observed_label = tr("%s (observed)")
60
+ # First holiday info available from 2000.
61
+ start_year = 2000
62
+ supported_languages = ("en_GB", "en_US")
63
+
64
+ def __init__(self, *args, **kwargs):
65
+ ChristianHolidays.__init__(self)
66
+ InternationalHolidays.__init__(self)
67
+ StaticHolidays.__init__(self, GibraltarStaticHolidays)
68
+ kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
69
+ super().__init__(*args, **kwargs)
70
+
71
+ def _populate_public_holidays(self):
72
+ # New Year's Day.
73
+ self._add_observed(self._add_new_years_day(tr("New Year's Day")))
74
+
75
+ name = (
76
+ # Winter Midterm Bank Holiday.
77
+ tr("Winter Midterm Bank Holiday")
78
+ if self._year >= 2023
79
+ # Commonwealth Day.
80
+ else tr("Commonwealth Day")
81
+ )
82
+ winter_midterm_dts = {
83
+ 2024: (FEB, 12),
84
+ }
85
+ if dt := winter_midterm_dts.get(self._year):
86
+ self._add_holiday(name, dt)
87
+ elif self._year >= 2021:
88
+ self._add_holiday_3rd_mon_of_feb(name)
89
+ else:
90
+ self._add_holiday_2nd_mon_of_mar(name)
91
+
92
+ # Good Friday.
93
+ self._add_good_friday(tr("Good Friday"))
94
+
95
+ # Easter Monday.
96
+ self._add_easter_monday(tr("Easter Monday"))
97
+
98
+ if self._year >= 2013:
99
+ # Workers' Memorial Day.
100
+ name = tr("Workers' Memorial Day")
101
+ workers_memorial_dts = {
102
+ 2013: (APR, 26),
103
+ 2015: (APR, 27),
104
+ }
105
+ if dt := workers_memorial_dts.get(self._year):
106
+ self._add_holiday(name, dt)
107
+ else:
108
+ self._add_observed(self._add_holiday_apr_28(name))
109
+
110
+ # May Day.
111
+ name = tr("May Day")
112
+ may_day_dts = {
113
+ 2007: (MAY, 7),
114
+ 2008: (MAY, 5),
115
+ 2009: (MAY, 4),
116
+ }
117
+ if dt := may_day_dts.get(self._year):
118
+ self._add_holiday(name, dt)
119
+ else:
120
+ self._add_observed(self._add_holiday_may_1(name))
121
+
122
+ # Spring Bank Holiday.
123
+ name = tr("Spring Bank Holiday")
124
+ spring_bank_dts = {
125
+ 2012: (JUN, 4),
126
+ 2022: (JUN, 2),
127
+ }
128
+ if dt := spring_bank_dts.get(self._year):
129
+ self._add_holiday(name, dt)
130
+ else:
131
+ self._add_holiday_last_mon_of_may(name)
132
+
133
+ name = (
134
+ # King's Birthday.
135
+ tr("King's Birthday")
136
+ if self._year >= 2023
137
+ # Queen's Birthday.
138
+ else tr("Queen's Birthday")
139
+ )
140
+ sovereign_birthday_dts = {
141
+ 2000: (JUN, 19),
142
+ 2001: (JUN, 18),
143
+ 2006: (JUN, 19),
144
+ 2007: (JUN, 18),
145
+ 2012: (JUN, 18),
146
+ 2013: (JUN, 17),
147
+ 2017: (JUN, 19),
148
+ 2019: (JUN, 17),
149
+ 2023: (JUN, 19),
150
+ 2024: (JUN, 17),
151
+ }
152
+ if dt := sovereign_birthday_dts.get(self._year):
153
+ self._add_holiday(name, dt)
154
+ else:
155
+ self._add_holiday_2_days_past_2nd_sat_of_jun(name)
156
+
157
+ self._add_holiday_last_mon_of_aug(
158
+ # Summer Bank Holiday.
159
+ tr("Summer Bank Holiday")
160
+ if 2002 <= self._year <= 2007
161
+ # Late Summer Bank Holiday.
162
+ else tr("Late Summer Bank Holiday")
163
+ )
164
+
165
+ # Gibraltar National Day.
166
+ name = tr("Gibraltar National Day")
167
+ national_day_dts = {
168
+ 2016: (SEP, 5),
169
+ 2017: (SEP, 4),
170
+ }
171
+ if dt := national_day_dts.get(self._year):
172
+ self._add_holiday(name, dt)
173
+ else:
174
+ self._add_observed(self._add_holiday_sep_10(name))
175
+
176
+ self._add_observed(
177
+ # Christmas Day.
178
+ self._add_christmas_day(tr("Christmas Day")),
179
+ rule=SAT_SUN_TO_NEXT_MON_TUE,
180
+ )
181
+
182
+ self._add_observed(
183
+ # Boxing Day.
184
+ self._add_christmas_day_two(tr("Boxing Day")),
185
+ rule=SAT_SUN_TO_NEXT_MON_TUE,
186
+ )
187
+
188
+
189
+ class GI(Gibraltar):
190
+ pass
191
+
192
+
193
+ class GIB(Gibraltar):
194
+ pass
195
+
196
+
197
+ class GibraltarStaticHolidays(StaticHolidays):
198
+ """Gibraltar special holidays.
199
+
200
+ References:
201
+ * [Evacuation Commemoration Day, 2015](https://web.archive.org/web/20250714174537/https://www.gibraltarlaws.gov.gi/uploads/legislations/banking-and-financial-dealings/B&P%20Holidays/2015s112.pdf)
202
+ """
203
+
204
+ special_public_holidays = {
205
+ # Tercentenary Holiday.
206
+ 2004: (AUG, 4, tr("Tercentenary Holiday")),
207
+ # Bank Holiday.
208
+ 2009: (JAN, 12, tr("Bank Holiday")),
209
+ # Queen's Diamond Jubilee.
210
+ 2012: (JUN, 5, tr("Queen's Diamond Jubilee")),
211
+ # Evacuation Commemoration Day.
212
+ 2015: (SEP, 7, tr("Evacuation Commemoration Day")),
213
+ # 75th Anniversary of VE Day.
214
+ 2020: (MAY, 8, tr("75th Anniversary of VE Day")),
215
+ # Queen's Platinum Jubilee.
216
+ 2022: (JUN, 3, tr("Platinum Jubilee")),
217
+ # Special King’s Coronation Bank Holiday.
218
+ 2023: (MAY, 8, tr("Special King's Coronation Bank Holiday")),
219
+ }
@@ -107,8 +107,8 @@ class Guernsey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
107
107
  }
108
108
  # Spring Bank Holiday
109
109
  name = "Spring Bank Holiday"
110
- if self._year in spring_bank_dates:
111
- self._add_holiday(name, spring_bank_dates[self._year])
110
+ if dt := spring_bank_dates.get(self._year):
111
+ self._add_holiday(name, dt)
112
112
  else:
113
113
  self._add_holiday_last_mon_of_may(name)
114
114
 
@@ -168,9 +168,9 @@ class Guernsey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
168
168
  1945: (JUN, 14),
169
169
  1946: (JUN, 13),
170
170
  }
171
- if self._year in his_majesty_birth_dates:
171
+ if dt := his_majesty_birth_dates.get(self._year):
172
172
  # His Majesty's Birthday.
173
- self._add_holiday("His Majesty's Birthday", his_majesty_birth_dates[self._year])
173
+ self._add_holiday("His Majesty's Birthday", dt)
174
174
 
175
175
  # Summer Bank Holiday
176
176
  # Le premier Lundi du mois d'Août
@@ -217,8 +217,8 @@ class Guernsey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
217
217
  }
218
218
  # Liberation Day.
219
219
  name = "Liberation Day"
220
- if self._year in liberation_dates:
221
- self._add_holiday(name, liberation_dates[self._year])
220
+ if dt := liberation_dates.get(self._year):
221
+ self._add_holiday(name, dt)
222
222
  else:
223
223
  self._add_holiday_may_9(name)
224
224
 
@@ -137,11 +137,9 @@ class Japan(ObservedHolidayBase, InternationalHolidays, StaticHolidays):
137
137
  2020: (JUL, 23),
138
138
  2021: (JUL, 22),
139
139
  }
140
- dts_observed.add(
141
- self._add_holiday(name, dates[self._year])
142
- if self._year in dates
143
- else self._add_holiday_3rd_mon_of_jul(name)
144
- )
140
+ dts_observed.add(self._add_holiday(name, dt)) if (
141
+ dt := dates.get(self._year)
142
+ ) else dts_observed.add(self._add_holiday_3rd_mon_of_jul(name))
145
143
 
146
144
  if self._year >= 2016:
147
145
  dates = {
@@ -178,9 +176,9 @@ class Japan(ObservedHolidayBase, InternationalHolidays, StaticHolidays):
178
176
  2020: (JUL, 24),
179
177
  2021: (JUL, 23),
180
178
  }
181
- dts_observed.add(
182
- self._add_holiday(name, dates[self._year])
183
- ) if self._year in dates else self._add_holiday_2nd_mon_of_oct(name)
179
+ dts_observed.add(self._add_holiday(name, dt)) if (
180
+ dt := dates.get(self._year)
181
+ ) else dts_observed.add(self._add_holiday_2nd_mon_of_oct(name))
184
182
  else:
185
183
  dts_observed.add(self._add_holiday_oct_10(name))
186
184
 
@@ -106,8 +106,8 @@ class Jersey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
106
106
  2022: (JUN, 2),
107
107
  }
108
108
  name = "Spring Bank Holiday"
109
- if self._year in spring_bank_dates:
110
- self._add_holiday(name, spring_bank_dates[self._year])
109
+ if dt := spring_bank_dates.get(self._year):
110
+ self._add_holiday(name, dt)
111
111
  else:
112
112
  self._add_holiday_last_mon_of_may(name)
113
113