-
-
Notifications
You must be signed in to change notification settings - Fork 704
Add Bolsa Mexicana de Valores (BMV) holidays #3639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
97eef63
Add Bolsa Mexicana de Valores (XMEX) holidays
pareshjoshij dbb0040
Change Last-Translator email
pareshjoshij f82063a
added uk localization
pareshjoshij 85a0012
applly suggetions
pareshjoshij c4aa438
update test
pareshjoshij aee8b62
update test
pareshjoshij e31b66a
Expanding the supported year range to start from 2001.
pareshjoshij d589c94
update test
pareshjoshij 8146b63
update code
pareshjoshij f433534
apply suggetions
pareshjoshij 73d37fe
apply sugetion
pareshjoshij File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") | ||
| 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"))) | ||
|
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")) | ||
|
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"))) | ||
|
PPsyrius marked this conversation as resolved.
|
||
|
|
||
| # Independence Day. | ||
| self._move_holiday(self._add_holiday_sep_16(tr("Día de la Independencia"))) | ||
|
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"))) | ||
|
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"))) | ||
|
PPsyrius marked this conversation as resolved.
|
||
|
|
||
| # Christmas Day. | ||
| self._move_holiday(self._add_christmas_day(tr("Navidad"))) | ||
|
PPsyrius marked this conversation as resolved.
|
||
|
|
||
|
|
||
| class XMEX(BolsaMexicanaDeValores): | ||
| pass | ||
|
|
||
|
|
||
| class BMV(BolsaMexicanaDeValores): | ||
| pass | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.