Repository: dr-prodigy/python-holidays

Issue:
Missing Orthodox Good Friday in Greece national holiday
Hello team,
I was looking at your package's data and noticed one missing day for Greece.

Source: https://www.officeholidays.com/countries/greece/2022
Missing day: 2023 Fri, Apr 14 National Holiday (Orthodox Good Friday)

Would it be possible to include it in your package, please?

Best regards,
David Boudart

Comments:

Patch:
diff --git a/holidays/countries/greece.py b/holidays/countries/greece.py
index 28b24919..fae02e99 100644
--- a/holidays/countries/greece.py
+++ b/holidays/countries/greece.py
@@ -9,13 +9,12 @@
 #  Website: https://github.com/dr-prodigy/python-holidays
 #  License: MIT (see LICENSE file)
 
-from datetime import date
 from datetime import timedelta as td
 from gettext import gettext as tr
 
 from holidays.calendars import _get_nth_weekday_from, JULIAN_CALENDAR
 from holidays.calendars import GREGORIAN_CALENDAR
-from holidays.constants import MAR, MAY, OCT, MON
+from holidays.constants import MAR, OCT, MON
 from holidays.holiday_base import HolidayBase
 from holidays.holiday_groups import ChristianHolidays, InternationalHolidays
 
@@ -52,6 +51,9 @@ class Greece(HolidayBase, ChristianHolidays, InternationalHolidays):
         # Independence Day.
         self._add_holiday(tr("Εικοστή Πέμπτη Μαρτίου"), MAR, 25)
 
+        # Good Friday.
+        self._add_good_friday(tr("Μεγάλη Παρασκευή"))
+
         # Easter Monday.
         self._add_easter_monday(tr("Δευτέρα του Πάσχα"))
 
@@ -62,8 +64,7 @@ class Greece(HolidayBase, ChristianHolidays, InternationalHolidays):
         name = self.tr("Εργατική Πρωτομαγιά")
         name_observed = self.tr("%s (παρατηρήθηκε)")
 
-        dt = date(year, MAY, 1)
-        self._add_holiday(name, dt)
+        dt = self._add_labor_day(name)
         if self.observed and self._is_weekend(dt):
             # https://en.wikipedia.org/wiki/Public_holidays_in_Greece
             labour_day_observed_date = _get_nth_weekday_from(1, MON, dt)
diff --git a/holidays/locale/el/LC_MESSAGES/GR.po b/holidays/locale/el/LC_MESSAGES/GR.po
index 78316365..11ba671e 100644
--- a/holidays/locale/el/LC_MESSAGES/GR.po
+++ b/holidays/locale/el/LC_MESSAGES/GR.po
@@ -3,10 +3,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Python Holidays 0.20\n"
-"POT-Creation-Date: 2023-02-15 14:53-0800\n"
-"PO-Revision-Date: 2023-02-16 08:50-0800\n"
-"Last-Translator: Arkadii Yakovets <ark@cho.red>\n"
+"Project-Id-Version: Python Holidays 0.26\n"
+"POT-Creation-Date: 2023-06-01 17:41+0300\n"
+"PO-Revision-Date: 2023-06-01 17:43+0300\n"
+"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
 "Language-Team: Python Holidays localization team\n"
 "Language: el\n"
 "MIME-Version: 1.0\n"
@@ -16,60 +16,65 @@ msgstr ""
 "X-Generator: Poedit 3.2.2\n"
 
 #. New Year's Day.
-#: ./holidays/countries/greece.py:44
+#: ./holidays/countries/greece.py:43
 msgid "Πρωτοχρονιά"
 msgstr ""
 
 #. Epiphany.
-#: ./holidays/countries/greece.py:47
+#: ./holidays/countries/greece.py:46
 msgid "Θεοφάνεια"
 msgstr ""
 
 #. Clean Monday.
-#: ./holidays/countries/greece.py:50
+#: ./holidays/countries/greece.py:49
 msgid "Καθαρά Δευτέρα"
 msgstr ""
 
 #. Independence Day.
-#: ./holidays/countries/greece.py:53
+#: ./holidays/countries/greece.py:52
 msgid "Εικοστή Πέμπτη Μαρτίου"
 msgstr ""
 
+#. Good Friday.
+#: ./holidays/countries/greece.py:55
+msgid "Μεγάλη Παρασκευή"
+msgstr ""
+
 #. Easter Monday.
