-
-
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 1 commit
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
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,69 @@ | ||
| # 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.constants import PUBLIC | ||
| from holidays.countries.switzerland import Switzerland | ||
| from holidays.mixins.child_entity import ChildEntity | ||
| from holidays.observed_holiday_base import SAT_TO_NONE, SUN_TO_NONE | ||
|
|
||
|
|
||
| class SIXSwissExchange(ChildEntity, Switzerland): # type: ignore[assignment, misc] | ||
| """SIX Swiss Exchange holidays. | ||
|
KJhellico marked this conversation as resolved.
Outdated
|
||
|
|
||
| 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) | ||
|
KJhellico marked this conversation as resolved.
|
||
| [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/20240910205011/https://www.six-group.com/en/market-data/news-tools/trading-currency-holiday-calendar.html#/#/) | ||
|
KJhellico marked this conversation as resolved.
Outdated
|
||
| [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 = (PUBLIC,) # type: ignore[assignment] | ||
|
KJhellico marked this conversation as resolved.
Outdated
|
||
| start_year = 2000 | ||
|
|
||
| _weekend_to_none_rule = SAT_TO_NONE + SUN_TO_NONE | ||
|
|
||
| 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")) | ||
|
|
||
| def _populate(self, year: int) -> None: | ||
| super()._populate(year) | ||
|
|
||
| if self.observed: | ||
| for dt in tuple(self.keys()): | ||
| if dt.year == year: | ||
| self._move_holiday_forced(dt, rule=self._weekend_to_none_rule) | ||
|
KJhellico marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| 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
| 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 holidays. | ||
|
KJhellico marked this conversation as resolved.
Outdated
|
||
| # | ||
| 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 12:10+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 "" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| #. 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 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 12:10+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" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| #. 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 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 12:10+0000\n" | ||
| "Last-Translator: Paresh Joshi <194076591+pareshjoshij@users.noreply.github.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 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 12:10+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" |
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 holidays th 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 12:10+0000\n" | ||
| "Last-Translator: Paresh Joshi <pareshjoshij@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: th\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 "วันส่งท้ายปีเก่า" | ||
|
PPsyrius marked this conversation as resolved.
Outdated
|
||
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 holidays uk 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 12:10+0000\n" | ||
| "Last-Translator: Paresh Joshi <pareshjoshij@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: uk\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
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.