Repository: vacanza/python-holidays

Issue:
Official Cyprus Holidays
I noticed that you are missing one of the EU member countries Cyprus, I have added CY holidays here.


Discussion:
Hi @digidestination thank you for your support!
Would you please add relevant tests for your code?
You should be adding a new module named test_cyprus.py under the tests directory.

Thx, cheers
dr-p

Resolving patch:
diff --git a/holidays/countries/__init__.py b/holidays/countries/__init__.py
--- a/holidays/countries/__init__.py
+++ b/holidays/countries/__init__.py
@@ -28,6 +28,7 @@
 from .colombia import Colombia, CO, COL
 from .croatia import Croatia, HR, HRV
 from .curacao import Curacao, CW, CUW
+from .cyprus import Cyprus, CY, CYP
 from .czechia import Czechia, CZ, CZE
 from .denmark import Denmark, DK, DNK
 from .djibouti import Djibouti, DJ, DJI
diff --git a/holidays/countries/cyprus.py b/holidays/countries/cyprus.py
new file mode 100644
--- /dev/null
+++ b/holidays/countries/cyprus.py
@@ -0,0 +1,95 @@
+#  python-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: dr-prodigy <maurizio.montel@gmail.com> (c) 2017-2022
+#           ryanss <ryanssdev@icloud.com> (c) 2014-2017
+#  Website: https://github.com/dr-prodigy/python-holidays
+#  License: MIT (see LICENSE file)
+
+from datetime import date
+
+from dateutil.easter import easter, EASTER_ORTHODOX
+from dateutil.relativedelta import relativedelta as rd
+
+from holidays.constants import JAN, MAR, APR, MAY, AUG, OCT, DEC
+from holidays.holiday_base import HolidayBase
+
+
+class Cyprus(HolidayBase):
+    # https://en.wikipedia.org/wiki/Public_holidays_in_Cyprus
+
+    country = "CY"
+
+    def __init__(self, **kwargs):
+        HolidayBase.__init__(self, **kwargs)
+
+    def _populate(self, year):
+
+        eday = easter(year, method=EASTER_ORTHODOX)
+
+        # New Years
+        self[date(year, JAN, 1)] = "Πρωτοχρονιά [New Year's Day]"
+
+        # Epiphany
+        self[date(year, JAN, 6)] = "Θεοφάνεια [Epiphany]"
+
+        # Clean Monday
+        self[eday - rd(days=48)] = "Καθαρά Δευτέρα [Clean Monday]"
+
+        # Greek Independence Day
+        self[
+            date(year, MAR, 25)
+        ] = "Εικοστή Πέμπτη Μαρτίου [Greek Independence Day]"
+
+        # Cyprus National Day
+        self[date(year, APR, 1)] = "1η Απριλίου [Cyprus National Day]"
+
+        # Good Friday
+        self[eday - rd(days=2)] = "Μεγάλη Παρασκευή [Good Friday]"
+
+        # Easter Sunday
+        self[eday] = "Κυριακή του Πάσχα [Easter Sunday]"
+
+        # Easter Monday
+        self[eday + rd(days=1)] = "Δευτέρα του Πάσχα [Easter Monday]"
+
+        # Labour Day
+        self[date(year, MAY, 1)] = "Εργατική Πρωτομαγιά [Labour day]"
+
+        # Monday of the Holy Spirit
+        self[
+            eday + rd(days=50)
+        ] = "Δευτέρα του Αγίου Πνεύματος [Monday of the Holy Spirit]"
+
+        # Assumption of Mary
+        self[date(year, AUG, 15)] = "Κοίμηση της Θεοτόκου [Assumption of Mary]"
+
+        # Cyprus Independence Day
+        self[
+            date(year, OCT, 1)
+        ] = "Ημέρα Ανεξαρτησίας της Κύπρου [Cyprus Independence Day]"
+
+        # Ochi Day
+        self[date(year, OCT, 28)] = "Ημέρα του Όχι [Ochi Day]"
+
+        # Christmas Eve
+        self[date(year, DEC, 24)] = "Παραμονή Χριστουγέννων [Christmas Eve]"
+
+        # Christmas
+        self[date(year, DEC, 25)] = "Χριστούγεννα [Christmas]"
+
+        # Day after Christmas
+        self[
+            date(year, DEC, 26)
+        ] = "Δεύτερη μέρα Χριστουγέννων [Day after Christmas]"
+
+
+class CY(Cyprus):
+    pass
+
+
+class CYP(Cyprus):
+    pass


