Skip to content

Commit 713bafe

Browse files
Add Cayman Islands holidays (#2706)
Signed-off-by: Abheelash Mishra <[email protected]> Co-authored-by: Panpakorn Siripanich <[email protected]>
1 parent 48a2cc0 commit 713bafe

File tree

7 files changed

+648
-1
lines changed

7 files changed

+648
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ and detailed information.
105105

106106
## Available Countries
107107

108-
We currently support 211 country codes. The standard way to refer to a country is by using its [ISO
108+
We currently support 212 country codes. The standard way to refer to a country is by using its [ISO
109109
3166-1 alpha-2 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes), the same used
110110
for domain names, and for a subdivision its [ISO 3166-2
111111
code](https://en.wikipedia.org/wiki/ISO_3166-2). Some countries have common or foreign names or
@@ -406,6 +406,13 @@ any) in brackets, available languages and additional holiday categories. All cou
406406
<td>GOVERNMENT, OPTIONAL</td>
407407
</tr>
408408
<tr>
409+
<td>Cayman Islands</td>
410+
<td>KY</td>
411+
<td></td>
412+
<td><strong>en_GB</strong>, en_US</td>
413+
<td></td>
414+
</tr>
415+
<tr>
409416
<td>Chad</td>
410417
<td>TD</td>
411418
<td></td>

holidays/countries/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from holidays.countries.cambodia import Cambodia, KH, KHM
5050
from holidays.countries.cameroon import Cameroon, CM, CMR
5151
from holidays.countries.canada import Canada, CA, CAN
52+
from holidays.countries.cayman_islands import CaymanIslands, KY, CYM
5253
from holidays.countries.chad import Chad, TD, TCD
5354
from holidays.countries.chile import Chile, CL, CHL
5455
from holidays.countries.china import China, CN, CHN

holidays/countries/cayman_islands.py

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
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 <[email protected]> (c) 2017-2023
9+
# ryanss <[email protected]> (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 import APR, MAY, JUN, JUL, SEP, NOV, DEC
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 CaymanIslands(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
25+
"""Cayman Islands holidays.
26+
27+
References:
28+
* <https://en.wikipedia.org/wiki/Public_holidays_in_the_Cayman_Islands>
29+
* [Public Holidays Law (2007 Revision)](https://web.archive.org/web/20250227060525/https://legislation.gov.ky/cms/images/LEGISLATION/PRINCIPAL/1964/1964-0140/PublicHolidaysAct_2007%20Revision_g.pdf)
30+
* [Public Holidays Order, 2024](https://web.archive.org/web/20240518181823/https://legislation.gov.ky/cms/images/LEGISLATION/AMENDING/2024/2024-O004/PublicHolidaysOrder2024SL4of2024.pdf)
31+
* [2006-2015](https://web.archive.org/web/20151014061601/http://www.gov.ky/portal/page?_pageid=1142,1592653&_dad=portal&_schema=PORTAL)
32+
* [2016-2018](https://web.archive.org/web/20180330170202/http://www.gov.ky:80/portal/page/portal/cighome/cayman/islands/publicholidays)
33+
* [2021](http://archive.today/2025.07.09-033240/https://www.gov.ky/news/press-release-details/public-holidays-for-2021)
34+
* [2022](http://archive.today/2025.07.09-033515/https://www.gov.ky/news/press-release-details/public-holidays-2022)
35+
* [2024](http://archive.today/2025.01.06-110234/https://www.gov.ky/calendar/public-holidays)
36+
* [2025](http://archive.today/2025.07.09-033853/https://www.gov.ky/calendar/public-holidays)
37+
"""
38+
39+
country = "KY"
40+
default_language = "en_GB"
41+
# %s observed.
42+
observed_label = tr("%s (observed)")
43+
# Earliest year of holidays with an accessible online record.
44+
start_year = 2006
45+
supported_languages = ("en_GB", "en_US")
46+
47+
def __init__(self, *args, **kwargs):
48+
ChristianHolidays.__init__(self)
49+
InternationalHolidays.__init__(self)
50+
StaticHolidays.__init__(self, cls=CaymanIslandsStaticHolidays)
51+
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
52+
super().__init__(*args, **kwargs)
53+
54+
def _populate_public_holidays(self):
55+
# New Year's Day.
56+
self._add_observed(self._add_new_years_day(tr("New Year's Day")))
57+
58+
# National Heroes Day.
59+
self._add_holiday_4th_mon_of_jan(tr("National Heroes Day"))
60+
61+
# Ash Wednesday.
62+
self._add_ash_wednesday(tr("Ash Wednesday"))
63+
64+
# Good Friday.
65+
self._add_good_friday(tr("Good Friday"))
66+
67+
# Easter Monday.
68+
self._add_easter_monday(tr("Easter Monday"))
69+
70+
if self._year >= 2024:
71+
# Emancipation Day.
72+
self._add_holiday_1st_mon_of_may(tr("Emancipation Day"))
73+
74+
# Discovery Day.
75+
self._add_holiday_3rd_mon_of_may(tr("Discovery Day"))
76+
77+
if self._year <= 2022:
78+
queens_birthday_dates = {
79+
2007: (JUN, 18),
80+
2012: (JUN, 18),
81+
2013: (JUN, 17),
82+
2017: (JUN, 19),
83+
2022: (JUN, 6),
84+
}
85+
# Queen's Birthday.
86+
name = tr("Queen's Birthday")
87+
if dt := queens_birthday_dates.get(self._year):
88+
self._add_holiday(name, dt)
89+
else:
90+
self._add_holiday_2_days_past_2nd_sat_of_jun(name)
91+
else:
92+
# King's Birthday.
93+
self._add_holiday_2_days_past_3rd_sat_of_jun(tr("King's Birthday"))
94+
95+
# Constitution Day.
96+
self._add_holiday_1st_mon_of_jul(tr("Constitution Day"))
97+
98+
# Remembrance Day.
99+
self._add_holiday_2nd_mon_of_nov(tr("Remembrance Day"))
100+
101+
self._add_observed(
102+
# Christmas Day.
103+
self._add_christmas_day(tr("Christmas Day")),
104+
rule=SAT_SUN_TO_NEXT_MON_TUE,
105+
)
106+
107+
self._add_observed(
108+
# Boxing Day.
109+
self._add_christmas_day_two(tr("Boxing Day")),
110+
rule=SAT_SUN_TO_NEXT_MON_TUE,
111+
)
112+
113+
114+
class KY(CaymanIslands):
115+
pass
116+
117+
118+
class CYM(CaymanIslands):
119+
pass
120+
121+
122+
class CaymanIslandsStaticHolidays:
123+
"""Cayman Islands special holidays.
124+
125+
References:
126+
* [Public Holidays Order, 2009](https://archive.org/details/public-holidays-order-2009-sl-33-of-2009)
127+
* [Public Holidays Order (No. 2), 2019](https://archive.org/details/public-holidays-no.-2-order-2019-sl-38-of-2019)
128+
* [Public Holidays Order, 2025](https://archive.org/details/public-holidays-order-2025-sl-15-of-2025)
129+
* [Referendum Day 2019](https://web.archive.org/web/20250711121821/https://www.facebook.com/ElectionsOffice/posts/reminder-the-referendum-vote-has-been-postponed-and-will-no-longer-take-place-th/2619995141431734/?_rdc=2&_rdr)
130+
* [UK Royal Wedding](https://en.wikipedia.org/wiki/Wedding_of_Prince_William_and_Catherine_Middleton)
131+
* [Queen Elizabeth II's Diamond Jubilee](https://web.archive.org/web/20210803202236/https://www.caymancompass.com/2012/06/06/queens-diamond-jubilee-feted/)
132+
* [Queen Elizabeth II's Funeral](https://web.archive.org/web/20231226055510/https://www.caymancompass.com/2022/09/12/cayman-declares-public-holiday-for-queens-funeral/)
133+
* [King Charles III's Coronation](https://web.archive.org/web/20250601214328/https://www.radiocayman.gov.ky/news/public-holidays-for-2023-unconfirmed)
134+
"""
135+
136+
# Referendum Day.
137+
referendum_day_name = tr("Referendum Day")
138+
# General Election Day.
139+
general_election_day_name = tr("General Election Day")
140+
special_public_holidays = {
141+
2009: (
142+
# 2009 Cayman Islands Constitution Day.
143+
(NOV, 6, tr("2009 Cayman Islands Constitution Day")),
144+
(MAY, 20, general_election_day_name),
145+
),
146+
# UK Royal Wedding.
147+
2011: (APR, 29, tr("UK Royal Wedding")),
148+
2012: (
149+
# Queen Elizabeth II's Diamond Jubilee.
150+
(JUN, 4, tr("Queen Elizabeth II's Diamond Jubilee")),
151+
(JUL, 18, referendum_day_name),
152+
),
153+
2013: (MAY, 22, general_election_day_name),
154+
2017: (MAY, 24, general_election_day_name),
155+
2019: (DEC, 19, referendum_day_name),
156+
2021: (APR, 14, general_election_day_name),
157+
# Queen Elizabeth II's Funeral.
158+
2022: (SEP, 19, tr("Queen Elizabeth II's Funeral")),
159+
# King Charles III's Coronation.
160+
2023: (MAY, 8, tr("Coronation of His Majesty King Charles III")),
161+
2025: (APR, 30, general_election_day_name),
162+
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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 <[email protected]> (c) 2017-2023
9+
# ryanss <[email protected]> (c) 2014-2017
10+
# Website: https://github.com/vacanza/holidays
11+
# License: MIT (see LICENSE file)
12+
#
13+
# Cayman Islands holidays.
14+
#
15+
msgid ""
16+
msgstr ""
17+
"Project-Id-Version: Holidays 0.77\n"
18+
"POT-Creation-Date: 2025-07-08 16:24+0000\n"
19+
"PO-Revision-Date: 2025-07-08 16:24+0000\n"
20+
"Last-Translator: Abheelash Mishra <[email protected]>\n"
21+
"Language-Team: Holidays Localization Team\n"
22+
"Language: en_GB\n"
23+
"MIME-Version: 1.0\n"
24+
"Content-Type: text/plain; charset=UTF-8\n"
25+
"Content-Transfer-Encoding: 8bit\n"
26+
"Generated-By: Lingva 5.0.6\n"
27+
"X-Source-Language: en_GB\n"
28+
29+
#. %s observed.
30+
#, c-format
31+
msgid "%s (observed)"
32+
msgstr ""
33+
34+
#. New Year's Day.
35+
msgid "New Year's Day"
36+
msgstr ""
37+
38+
#. National Heroes Day.
39+
msgid "National Heroes Day"
40+
msgstr ""
41+
42+
#. Ash Wednesday.
43+
msgid "Ash Wednesday"
44+
msgstr ""
45+
46+
#. Good Friday.
47+
msgid "Good Friday"
48+
msgstr ""
49+
50+
#. Easter Monday.
51+
msgid "Easter Monday"
52+
msgstr ""
53+
54+
#. Emancipation Day.
55+
msgid "Emancipation Day"
56+
msgstr ""
57+
58+
#. Discovery Day.
59+
msgid "Discovery Day"
60+
msgstr ""
61+
62+
#. Queen's Birthday.
63+
msgid "Queen's Birthday"
64+
msgstr ""
65+
66+
#. King's Birthday.
67+
msgid "King's Birthday"
68+
msgstr ""
69+
70+
#. Constitution Day.
71+
msgid "Constitution Day"
72+
msgstr ""
73+
74+
#. Remembrance Day.
75+
msgid "Remembrance Day"
76+
msgstr ""
77+
78+
#. Christmas Day.
79+
msgid "Christmas Day"
80+
msgstr ""
81+
82+
#. Boxing Day.
83+
msgid "Boxing Day"
84+
msgstr ""
85+
86+
#. Referendum Day.
87+
msgid "Referendum Day"
88+
msgstr ""
89+
90+
#. General Election Day.
91+
msgid "General Election Day"
92+
msgstr ""
93+
94+
#. 2009 Cayman Islands Constitution Day.
95+
msgid "2009 Cayman Islands Constitution Day"
96+
msgstr ""
97+
98+
#. UK Royal Wedding.
99+
msgid "UK Royal Wedding"
100+
msgstr ""
101+
102+
#. Queen Elizabeth II's Diamond Jubilee.
103+
msgid "Queen Elizabeth II's Diamond Jubilee"
104+
msgstr ""
105+
106+
#. Queen Elizabeth II's Funeral.
107+
msgid "Queen Elizabeth II's Funeral"
108+
msgstr ""
109+
110+
#. King Charles III's Coronation.
111+
msgid "Coronation of His Majesty King Charles III"
112+
msgstr ""

0 commit comments

Comments
 (0)