-#: ./holidays/countries/greece.py:56
+#: ./holidays/countries/greece.py:58
 msgid "Δευτέρα του Πάσχα"
 msgstr ""
 
 #. Monday of the Holy Spirit.
-#: ./holidays/countries/greece.py:59
+#: ./holidays/countries/greece.py:61
 msgid "Δευτέρα του Αγίου Πνεύματος"
 msgstr ""
 
 #. Labour Day.
-#: ./holidays/countries/greece.py:62
+#: ./holidays/countries/greece.py:64
 msgid "Εργατική Πρωτομαγιά"
 msgstr ""
 
-#: ./holidays/countries/greece.py:63
+#: ./holidays/countries/greece.py:65
 #, c-format
 msgid "%s (παρατηρήθηκε)"
 msgstr ""
 
 #. Assumption of Mary.
-#: ./holidays/countries/greece.py:77
+#: ./holidays/countries/greece.py:78
 msgid "Κοίμηση της Θεοτόκου"
 msgstr ""
 
 #. Ochi Day.
-#: ./holidays/countries/greece.py:80
+#: ./holidays/countries/greece.py:81
 msgid "Ημέρα του Όχι"
 msgstr ""
 
 #. Christmas Day.
-#: ./holidays/countries/greece.py:83
+#: ./holidays/countries/greece.py:84
 msgid "Χριστούγεννα"
 msgstr ""
 
-#: ./holidays/countries/greece.py:87
+#: ./holidays/countries/greece.py:88
 msgid "Επόμενη ημέρα των Χριστουγέννων"
 msgstr ""
diff --git a/holidays/locale/en_US/LC_MESSAGES/GR.po b/holidays/locale/en_US/LC_MESSAGES/GR.po
index 96288f05..d52e5c34 100644
--- a/holidays/locale/en_US/LC_MESSAGES/GR.po
+++ b/holidays/locale/en_US/LC_MESSAGES/GR.po
@@ -3,10 +3,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Python Holidays 0.20\n"
-"POT-Creation-Date: 2023-02-15 14:53-0800\n"
-"PO-Revision-Date: 2023-02-15 14:59-0800\n"
-"Last-Translator: Arkadii Yakovets <ark@cho.red>\n"
+"Project-Id-Version: Python Holidays 0.26\n"
+"POT-Creation-Date: 2023-06-01 17:41+0300\n"
+"PO-Revision-Date: 2023-06-01 17:44+0300\n"
+"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
 "Language-Team: Python Holidays localization team\n"
 "Language: en_US\n"
 "MIME-Version: 1.0\n"
@@ -16,60 +16,65 @@ msgstr ""
 "X-Generator: Poedit 3.2.2\n"
 
 #. New Year's Day.
-#: ./holidays/countries/greece.py:44
+#: ./holidays/countries/greece.py:43
 msgid "Πρωτοχρονιά"
 msgstr "New Year’s Day"
 
 #. Epiphany.
-#: ./holidays/countries/greece.py:47
+#: ./holidays/countries/greece.py:46
 msgid "Θεοφάνεια"
 msgstr "Epiphany"
 
 #. Clean Monday.
-#: ./holidays/countries/greece.py:50
+#: ./holidays/countries/greece.py:49
 msgid "Καθαρά Δευτέρα"
 msgstr "Clean Monday"
 
 #. Independence Day.
-#: ./holidays/countries/greece.py:53
+#: ./holidays/countries/greece.py:52
 msgid "Εικοστή Πέμπτη Μαρτίου"
 msgstr "Independence Day"
 
+#. Good Friday.
+#: ./holidays/countries/greece.py:55
+msgid "Μεγάλη Παρασκευή"
+msgstr "Good Friday"
+
 #. Easter Monday.
-#: ./holidays/countries/greece.py:56
+#: ./holidays/countries/greece.py:58
 msgid "Δευτέρα του Πάσχα"
 msgstr "Easter Monday"
 
 #. Monday of the Holy Spirit.
-#: ./holidays/countries/greece.py:59
+#: ./holidays/countries/greece.py:61
 msgid "Δευτέρα του Αγίου Πνεύματος"
 msgstr "Easter Monday"
 
 #. Labour Day.
-#: ./holidays/countries/greece.py:62
+#: ./holidays/countries/greece.py:64
 msgid "Εργατική Πρωτομαγιά"
 msgstr "Labor Day"
 
