-
-
Notifications
You must be signed in to change notification settings - Fork 706
Add SIX Swiss Exchange (SIX) holidays #3692
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 all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b5da028
git commit -m fix_formating
pareshjoshij 729e205
add trailing period
pareshjoshij a7ad3bb
Apply suggestions
pareshjoshij 01884cc
added SAT_SUN_TO_NONE to constants set
pareshjoshij b8c6257
Apply suggestions
pareshjoshij e8f9a90
Refactor tests
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
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
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
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,67 @@ | ||
| # 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 datetime import date | ||
| from gettext import gettext as tr | ||
|
|
||
| from holidays.constants import PUBLIC | ||
| from holidays.countries.switzerland import Switzerland | ||
| from holidays.mixins.child_entity import ChildEntity | ||
|
|
||
|
|
||
| class SIXSwissExchange(ChildEntity, Switzerland): | ||
| """SIX Swiss Exchange (SIX) holidays. | ||
|
|
||
| References: | ||
| [2018](https://web.archive.org/web/20260712044834/https://www.six-group.com/dam/download/sites/education/preparatory-documentation/trading-module/trading-guide.pdf) | ||
| [2019](https://web.archive.org/web/20260712044834/https://www.six-group.com/dam/download/sites/education/preparatory-documentation/trading-module/trading-guide.pdf) | ||
| [2021](https://web.archive.org/web/20211102133818/https://www.six-group.com/dam/download/the-swiss-stock-exchange/trading/trading-provisions/regulation/trading-guides/trading-calendar-2021.pdf) | ||
| [2022](https://web.archive.org/web/20220420104843/https://www.six-group.com/dam/download/the-swiss-stock-exchange/trading/trading-provisions/regulation/trading-guides/trading-calendar-2022.pdf) | ||
| [2023](https://web.archive.org/web/20220626051815/https://www.six-group.com/dam/download/the-swiss-stock-exchange/trading/trading-provisions/regulation/trading-guides/trading-calendar-2023.pdf) | ||
| [2024](https://web.archive.org/web/20240521040627/https://www.six-group.com/dam/download/the-swiss-stock-exchange/trading/trading-provisions/regulation/trading-guides/trading-calendar-2024.pdf) | ||
| [2025](https://web.archive.org/web/20250908065713/https://www.six-group.com/dam/download/the-swiss-stock-exchange/trading/trading-provisions/regulation/trading-guides/trading-calendar-2025.pdf) | ||
| [2026](https://web.archive.org/web/20251225182641/https://www.six-group.com/dam/download/the-swiss-stock-exchange/trading/trading-provisions/regulation/trading-guides/trading-calendar-2026.pdf) | ||
| """ | ||
|
|
||
| country = None # type: ignore[assignment] | ||
| market = "XSWX" | ||
| parent_entity = Switzerland | ||
| parent_entity_subdivision_code = "ZH" | ||
| supported_categories: tuple[str] = (PUBLIC,) | ||
| start_year = 2000 | ||
|
|
||
| def _add_holiday(self, name: str, *args) -> date | None: | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| dt = args if len(args) > 1 else args[0] | ||
| dt = dt if isinstance(dt, date) else date(self._year, *dt) | ||
| if self._is_weekend(dt): | ||
| return None | ||
| return super()._add_holiday(name, dt) | ||
|
|
||
| def _populate_public_holidays(self) -> None: | ||
| super()._populate_public_holidays() | ||
|
|
||
| # Saint Berchtold's Day. | ||
| self._add_new_years_day_two(tr("Berchtoldstag")) | ||
|
|
||
| # Christmas Eve. | ||
| self._add_christmas_eve(tr("Heiligabend")) | ||
|
|
||
| # New Year's Eve. | ||
| self._add_new_years_eve(tr("Vortag vor Neujahr")) | ||
|
|
||
|
|
||
| class XSWX(SIXSwissExchange): | ||
| pass | ||
|
|
||
|
|
||
| class SIX(SIXSwissExchange): | ||
| 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
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,40 @@ | ||
| # 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) | ||
| # | ||
| # SIX Swiss Exchange (SIX) holidays. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.101\n" | ||
| "Report-Msgid-Bugs-To: l10n@vacanza.dev\n" | ||
| "POT-Creation-Date: 2026-07-11 00:25+0000\n" | ||
| "PO-Revision-Date: 2026-07-12 13:15+0000\n" | ||
| "Last-Translator: Paresh Joshi <pareshjoshij@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: de\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: de\n" | ||
|
|
||
| #. Saint Berchtold's Day. | ||
| msgid "Berchtoldstag" | ||
| msgstr "" | ||
|
|
||
| #. Christmas Eve. | ||
| msgid "Heiligabend" | ||
| msgstr "" | ||
|
|
||
| #. New Year's Eve. | ||
| msgid "Vortag vor Neujahr" | ||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # 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) | ||
| # | ||
| # SIX Swiss Exchange (SIX) holidays en_US localization. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.101\n" | ||
| "Report-Msgid-Bugs-To: l10n@vacanza.dev\n" | ||
| "POT-Creation-Date: 2026-07-11 00:25+0000\n" | ||
| "PO-Revision-Date: 2026-07-12 13:15+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: de\n" | ||
|
|
||
| #. Saint Berchtold's Day. | ||
| msgid "Berchtoldstag" | ||
| msgstr "Saint Berchtold's Day" | ||
|
|
||
| #. Christmas Eve. | ||
| msgid "Heiligabend" | ||
| msgstr "Christmas Eve" | ||
|
|
||
| #. New Year's Eve. | ||
| msgid "Vortag vor Neujahr" | ||
| msgstr "New Year's Eve" |
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,40 @@ | ||
| # 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) | ||
| # | ||
| # SIX Swiss Exchange (SIX) holidays fr localization. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.101\n" | ||
| "Report-Msgid-Bugs-To: l10n@vacanza.dev\n" | ||
| "POT-Creation-Date: 2026-07-11 00:25+0000\n" | ||
| "PO-Revision-Date: 2026-07-12 13:15+0000\n" | ||
| "Last-Translator: Paresh Joshi <pareshjoshij@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: fr\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: de\n" | ||
|
|
||
| #. Saint Berchtold's Day. | ||
| msgid "Berchtoldstag" | ||
| msgstr "Saint-Berchtold" | ||
|
|
||
| #. Christmas Eve. | ||
| msgid "Heiligabend" | ||
| msgstr "Veille de Noël" | ||
|
|
||
| #. New Year's Eve. | ||
| msgid "Vortag vor Neujahr" | ||
| msgstr "Réveillon de la Saint-Sylvestre" |
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,40 @@ | ||
| # 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) | ||
| # | ||
| # SIX Swiss Exchange (SIX) holidays it localization. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.101\n" | ||
| "Report-Msgid-Bugs-To: l10n@vacanza.dev\n" | ||
| "POT-Creation-Date: 2026-07-11 00:25+0000\n" | ||
| "PO-Revision-Date: 2026-07-12 13:15+0000\n" | ||
| "Last-Translator: Paresh Joshi <pareshjoshij@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: it\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: de\n" | ||
|
|
||
| #. Saint Berchtold's Day. | ||
| msgid "Berchtoldstag" | ||
| msgstr "Giorno di Bertoldo" | ||
|
|
||
| #. Christmas Eve. | ||
| msgid "Heiligabend" | ||
| msgstr "Vigilia di Natale" | ||
|
|
||
| #. New Year's Eve. | ||
| msgid "Vortag vor Neujahr" | ||
| msgstr "Vigilia di Capodanno" |
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.