Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -2038,6 +2038,13 @@ code when available. The following financial markets are available:
<td></td>
</tr>
<tr>
<td>SIX Swiss Exchange</td>
<td>XSWX</td>
<td>SIX Swiss Exchange market holidays</td>
<td><strong>de</strong>, en_US, fr, it, th, uk</td>
<td></td>
</tr>
<tr>
<td>Toronto Stock Exchange</td>
<td>XTSE</td>
<td>Toronto Stock Exchange (TSX) market holidays</td>
Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/jersey.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
ObservedHolidayBase,
SAT_SUN_TO_NEXT_WORKDAY,
SUN_TO_NEXT_WORKDAY,
SAT_TO_NONE,
SUN_TO_NONE,
SAT_SUN_TO_NONE,
)


Expand Down Expand Up @@ -145,7 +145,7 @@ def _populate_public_holidays(self) -> None:
self._add_observed(
# Liberation Day
self._add_holiday_may_9("Liberation Day"),
rule=SAT_TO_NONE + SUN_TO_NONE if self._year <= 2010 else SUN_TO_NONE,
rule=SAT_SUN_TO_NONE if self._year <= 2010 else SUN_TO_NONE,
)


Expand Down
5 changes: 2 additions & 3 deletions holidays/countries/macau.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
ObservedHolidayBase,
SUN_TO_NEXT_WORKDAY,
SAT_SUN_TO_NEXT_WORKDAY,
SAT_TO_NONE,
SUN_TO_NONE,
SAT_SUN_TO_NONE,
)


Expand Down Expand Up @@ -358,7 +357,7 @@ def _populate_government_holidays(self):
self._move_holiday(
# New Year's Eve.
self._add_new_years_eve(self._format_holiday_name(begin_time_label, tr("除夕"))),
rule=SAT_TO_NONE + SUN_TO_NONE,
rule=SAT_SUN_TO_NONE,
)

if self.observed:
Expand Down
14 changes: 7 additions & 7 deletions holidays/countries/switzerland.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
MON_ONLY,
TUE_TO_NONE,
SAT_TO_NONE,
SUN_TO_NONE,
SAT_SUN_TO_NONE,
ALL_TO_NEXT_MON,
)

Expand All @@ -44,7 +44,7 @@ class Switzerland(ObservedHolidayBase, ChristianHolidays, InternationalHolidays)
country = "CH"
default_language = "de"
start_year = 1801
subdivisions = (
subdivisions: tuple[str, ...] = (
# Cantons.
"AG", # Aargau.
"AI", # Appenzell Innerrhoden.
Expand Down Expand Up @@ -111,7 +111,7 @@ class Switzerland(ObservedHolidayBase, ChristianHolidays, InternationalHolidays)
# Cities.
"Stadt Zürich": "Stadt Zurich",
}
supported_categories = (DE_FACTO, HALF_DAY, OPTIONAL, PUBLIC)
supported_categories: tuple[str, ...] = (DE_FACTO, HALF_DAY, OPTIONAL, PUBLIC)
supported_languages = ("de", "en_US", "fr", "it", "th", "uk")

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -811,10 +811,10 @@ def _populate_subdiv_stadt_zurich_optional_holidays(self):

# Bridge Holiday.
name = tr("Brückentag")
self._add_observed(self._add_holiday_dec_27(name), rule=SAT_TO_NONE + SUN_TO_NONE)
self._add_observed(self._add_holiday_dec_28(name), rule=SAT_TO_NONE + SUN_TO_NONE)
self._add_observed(self._add_holiday_dec_29(name), rule=SAT_TO_NONE + SUN_TO_NONE)
self._add_observed(self._add_holiday_dec_30(name), rule=SAT_TO_NONE + SUN_TO_NONE)
self._add_observed(self._add_holiday_dec_27(name), rule=SAT_SUN_TO_NONE)
self._add_observed(self._add_holiday_dec_28(name), rule=SAT_SUN_TO_NONE)
self._add_observed(self._add_holiday_dec_29(name), rule=SAT_SUN_TO_NONE)
self._add_observed(self._add_holiday_dec_30(name), rule=SAT_SUN_TO_NONE)

@property
def _vernal_equinox_date(self) -> tuple[int, int]:
Expand Down
1 change: 1 addition & 0 deletions holidays/financial/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
from holidays.financial.ny_stock_exchange import NewYorkStockExchange, XNYS, NYSE
from holidays.financial.shanghai_stock_exchange import ShanghaiStockExchange, XSHG, SSE
from holidays.financial.shenzhen_stock_exchange import ShenzhenStockExchange, XSHE, SZSE
from holidays.financial.six_swiss_exchange import SIXSwissExchange, XSWX, SIX
from holidays.financial.toronto_stock_exchange import TorontoStockExchange, XTSE, TSX
4 changes: 2 additions & 2 deletions holidays/financial/bolsa_mexicana_de_valores.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from holidays.calendars.gregorian import SEP
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_NONE, SUN_TO_NONE
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NONE


class BolsaMexicanaDeValores(
Expand Down Expand Up @@ -63,7 +63,7 @@ def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
StaticHolidays.__init__(self, BolsaMexicanaDeValoresStaticHolidays)
kwargs.setdefault("observed_rule", SAT_TO_NONE + SUN_TO_NONE)
kwargs.setdefault("observed_rule", SAT_SUN_TO_NONE)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
Expand Down
4 changes: 2 additions & 2 deletions holidays/financial/national_stock_exchange_of_india.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
IslamicHolidays,
StaticHolidays,
)
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_NONE, SUN_TO_NONE
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NONE


class NationalStockExchangeOfIndia(
Expand Down Expand Up @@ -85,7 +85,7 @@ def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
calendar_delta_days=+1,
)
StaticHolidays.__init__(self, cls=NationalStockExchangeOfIndiaStaticHolidays)
kwargs.setdefault("observed_rule", SAT_TO_NONE + SUN_TO_NONE)
kwargs.setdefault("observed_rule", SAT_SUN_TO_NONE)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
Expand Down
67 changes: 67 additions & 0 deletions holidays/financial/six_swiss_exchange.py
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)
Comment thread
KJhellico marked this conversation as resolved.
[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:
Comment thread
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
5 changes: 2 additions & 3 deletions holidays/financial/toronto_stock_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
SAT_SUN_TO_NEXT_MON_TUE,
SAT_SUN_TO_NEXT_MON,
MON_TO_NEXT_TUE,
SAT_TO_NONE,
SUN_TO_NONE,
SAT_SUN_TO_NONE,
)


Expand Down Expand Up @@ -118,7 +117,7 @@ def _populate_half_day_holidays(self):
self._move_holiday(
# Christmas Eve.
self._add_christmas_eve(self._format_holiday_name(pause_label, tr("Christmas Eve"))),
rule=SAT_TO_NONE + SUN_TO_NONE,
rule=SAT_SUN_TO_NONE,
)


Expand Down
40 changes: 40 additions & 0 deletions holidays/locale/de/LC_MESSAGES/XSWX.po
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 ""
40 changes: 40 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/XSWX.po
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"
40 changes: 40 additions & 0 deletions holidays/locale/fr/LC_MESSAGES/XSWX.po
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"
40 changes: 40 additions & 0 deletions holidays/locale/it/LC_MESSAGES/XSWX.po
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"
Loading