Test patch:
diff --git a/test/countries/test_cyprus.py b/test/countries/test_cyprus.py
new file mode 100644
--- /dev/null
+++ b/test/countries/test_cyprus.py
@@ -0,0 +1,133 @@
+#  python-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: dr-prodigy <maurizio.montel@gmail.com> (c) 2017-2022
+#           ryanss <ryanssdev@icloud.com> (c) 2014-2017
+#  Website: https://github.com/dr-prodigy/python-holidays
+#  License: MIT (see LICENSE file)
+
+import unittest
+
+from datetime import date
+
+import holidays
+
+
+class TestCyprus(unittest.TestCase):
+    def setUp(self):
+        self.cy_holidays = holidays.CY()
+
+    def test_fixed_holidays(self):
+        years = range(2000, 2025)
+        for y in years:
+            fdays = (
+                (date(y, 1, 1), "Πρωτοχρονιά [New Year's Day]"),
+                (date(y, 1, 6), "Θεοφάνεια [Epiphany]"),
+                (
+                    date(y, 3, 25),
+                    "Εικοστή Πέμπτη Μαρτίου [Greek Independence Day]",
+                ),
+                (date(y, 4, 1), "1η Απριλίου [Cyprus National Day]"),
+                (date(y, 5, 1), "Εργατική Πρωτομαγιά [Labour day]"),
+                (
+                    date(y, 8, 15),
+                    "Κοίμηση της Θεοτόκου [Assumption of Mary]",
+                ),
+                (date(y, 10, 28), "Ημέρα του Όχι [Ochi Day]"),
+                (date(y, 12, 25), "Χριστούγεννα [Christmas]"),
+                (
+                    date(y, 12, 26),
+                    "Δεύτερη μέρα Χριστουγέννων [Day after Christmas]",
+                ),
+            )
+
+        for (d, dstr) in fdays:
+            self.assertIn(d, self.cy_holidays)
+            self.assertIn(dstr, self.cy_holidays[d])
+
+    def test_cy_clean_monday(self):
+        checkdates = (
+            date(2018, 2, 19),
+            date(2019, 3, 11),
+            date(2020, 3, 2),
+            date(2021, 3, 15),
+            date(2022, 3, 7),
+            date(2023, 2, 27),
+            date(2024, 3, 18),
+        )
+
+        for d in checkdates:
+            self.assertIn(d, self.cy_holidays)
+            self.assertIn("Καθαρά Δευτέρα [Clean Monday]", self.cy_holidays[d])
+
+    def test_cy_good_friday(self):
+        checkdates = (
+            date(2018, 4, 6),
+            date(2019, 4, 26),
+            date(2020, 4, 17),
+            date(2021, 4, 30),
+            date(2022, 4, 22),
+            date(2023, 4, 14),
+            date(2024, 5, 3),
+        )
+
+        for d in checkdates:
+            self.assertIn(d, self.cy_holidays)
+            self.assertIn(
+                "Μεγάλη Παρασκευή [Good Friday]", self.cy_holidays[d]
+            )
+
+    def test_cy_easter_sunday(self):
+        checkdates = (
+            date(2018, 4, 8),
+            date(2019, 4, 28),
+            date(2020, 4, 19),
+            date(2021, 5, 2),
+            date(2022, 4, 24),
+            date(2023, 4, 16),
+            date(2024, 5, 5),
+        )
+
+        for d in checkdates:
+            self.assertIn(d, self.cy_holidays)
+            self.assertIn(
+                "Κυριακή του Πάσχα [Easter Sunday]", self.cy_holidays[d]
+            )
+
+    def test_cy_easter_monday(self):
+        checkdates = (
+            date(2018, 4, 9),
+            date(2019, 4, 29),
+            date(2020, 4, 20),
+            date(2021, 5, 3),
+            date(2022, 4, 25),
+            date(2023, 4, 17),
+            date(2024, 5, 6),
+        )
+
+        for d in checkdates:
+            self.assertIn(d, self.cy_holidays)
+            self.assertIn(
+                "Δευτέρα του Πάσχα [Easter Monday]", self.cy_holidays[d]
+            )
+
+    def test_cy_monday_of_the_holy_spirit(self):
+        checkdates = (
+            date(2018, 5, 28),
+            date(2019, 6, 17),
+            date(2020, 6, 8),
+            date(2021, 6, 21),
+            date(2022, 6, 13),
+            date(2023, 6, 5),
+            date(2024, 6, 24),
+        )
+
+        for d in checkdates:
+            self.assertIn(d, self.cy_holidays)
+            self.assertIn(
+                "Δευτέρα του Αγίου Πνεύματος " + "[Monday of the Holy Spirit]",
+                self.cy_holidays[d],
+            )