Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Arjun Anandkumar
Arkadii Yakovets
Artem Tserekh
Ary Hauffe Neto
Arya Phansalkar
Bailey Thompson
Ben Collerson
Ben Letham
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ and detailed information.

## Available Countries

We currently support 245 country codes. The standard way to refer to a country is by using its [ISO
We currently support 246 country codes. The standard way to refer to a country is by using its [ISO
3166-1 alpha-2 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes), the same used
for domain names, and for a subdivision its [ISO 3166-2
code](https://en.wikipedia.org/wiki/ISO_3166-2). Some countries have common or foreign names or
Expand Down Expand Up @@ -427,6 +427,13 @@ any) in brackets, available languages and additional holiday categories. All cou
<td>GOVERNMENT, OPTIONAL</td>
</tr>
<tr>
<td>Canary Islands</td>
<td>IC</td>
<td>Can also be loaded as country ES, subdivision CN</td>
<td>en_US, <strong>es</strong>, uk</td>
<td></td>
</tr>
<tr>
<td>Cayman Islands</td>
<td>KY</td>
<td></td>
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from holidays.countries.cambodia import Cambodia, KH, KHM
from holidays.countries.cameroon import Cameroon, CM, CMR
from holidays.countries.canada import Canada, CA, CAN
from holidays.countries.canary_islands import CanaryIslands, IC, HolidaysIC
from holidays.countries.cayman_islands import CaymanIslands, KY, CYM
from holidays.countries.central_african_republic import CentralAfricanRepublic, CF, CAF
from holidays.countries.chad import Chad, TD, TCD
Expand Down
40 changes: 40 additions & 0 deletions holidays/countries/canary_islands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from holidays.countries.spain import Spain
from holidays.mixins.child_entity import ChildEntity


class HolidaysIC(ChildEntity, Spain):
"""Canary Islands holidays.

Alias of a Spanish subdivision that is also officially assigned
its own country code in ISO 3166-1.

References:
* <https://en.wikipedia.org/wiki/Public_holidays_in_Spain>
* <https://en.wikipedia.org/wiki/Canary_Islands>
"""

country = "IC"
parent_entity = Spain
parent_entity_subdivision_code = "CN"
# The autonomous community of the Canary Islands was established in 1982.
start_year = 1983


class CanaryIslands(HolidaysIC):
pass


class IC(CanaryIslands):
pass
2 changes: 1 addition & 1 deletion holidays/countries/spain.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Spain(
observed_estimated_label = tr("Lunes siguiente a %s (estimado)")
# Monday following %s.
observed_label = tr("Lunes siguiente a %s")
subdivisions = (
subdivisions: tuple[str, ...] = (
"AN", # Andalucía.
"AR", # Aragón.
"AS", # Asturias.
Expand Down
27 changes: 27 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/IC.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# Canary Islands holidays en_US localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.82\n"
"POT-Creation-Date: 2025-09-30 17:35+0000\n"
"PO-Revision-Date: 2025-09-30 17:35+0000\n"
"Last-Translator: AryaPhansalkar <aryacomets@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.6\n"
"X-Source-Language: es\n"
27 changes: 27 additions & 0 deletions holidays/locale/es/LC_MESSAGES/IC.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# Canary Islands holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.82\n"
"POT-Creation-Date: 2025-09-30 17:35+0000\n"
"PO-Revision-Date: 2025-09-30 17:35+0000\n"
"Last-Translator: AryaPhansalkar <aryacomets@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.6\n"
"X-Source-Language: es\n"
27 changes: 27 additions & 0 deletions holidays/locale/uk/LC_MESSAGES/IC.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# Canary Islands holidays uk localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.82\n"
"POT-Creation-Date: 2025-09-30 17:35+0000\n"
"PO-Revision-Date: 2025-09-30 17:35+0000\n"
"Last-Translator: AryaPhansalkar <aryacomets@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.6\n"
"X-Source-Language: es\n"
1 change: 1 addition & 0 deletions holidays/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"cambodia": ("Cambodia", "KH", "KHM"),
"cameroon": ("Cameroon", "CM", "CMR"),
"canada": ("Canada", "CA", "CAN"),
"canary_islands": ("CanaryIslands", "IC", "HolidaysIC"),
"cayman_islands": ("CaymanIslands", "KY", "CYM"),
"central_african_republic": ("CentralAfricanRepublic", "CF", "CAF"),
"chad": ("Chad", "TD", "TCD"),
Expand Down
111 changes: 111 additions & 0 deletions tests/countries/test_canary_islands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from unittest import TestCase

from holidays.countries.canary_islands import HolidaysIC, CanaryIslands, IC
from tests.common import CommonCountryTests


class TestCanaryIslands(CommonCountryTests, TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass(HolidaysIC)

def test_country_aliases(self):
self.assertAliases(HolidaysIC, CanaryIslands, IC)

def test_no_holidays(self):
self.assertNoHolidays(HolidaysIC(years=1982))

def test_1983(self):
self.assertHolidays(
CanaryIslands(years=1983),
("1983-01-01", "Año Nuevo"),
("1983-01-06", "Epifanía del Señor"),
("1983-03-31", "Jueves Santo"),
("1983-04-01", "Viernes Santo"),
("1983-05-01", "Fiesta del Trabajo"),
("1983-05-30", "Día de Canarias"),
("1983-08-15", "Asunción de la Virgen"),
("1983-10-12", "Fiesta Nacional de España"),
("1983-11-01", "Todos los Santos"),
("1983-12-06", "Día de la Constitución Española"),
("1983-12-08", "Inmaculada Concepción"),
("1983-12-25", "Natividad del Señor"),
)

def test_2025(self):
self.assertHolidays(
CanaryIslands(years=2025),
("2025-01-01", "Año Nuevo"),
("2025-01-06", "Epifanía del Señor"),
("2025-04-17", "Jueves Santo"),
("2025-04-18", "Viernes Santo"),
("2025-05-01", "Fiesta del Trabajo"),
("2025-05-30", "Día de Canarias"),
("2025-08-15", "Asunción de la Virgen"),
("2025-11-01", "Todos los Santos"),
("2025-12-06", "Día de la Constitución Española"),
("2025-12-08", "Inmaculada Concepción"),
("2025-12-25", "Natividad del Señor"),
)

def test_l10n_default(self):
self.assertLocalizedHolidays(
("1983-01-01", "Año Nuevo"),
("1983-01-06", "Epifanía del Señor"),
("1983-03-31", "Jueves Santo"),
("1983-04-01", "Viernes Santo"),
("1983-05-01", "Fiesta del Trabajo"),
("1983-05-30", "Día de Canarias"),
("1983-08-15", "Asunción de la Virgen"),
("1983-10-12", "Fiesta Nacional de España"),
("1983-11-01", "Todos los Santos"),
("1983-12-06", "Día de la Constitución Española"),
("1983-12-08", "Inmaculada Concepción"),
("1983-12-25", "Natividad del Señor"),
)

def test_l10n_en_us(self):
self.assertLocalizedHolidays(
"en_US",
("1983-01-01", "New Year's Day"),
("1983-01-06", "Epiphany"),
("1983-03-31", "Maundy Thursday"),
("1983-04-01", "Good Friday"),
("1983-05-01", "Labor Day"),
("1983-05-30", "Day of the Canary Islands"),
("1983-08-15", "Assumption Day"),
("1983-10-12", "National Day"),
("1983-11-01", "All Saints' Day"),
("1983-12-06", "Constitution Day"),
("1983-12-08", "Immaculate Conception"),
("1983-12-25", "Christmas Day"),
)

def test_l10n_uk(self):
self.assertLocalizedHolidays(
"uk",
("1983-01-01", "Новий рік"),
("1983-01-06", "Богоявлення"),
("1983-03-31", "Великий четвер"),
("1983-04-01", "Страсна пʼятниця"),
("1983-05-01", "День праці"),
("1983-05-30", "День Канарських островів"),
("1983-08-15", "Внебовзяття Пресвятої Діви Марії"),
("1983-10-12", "Національний день Іспанії"),
("1983-11-01", "День усіх святих"),
("1983-12-06", "День Конституції Іспанії"),
("1983-12-08", "Непорочне зачаття Діви Марії"),
("1983-12-25", "Різдво Христове"),
)