Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,13 @@ code when available. The following financial markets are available:
</thead>
<tbody>
<tr>
<td>Bolsa Mexicana de Valores</td>
<td>XMEX</td>
<td>Bolsa Mexicana de Valores (BMV) holidays</td>
<td>en_US, <strong>es</strong></td>
<td></td>
</tr>
<tr>
<td>Bombay Stock Exchange</td>
<td>XBOM</td>
<td>Bombay Stock Exchange (BSE) market holidays</td>
Expand Down
1 change: 1 addition & 0 deletions holidays/financial/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from holidays.financial.bolsa_mexicana_de_valores import BolsaMexicanaDeValores, XMEX, BMV
from holidays.financial.bombay_stock_exchange import BombayStockExchange, XBOM, BSE
from holidays.financial.brasil_bolsa_balcao import BrasilBolsaBalcao, BVMF, B3
from holidays.financial.chicago_mercantile_exchange import ChicagoMercantileExchange, XCME, CME
Expand Down
100 changes: 100 additions & 0 deletions holidays/financial/bolsa_mexicana_de_valores.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# 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 gettext import gettext as tr

from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_NONE, SUN_TO_NONE


class BolsaMexicanaDeValores(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
"""Bolsa Mexicana de Valores (BMV) holidays.

References:
* <https://web.archive.org/web/20260217214228/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos>

Historical data:
* [2014](https://web.archive.org/web/20151002034151/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2015](https://web.archive.org/web/20151002034151/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2016](https://web.archive.org/web/20161018231815/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2017](https://web.archive.org/web/20171102043000/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2018](https://web.archive.org/web/20181104081233/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2019](https://web.archive.org/web/20191113083233/http://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2020](https://web.archive.org/web/20201027043731/http://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2021](https://web.archive.org/web/20210105213246/http://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2022](https://web.archive.org/web/20220427200741/http://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2023](https://web.archive.org/web/20231205095710/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2024](https://web.archive.org/web/20241227124527/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2025](https://web.archive.org/web/20251008103743/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
* [2026](https://web.archive.org/web/20260217214228/https://www.bmv.com.mx/es/grupo-bmv/calendario-de-dias-festivos)
"""

market = "XMEX"
default_language = "es"
supported_languages = ("en_US", "es")
Comment thread
KJhellico marked this conversation as resolved.
Outdated
start_year = 2014

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
kwargs.setdefault("observed_rule", SAT_TO_NONE + SUN_TO_NONE)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# New Year's Day.
self._move_holiday(self._add_new_years_day(tr("Año Nuevo")))
Comment thread
PPsyrius marked this conversation as resolved.
Outdated

# Constitution Day.
self._add_holiday_1st_mon_of_feb(tr("Día de la Constitución"))

# Benito Juárez's birthday.
self._add_holiday_3rd_mon_of_mar(tr("Natalicio de Benito Juárez"))
Comment thread
KJhellico marked this conversation as resolved.
Outdated

# Maundy Thursday.
self._add_holy_thursday(tr("Jueves Santo"))

# Good Friday.
self._add_good_friday(tr("Viernes Santo"))

# Labor Day.
self._move_holiday(self._add_labor_day(tr("Día del Trabajo")))
Comment thread
PPsyrius marked this conversation as resolved.

# Independence Day.
self._move_holiday(self._add_holiday_sep_16(tr("Día de la Independencia")))
Comment thread
PPsyrius marked this conversation as resolved.

if (self._year - 1970) % 6 == 0:
# Change of Federal Government.
name = tr("Transmisión del Poder Ejecutivo Federal")
if self._year >= 2024:
self._move_holiday(self._add_holiday_oct_1(name))
else:
self._move_holiday(self._add_holiday_dec_1(name))

# Day of the Dead.
self._move_holiday(self._add_holiday_nov_2(tr("Día de Muertos")))
Comment thread
KJhellico marked this conversation as resolved.
Outdated

# Revolution Day.
self._add_holiday_3rd_mon_of_nov(tr("Día de la Revolución"))

# Bank Employee Day.
self._move_holiday(self._add_holiday_dec_12(tr("Día del Empleado Bancario")))
Comment thread
PPsyrius marked this conversation as resolved.

# Christmas Day.
self._move_holiday(self._add_christmas_day(tr("Navidad")))
Comment thread
PPsyrius marked this conversation as resolved.


class XMEX(BolsaMexicanaDeValores):
pass


class BMV(BolsaMexicanaDeValores):
pass
76 changes: 76 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/XMEX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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)
#
# Bolsa Mexicana de Valores (BMV) holidays en_US localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.100\n"
"Report-Msgid-Bugs-To: l10n@vacanza.dev\n"
"POT-Creation-Date: 2026-06-19 11:33+0530\n"
"PO-Revision-Date: 2026-06-20 18:28+0000\n"
"Last-Translator: Paresh Joshi <pareshjoshij@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"