-#: ./holidays/countries/greece.py:63
+#: ./holidays/countries/greece.py:65
 #, c-format
 msgid "%s (παρατηρήθηκε)"
 msgstr "%s (Observed)"
 
 #. Assumption of Mary.
-#: ./holidays/countries/greece.py:77
+#: ./holidays/countries/greece.py:78
 msgid "Κοίμηση της Θεοτόκου"
 msgstr "Assumption of Mary Day"
 
 #. Ochi Day.
-#: ./holidays/countries/greece.py:80
+#: ./holidays/countries/greece.py:81
 msgid "Ημέρα του Όχι"
 msgstr "Ochi Day"
 
 #. Christmas Day.
-#: ./holidays/countries/greece.py:83
+#: ./holidays/countries/greece.py:84
 msgid "Χριστούγεννα"
 msgstr "Christmas Day"
 
-#: ./holidays/countries/greece.py:87
+#: ./holidays/countries/greece.py:88
 msgid "Επόμενη ημέρα των Χριστουγέννων"
 msgstr "Day After Christmas"


Test patch:
diff --git a/tests/countries/test_greece.py b/tests/countries/test_greece.py
index 93c1b87a..1d043600 100644
--- a/tests/countries/test_greece.py
+++ b/tests/countries/test_greece.py
@@ -9,8 +9,6 @@
 #  Website: https://github.com/dr-prodigy/python-holidays
 #  License: MIT (see LICENSE file)
 
-from datetime import date
-
 from holidays.countries.greece import Greece, GR, GRC
 from tests.common import TestCase
 
@@ -18,93 +16,122 @@ from tests.common import TestCase
 class TestGreece(TestCase):
     @classmethod
     def setUpClass(cls):
-        super().setUpClass(Greece)
+        super().setUpClass(Greece, years=range(2000, 2025))
 
     def test_country_aliases(self):
         self.assertCountryAliases(Greece, GR, GRC)
 
     def test_fixed_holidays(self):
         years = range(2000, 2025)
-        for y in years:
-            fdays = (
-                (date(y, 1, 1), "Πρωτοχρονιά"),
-                (date(y, 1, 6), "Θεοφάνεια"),
-                (date(y, 3, 25), "Εικοστή Πέμπτη Μαρτίου"),
-                (date(y, 5, 1), "Εργατική Πρωτομαγιά"),
-                (date(y, 8, 15), "Κοίμηση της Θεοτόκου"),
-                (date(y, 10, 28), "Ημέρα του Όχι"),
-                (date(y, 12, 25), "Χριστούγεννα"),
-                (date(y, 12, 26), "Επόμενη ημέρα των Χριστουγέννων"),
+        for m, d, name in (
+            (1, 1, "Πρωτοχρονιά"),
+            (1, 6, "Θεοφάνεια"),
+            (3, 25, "Εικοστή Πέμπτη Μαρτίου"),
+            (5, 1, "Εργατική Πρωτομαγιά"),
+            (8, 15, "Κοίμηση της Θεοτόκου"),
+            (10, 28, "Ημέρα του Όχι"),
+            (12, 25, "Χριστούγεννα"),
+            (12, 26, "Επόμενη ημέρα των Χριστουγέννων"),
+        ):
+            self.assertHolidaysName(
+                name, (f"{year}-{m}-{d}" for year in years)
             )
 
-            for d, dstr in fdays:
-                self.assertIn(d, self.holidays)
-                self.assertIn(dstr, self.holidays[d])
-
-    def test_gr_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),
+    def test_clean_monday(self):
+        self.assertHolidaysName(
+            "Καθαρά Δευτέρα",
+            "2018-02-19",
+            "2019-03-11",
+            "2020-03-02",
+            "2021-03-15",
+            "2022-03-07",
+            "2023-02-27",
+            "2024-03-18",
         )
 
-        for d in checkdates:
-            self.assertIn(d, self.holidays)
-            self.assertIn("Καθαρά Δευτέρα", self.holidays[d])
-
-    def test_gr_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),
+    def test_good_friday(self):
+        self.assertHolidaysName(
+            "Μεγάλη Παρασκευή",
+            "2018-04-06",
+            "2019-04-26",
+            "2020-04-17",
+            "2021-04-30",
+            "2022-04-22",
+            "2023-04-14",
+            "2024-05-03",
         )
 
