Repository: vacanza/python-holidays

Issue:
Holidays in Malta
Would it be possible to add support for Malta, Europe as holidays ? Official list is available here: https://www.gov.mt/en/About%20Malta/Pages/Public%20Holidays.aspx 


Discussion:

Resolving patch:
diff --git a/holidays/countries/__init__.py b/holidays/countries/__init__.py
--- a/holidays/countries/__init__.py
+++ b/holidays/countries/__init__.py
@@ -62,6 +62,7 @@
 from .luxembourg import Luxembourg, LU, LUX
 from .malawi import Malawi, MW, MWI
 from .malaysia import Malaysia, MY, MYS
+from .malta import Malta, MT, MLT
 from .mexico import Mexico, MX, MEX
 from .morocco import Morocco, MA, MOR
 from .mozambique import Mozambique, MZ, MOZ
diff --git a/holidays/countries/malta.py b/holidays/countries/malta.py
new file mode 100644
--- /dev/null
+++ b/holidays/countries/malta.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+
+#  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
+from dateutil.relativedelta import relativedelta as rd
+
+from holidays.constants import JAN, FEB, MAR, MAY, JUN, AUG, SEP, DEC
+from holidays.holiday_base import HolidayBase
+
+
+class Malta(HolidayBase):
+    # https://www.gov.mt/en/About%20Malta/Pages/Public%20Holidays.aspx
+
+    country = "MT"
+
+    def __init__(self, **kwargs):
+        HolidayBase.__init__(self, **kwargs)
+
+    def _populate(self, year):
+        self[date(year, JAN, 1)] = "New Year"
+        self[date(year, FEB, 10)] = "Feast of St. Paul's Shipwreck"
+        self[date(year, MAR, 19)] = "Feast of St. Joseph"
+        self[date(year, MAR, 31)] = "Freedom Day"
+
+        # Easter and easter related calculations
+        e = easter(year)
+        good_friday = e - rd(days=2)
+
+        self[good_friday] = "Good Friday"
+
+        self[date(year, MAY, 1)] = "Worker's Day"
+        self[date(year, JUN, 7)] = "Sette Giugno"
+        self[date(year, JUN, 29)] = "Feast of St. Peter and St. Paul"
+        self[date(year, AUG, 15)] = "Feast of the Assumption"
+        self[date(year, SEP, 8)] = "Feast of Our Lady of Victories"
+        self[date(year, SEP, 21)] = "Independence Day"
+        self[date(year, DEC, 8)] = "Feast of the Immaculate Conception"
+        self[date(year, DEC, 13)] = "Republic Day"
+        self[date(year, DEC, 25)] = "Christmas Day"
+
+
+class MT(Malta):
+    pass
+
+
+class MLT(Malta):
+    pass


Test patch:
diff --git a/test/countries/test_malta.py b/test/countries/test_malta.py
new file mode 100644
--- /dev/null
+++ b/test/countries/test_malta.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+
+#  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
+import warnings
+
+from datetime import date
+
+import holidays
+
+
+class TestMT(unittest.TestCase):
+    def setUp(self):
+        self.holidays = holidays.MT()
+
+    def test_2022(self):
+        # https://www.gov.mt/en/About%20Malta/Pages/Public%20Holidays.aspx
+        self.assertIn(date(2022, 1, 1), self.holidays)
+        self.assertIn(date(2022, 2, 10), self.holidays)
+        self.assertIn(date(2022, 3, 19), self.holidays)
+        self.assertIn(date(2022, 3, 31), self.holidays)
+        self.assertIn(date(2022, 4, 15), self.holidays)
+        self.assertIn(date(2022, 5, 1), self.holidays)
+        self.assertIn(date(2022, 6, 7), self.holidays)
+        self.assertIn(date(2022, 6, 29), self.holidays)
+        self.assertIn(date(2022, 8, 15), self.holidays)
+        self.assertIn(date(2022, 9, 8), self.holidays)
+        self.assertIn(date(2022, 9, 21), self.holidays)
+        self.assertIn(date(2022, 12, 8), self.holidays)
+        self.assertIn(date(2022, 12, 13), self.holidays)
+        self.assertIn(date(2022, 12, 25), self.holidays)
+
+        self.assertNotIn(date(2022, 11, 12), self.holidays)