Skip to content

Commit fcae489

Browse files
kritibirda26KJhellicoarkid15r
authored
Add Mali holidays (#2725)
Signed-off-by: Kriti Birda <[email protected]> Co-authored-by: ~Jhellico <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]>
1 parent 5861348 commit fcae489

File tree

8 files changed

+532
-1
lines changed

8 files changed

+532
-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 222 country codes. The standard way to refer to a country is by using its [ISO
108+
We currently support 223 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
@@ -1001,6 +1001,13 @@ any) in brackets, available languages and additional holiday categories. All cou
10011001
<td></td>
10021002
</tr>
10031003
<tr>
1004+
<td>Mali</td>
1005+
<td>ML</td>
1006+
<td></td>
1007+
<td>en_US, <strong>fr</strong></td>
1008+
<td></td>
1009+
</tr>
1010+
<tr>
10041011
<td>Malta</td>
10051012
<td>MT</td>
10061013
<td></td>

holidays/countries/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
from holidays.countries.malawi import Malawi, MW, MWI
140140
from holidays.countries.malaysia import Malaysia, MY, MYS
141141
from holidays.countries.maldives import Maldives, MV, MDV
142+
from holidays.countries.mali import Mali, ML, MLI
142143
from holidays.countries.malta import Malta, MT, MLT
143144
from holidays.countries.marshall_islands import MarshallIslands, MH, MHL, HolidaysMH
144145
from holidays.countries.martinique import Martinique, MQ, MTQ, HolidaysMQ

holidays/countries/mali.py

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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.calendars import _CustomIslamicHolidays
16+
from holidays.calendars.gregorian import JAN, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
17+
from holidays.groups import ChristianHolidays, InternationalHolidays, IslamicHolidays
18+
from holidays.holiday_base import HolidayBase
19+
20+
21+
class Mali(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays):
22+
"""Mali holidays.
23+
24+
References:
25+
* [Ordinance no. 54 of 1960](https://web.archive.org/web/20250619193041/https://sgg-mali.ml/JO/1960/mali-jo-1960-71.pdf)
26+
* [Law No. 28 of 1964](https://web.archive.org/web/20250619190638/https://sgg-mali.ml/JO/1964/mali-jo-1964-183.pdf)
27+
* [Ordinance no. 16 of 1992](https://web.archive.org/web/20250611221453/https://sgg-mali.ml/JO/1992/mali-jo-1992-08.pdf)
28+
* [Law No. 40 of 2005](https://web.archive.org/web/20250603120027/https://sgg-mali.ml/JO/2005/mali-jo-2005-25.pdf)
29+
"""
30+
31+
country = "ML"
32+
default_language = "fr"
33+
# %s (estimated).
34+
estimated_label = tr("%s (estimé)")
35+
start_year = 1961
36+
supported_languages = ("en_US", "fr")
37+
38+
def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
39+
"""
40+
Args:
41+
islamic_show_estimated:
42+
Whether to add "estimated" label to Islamic holidays name
43+
if holiday date is estimated.
44+
"""
45+
ChristianHolidays.__init__(self)
46+
IslamicHolidays.__init__(
47+
self, cls=MaliIslamicHolidays, show_estimated=islamic_show_estimated
48+
)
49+
InternationalHolidays.__init__(self)
50+
super().__init__(*args, **kwargs)
51+
52+
def _populate_public_holidays(self):
53+
# New Year's Day.
54+
self._add_new_years_day(tr("Jour de l'An"))
55+
56+
if self._year >= 1965:
57+
# Armed Forces Day.
58+
self._add_holiday_jan_20(tr("Journée de l'Armée"))
59+
60+
if self._year >= 1992:
61+
# Martyrs' Day.
62+
self._add_holiday_mar_26(tr("Journée du 26 mars"))
63+
64+
if self._year >= 2006:
65+
# Easter Monday.
66+
self._add_easter_monday(tr("Lundi de Pâques"))
67+
68+
# Labor Day.
69+
self._add_labor_day(tr("Fête du Travail"))
70+
71+
if self._year >= 1965:
72+
# Africa Day.
73+
self._add_africa_day(tr("Journée de l'Afrique"))
74+
75+
# National Day of the Republic of Mali.
76+
self._add_holiday_sep_22(tr("Fête Nationale de la République du Mali"))
77+
78+
# Christmas Day.
79+
self._add_christmas_day(tr("Fête de Noël"))
80+
81+
self._add_mawlid_day(
82+
# Prophet's Birthday.
83+
tr("Journée du Maouloud (Naissance du Prophète)")
84+
if self._year >= 2006
85+
# Prophet's Birthday.
86+
else tr("Journée du Mawloud")
87+
)
88+
89+
if self._year >= 2006:
90+
# Prophet's Baptism.
91+
self._add_prophet_baptism_day(tr("Journée du Maouloud (Baptême du Prophète)"))
92+
93+
# Eid al-Fitr.
94+
self._add_eid_al_fitr_day(tr("Journée de la Fête du Ramadan"))
95+
96+
# Eid al-Adha.
97+
self._add_eid_al_adha_day(tr("Journée de la Tabaski"))
98+
99+
100+
class ML(Mali):
101+
pass
102+
103+
104+
class MLI(Mali):
105+
pass
106+
107+
108+
class MaliIslamicHolidays(_CustomIslamicHolidays):
109+
# https://web.archive.org/web/20250619042440/https://www.timeanddate.com/holidays/mali/eid-al-adha
110+
EID_AL_ADHA_DATES = {
111+
2015: (SEP, 24),
112+
2016: (SEP, 13),
113+
2017: (SEP, 2),
114+
2018: (AUG, 22),
115+
2019: (AUG, 11),
116+
2020: (JUL, 31),
117+
2021: (JUL, 21),
118+
2022: (JUL, 9),
119+
2023: (JUN, 28),
120+
2024: (JUN, 17),
121+
2025: (JUN, 7),
122+
}
123+
124+
# https://web.archive.org/web/20250318001443/https://www.timeanddate.com/holidays/mali/eid-al-fitr
125+
EID_AL_FITR_DATES = {
126+
2015: (JUL, 18),
127+
2016: (JUL, 7),
128+
2017: (JUN, 26),
129+
2018: (JUN, 15),
130+
2019: (JUN, 3),
131+
2020: (MAY, 23),
132+
2021: (MAY, 12),
133+
2022: (MAY, 1),
134+
2023: (APR, 21),
135+
2024: (APR, 9),
136+
2025: (MAR, 30),
137+
}
138+
139+
# https://web.archive.org/web/20240424165412/https://www.timeanddate.com/holidays/mali/prophet-birthday
140+
MAWLID_DATES = {
141+
2015: ((JAN, 3), (DEC, 24)),
142+
2016: (DEC, 12),
143+
2017: (DEC, 1),
144+
2018: (NOV, 21),
145+
2019: (NOV, 10),
146+
2020: (OCT, 29),
147+
2021: (OCT, 19),
148+
2022: (OCT, 9),
149+
2023: (SEP, 28),
150+
2024: (SEP, 16),
151+
}