-        for d in checkdates:
-            self.assertIn(d, self.holidays)
-            self.assertIn("Δευτέρα του Πάσχα", self.holidays[d])
-
-    def test_gr_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),
+    def test_easter_monday(self):
+        self.assertHolidaysName(
+            "Δευτέρα του Πάσχα",
+            "2018-04-09",
+            "2019-04-29",
+            "2020-04-20",
+            "2021-05-03",
+            "2022-04-25",
+            "2023-04-17",
+            "2024-05-06",
         )
 
-        for d in checkdates:
-            self.assertIn(d, self.holidays)
-            self.assertIn("Δευτέρα του Αγίου Πνεύματος", self.holidays[d])
-
-    def test_gr_labour_day_observed(self):
-        # Dates when labour day was observed on a different date
-        checkdates = (
-            date(2016, 5, 3),
-            date(2021, 5, 4),
-            date(2022, 5, 2),
-            date(2033, 5, 2),
+    def test_monday_of_the_holy_spirit(self):
+        self.assertHolidaysName(
+            "Δευτέρα του Αγίου Πνεύματος",
+            "2018-05-28",
+            "2019-06-17",
+            "2020-06-08",
+            "2021-06-21",
+            "2022-06-13",
+            "2023-06-05",
+            "2024-06-24",
         )
-        # Years when labour date was observed on May 1st
-        checkyears = (2017, 2018, 2019, 2020, 2023)
 
-        for d in checkdates:
-            self.assertIn(d, self.holidays)
-            self.assertIn("Εργατική Πρωτομαγιά", self.holidays[d])
+    def test_labour_day_observed(self):
+        name_observed = "Εργατική Πρωτομαγιά (παρατηρήθηκε)"
+        dt = (
+            "2011-05-02",
+            "2016-05-03",
+            "2021-05-04",
+            "2022-05-02",
+        )
+        self.assertHolidaysName(name_observed, dt)
+        self.assertNoNonObservedHoliday(dt)
+        self.assertNoHolidayName(name_observed, 2017, 2018, 2019, 2020, 2023)
+
+    def test_l10n_default(self):
+        self.assertLocalizedHolidays(
+            (
+                ("2022-01-01", "Πρωτοχρονιά"),
+                ("2022-01-06", "Θεοφάνεια"),
+                ("2022-03-07", "Καθαρά Δευτέρα"),
+                ("2022-03-25", "Εικοστή Πέμπτη Μαρτίου"),
+                ("2022-04-22", "Μεγάλη Παρασκευή"),
+                ("2022-04-25", "Δευτέρα του Πάσχα"),
+                ("2022-05-01", "Εργατική Πρωτομαγιά"),
+                ("2022-05-02", "Εργατική Πρωτομαγιά (παρατηρήθηκε)"),
+                ("2022-06-13", "Δευτέρα του Αγίου Πνεύματος"),
+                ("2022-08-15", "Κοίμηση της Θεοτόκου"),
+                ("2022-10-28", "Ημέρα του Όχι"),
+                ("2022-12-25", "Χριστούγεννα"),
+                ("2022-12-26", "Επόμενη ημέρα των Χριστουγέννων"),
+            )
+        )
 
-        # Check that there is no observed day created for years
-        # when Labour Day was on May 1st
-        for year in checkyears:
-            for day in (2, 3, 4):
-                d = date(year, 5, day)
-                if d in self.holidays:
-                    self.assertNotIn("Εργατική Πρωτομαγιά", self.holidays[d])
+    def test_l10n_en_us(self):
+        self.assertLocalizedHolidays(
+            (
+                ("2022-01-01", "New Year’s Day"),
+                ("2022-01-06", "Epiphany"),
+                ("2022-03-07", "Clean Monday"),
+                ("2022-03-25", "Independence Day"),
+                ("2022-04-22", "Good Friday"),
+                ("2022-04-25", "Easter Monday"),
+                ("2022-05-01", "Labor Day"),
+                ("2022-05-02", "Labor Day (Observed)"),
+                ("2022-06-13", "Easter Monday"),
+                ("2022-08-15", "Assumption of Mary Day"),
+                ("2022-10-28", "Ochi Day"),
+                ("2022-12-25", "Christmas Day"),
+                ("2022-12-26", "Day After Christmas"),
+            ),
+            "en_US",
+        )