#. New Year's Day.
msgid "Año Nuevo"
msgstr "New Year's Day"

#. Constitution Day.
msgid "Día de la Constitución"
msgstr "Constitution Day"

#. Benito Juárez's birthday.
msgid "Natalicio de Benito Juárez"
msgstr "Benito Juárez's birthday"

#. Maundy Thursday.
msgid "Jueves Santo"
msgstr "Maundy Thursday"

#. Good Friday.
msgid "Viernes Santo"
msgstr "Good Friday"

#. Labor Day.
msgid "Día del Trabajo"
msgstr "Labor Day"

#. Independence Day.
msgid "Día de la Independencia"
msgstr "Independence Day"

#. Change of Federal Government.
msgid "Transmisión del Poder Ejecutivo Federal"
msgstr "Change of Federal Government"

#. Day of the Dead.
msgid "Día de Muertos"
msgstr "Day of the Dead"

#. Revolution Day.
msgid "Día de la Revolución"
msgstr "Revolution Day"

#. Bank Employee Day.
msgid "Día del Empleado Bancario"
msgstr "Bank Employee Day"

#. Christmas Day.
msgid "Navidad"
msgstr "Christmas Day"
76 changes: 76 additions & 0 deletions holidays/locale/es/LC_MESSAGES/XMEX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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)
#
# Bolsa Mexicana de Valores (BMV) holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.100\n"
"Report-Msgid-Bugs-To: l10n@vacanza.dev\n"
"POT-Creation-Date: 2026-06-19 14:20+0000\n"
"PO-Revision-Date: 2026-06-20 17:55+0000\n"
"Last-Translator: Paresh Joshi <pareshjoshij@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"

#. New Year's Day.
msgid "Año Nuevo"
msgstr ""

#. Constitution Day.
msgid "Día de la Constitución"
msgstr ""

#. Benito Juárez's birthday.
msgid "Natalicio de Benito Juárez"
msgstr ""

#. Maundy Thursday.
msgid "Jueves Santo"
msgstr ""

#. Good Friday.
msgid "Viernes Santo"
msgstr ""

#. Labor Day.
msgid "Día del Trabajo"
msgstr ""

#. Independence Day.
msgid "Día de la Independencia"
msgstr ""

#. Change of Federal Government.
msgid "Transmisión del Poder Ejecutivo Federal"
msgstr ""

#. Day of the Dead.
msgid "Día de Muertos"
msgstr ""

#. Revolution Day.
msgid "Día de la Revolución"
msgstr ""

#. Bank Employee Day.
msgid "Día del Empleado Bancario"
msgstr ""

#. Christmas Day.
msgid "Navidad"
msgstr ""
1 change: 1 addition & 0 deletions holidays/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
}

FINANCIAL: RegistryDict = {
"bolsa_mexicana_de_valores": ("BolsaMexicanaDeValores", "XMEX", "BMV"),
"bombay_stock_exchange": ("BombayStockExchange", "XBOM", "BSE"),
"brasil_bolsa_balcao": ("BrasilBolsaBalcao", "BVMF", "B3"),
"chicago_mercantile_exchange": ("ChicagoMercantileExchange", "XCME", "CME"),
Expand Down
Loading