holidays/groups/islamic.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,23 @@ def _add_nuzul_al_quran_day(self, name) -> set[date]:
373373
name, self._islamic_calendar.nuzul_al_quran_dates(self._year)
374374
)
375375

376+
def _add_prophet_baptism_day(self, name) -> set[date]:
377+
"""
378+
Add Prophet's Baptism.
379+
380+
Celebrated one week after the Prophet Mohammed's Birthday, this
381+
marks the traditional Islamic birth rites that take place seven
382+
days after birth. While it is not recognized in mainstream Islam,
383+
Mali celebrates it as a cultural-religious public holiday that
384+
reflects the local interpretation and honor of the Prophet Muhammad.
385+
The term "baptism" is symbolic and not literal - there's no Islamic
386+
ritual akin to Christian baptism.
387+
https://www.officeholidays.com/holidays/mali/prophets-baptism
388+
"""
389+
return self._add_islamic_calendar_holiday(
390+
name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+7
391+
)
392+
376393
def _add_prophet_death_day(self, name) -> set[date]:
377394
"""
378395
Add death of Prophet Muhammad and Hasan ibn Ali day (28th day of 2nd month).
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
# Mali holidays en_US localization.
14+
#
15+
msgid ""
16+
msgstr ""
17+
"Project-Id-Version: Holidays 0.77\n"
18+
"POT-Creation-Date: 2025-07-13 16:01+0530\n"
19+
"PO-Revision-Date: 2025-07-13 16:01+0530\n"
20+
"Last-Translator: Kriti Birda <[email protected]>\n"
21+
"Language-Team: Holidays Localization Team\n"
22+
"Language: en_US\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: fr\n"
28+
29+
#. %s (estimated).
30+
#, c-format
31+
msgid "%s (estimé)"
32+
msgstr "%s (estimated)"
33+
34+
#. New Year's Day.
35+
msgid "Jour de l'An"
36+
msgstr "New Year's Day"
37+
38+
#. Armed Forces Day.
39+
msgid "Journée de l'Armée"
40+
msgstr "Armed Forces Day"
41+
42+
#. Martyrs' Day.
43+
msgid "Journée du 26 mars"
44+
msgstr "Martyrs' Day"
45+
46+
#. Easter Monday.
47+
msgid "Lundi de Pâques"
48+
msgstr "Easter Monday"
49+
50+
#. Labor Day.
51+
msgid "Fête du Travail"
52+
msgstr "Labor Day"
53+
54+
#. Africa Day.
55+
msgid "Journée de l'Afrique"
56+
msgstr "Africa Day"
57+
58+
#. National Day of the Republic of Mali.
59+
msgid "Fête Nationale de la République du Mali"
60+
msgstr "National Day of the Republic of Mali"
61+
62+
#. Christmas Day.
63+
msgid "Fête de Noël"
64+
msgstr "Christmas Day"
65+
66+
#. Prophet's Birthday.
67+
msgid "Journée du Maouloud (Naissance du Prophète)"
68+
msgstr "Prophet's Birthday"
69+
70+
#. Prophet's Birthday.
71+
msgid "Journée du Mawloud"
72+
msgstr "Prophet's Birthday"
73+
74+
#. Prophet's Baptism.
75+
msgid "Journée du Maouloud (Baptême du Prophète)"
76+
msgstr "Prophet's Baptism"
77+
78+
#. Eid al-Fitr.
79+
msgid "Journée de la Fête du Ramadan"
80+
msgstr "Eid al-Fitr"
81+
82+
#. Eid al-Adha.
83+
msgid "Journée de la Tabaski"
84+
msgstr "Eid al-Adha"

holidays/locale/fr/LC_MESSAGES/ML.po

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
# Mali holidays.
14+
#
15+
msgid ""
16+
msgstr ""
17+
"Project-Id-Version: Holidays 0.77\n"
18+
"POT-Creation-Date: 2025-07-13 16:01+0530\n"
19+
"PO-Revision-Date: 2025-07-13 16:01+0530\n"
20+
"Last-Translator: Kriti Birda <[email protected]>\n"
21+
"Language-Team: Holidays Localization Team\n"
22+
"Language: fr\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: fr\n"
28+
29+
#. %s (estimated).
30+
#, c-format
31+
msgid "%s (estimé)"
32+
msgstr ""
33+
34+
#. New Year's Day.
35+
msgid "Jour de l'An"
36+
msgstr ""
37+
38+
#. Armed Forces Day.
39+
msgid "Journée de l'Armée"
40+
msgstr ""
41+
42+
#. Martyrs' Day.
43+
msgid "Journée du 26 mars"
44+
msgstr ""
45+
46+
#. Easter Monday.
47+
msgid "Lundi de Pâques"
48+
msgstr ""
49+
50+
#. Labor Day.
51+
msgid "Fête du Travail"
52+
msgstr ""
53+
54+
#. Africa Day.
55+
msgid "Journée de l'Afrique"
56+
msgstr ""
57+
58+
#. National Day of the Republic of Mali.
59+
msgid "Fête Nationale de la République du Mali"
60+
msgstr ""
61+
62+
#. Christmas Day.
63+
msgid "Fête de Noël"
64+
msgstr ""
65+
66+
#. Prophet's Birthday.
67+
msgid "Journée du Maouloud (Naissance du Prophète)"
68+
msgstr ""
69+
70+
#. Prophet's Birthday.
71+
msgid "Journée du Mawloud"
72+
msgstr ""
73+
74+
#. Prophet's Baptism.
75+
msgid "Journée du Maouloud (Baptême du Prophète)"
76+
msgstr ""
77+
78+
#. Eid al-Fitr.
79+
msgid "Journée de la Fête du Ramadan"
80+
msgstr ""
81+
82+
#. Eid al-Adha.
83+
msgid "Journée de la Tabaski"
84+
msgstr ""

holidays/registry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
"malawi": ("Malawi", "MW", "MWI"),
143143
"malaysia": ("Malaysia", "MY", "MYS"),
144144
"maldives": ("Maldives", "MV", "MDV"),
145+
"mali": ("Mali", "ML", "MLI"),
145146
"malta": ("Malta", "MT", "MLT"),
146147
"marshall_islands": ("MarshallIslands", "MH", "MHL", "HolidaysMH"),
147148
"martinique": ("Martinique", "MQ", "MTQ", "HolidaysMQ"),

0 commit comments

Comments
 (0)