-
-
Notifications
You must be signed in to change notification settings - Fork 705
Add London Stock Exchange (LSE) holidays #3654
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
base: dev
Are you sure you want to change the base?
Changes from 4 commits
949dcc8
613b182
b0d20a8
57ea02b
9616c6b
9ae5b15
0e8d186
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # 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 HALF_DAY, PUBLIC | ||
| from holidays.countries.united_kingdom import UnitedKingdom | ||
| from holidays.mixins.child_entity import ChildEntity | ||
|
|
||
|
|
||
| class LondonStockExchange(ChildEntity, UnitedKingdom): | ||
| """London Stock Exchange holidays. | ||
|
|
||
| The London Stock Exchange (LSE) is closed on the bank holidays observed in | ||
| England and Wales, so its public holidays are an alias of the England | ||
| (``ENG``) subdivision of the United Kingdom, including the one-off royal | ||
| bank holidays. | ||
|
|
||
| On Christmas Eve and New Year's Eve the exchange runs a shortened trading | ||
| session (a half-day closing), available under the ``HALF_DAY`` category. | ||
|
|
||
| References: | ||
| * <https://en.wikipedia.org/wiki/London_Stock_Exchange> | ||
| * <https://en.wikipedia.org/wiki/Bank_holiday> | ||
| * [LSE business days](https://www.londonstockexchange.com/equities-trading/business-days) | ||
| """ | ||
|
|
||
| country = None # type: ignore[assignment] | ||
| market = "XLON" | ||
| parent_entity = UnitedKingdom | ||
| parent_entity_subdivision_code = "ENG" | ||
| supported_categories = (HALF_DAY, PUBLIC) | ||
| start_year = 2000 | ||
|
Comment on lines
+37
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eeshsaxena the LSE also observes early closures/half days (like Christmas Eve and New Year's Eve). Here is the reference link We will need to add half-day support to make this fully accurate. I've already done the research on this, so I am happy to help you implement this section if you'd like! Just let me know |
||
|
|
||
| def _populate_half_day_holidays(self): | ||
| # On these days the exchange runs a shortened session (a 12:30 close), | ||
| # exposed here under the HALF_DAY category with a label so end users can | ||
| # tell it apart from a full market holiday. | ||
|
|
||
| # %s (half-day closing). | ||
| half_day_closing_label = tr("%s (half-day closing)") | ||
|
|
||
| # Christmas Eve. | ||
| christmas_eve = self._format_holiday_name(half_day_closing_label, tr("Christmas Eve")) | ||
| self._add_christmas_eve(christmas_eve) | ||
|
|
||
| # New Year's Eve. | ||
| new_years_eve = self._format_holiday_name(half_day_closing_label, tr("New Year's Eve")) | ||
| self._add_new_years_eve(new_years_eve) | ||
|
KJhellico marked this conversation as resolved.
Outdated
KJhellico marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| class XLON(LondonStockExchange): | ||
| pass | ||
|
|
||
|
|
||
| class LSE(LondonStockExchange): | ||
| pass | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # 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) | ||
| # | ||
| # London Stock Exchange holidays. | ||
|
KJhellico marked this conversation as resolved.
Outdated
|
||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.100\n" | ||
| "Report-Msgid-Bugs-To: l10n@vacanza.dev\n" | ||
| "POT-Creation-Date: 2026-07-05 09:48+0530\n" | ||
| "PO-Revision-Date: 2026-07-05 09:48+0530\n" | ||
| "Last-Translator: eeshsaxena <eeshsaxena@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: en_GB\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: en_GB\n" | ||
|
|
||
| #. %s (half-day closing). | ||
| #, c-format | ||
| msgid "%s (half-day closing)" | ||
| msgstr "" | ||
|
|
||
| #. Christmas Eve. | ||
| msgid "Christmas Eve" | ||
| msgstr "" | ||
|
|
||
| #. New Year's Eve. | ||
| msgid "New Year's Eve" | ||
| msgstr "" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # 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) | ||
| # | ||
| # London Stock Exchange 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-07-05 09:48+0530\n" | ||
| "PO-Revision-Date: 2026-07-05 09:48+0530\n" | ||
| "Last-Translator: eeshsaxena <eeshsaxena@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: en_GB\n" | ||
|
|
||
| #. %s (half-day closing). | ||
| #, c-format | ||
| msgid "%s (half-day closing)" | ||
| msgstr "%s (half-day closing)" | ||
|
|
||
| #. Christmas Eve. | ||
| msgid "Christmas Eve" | ||
| msgstr "Christmas Eve" | ||
|
|
||
| #. New Year's Eve. | ||
| msgid "New Year's Eve" | ||
| msgstr "New Year's Eve" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # 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) | ||
| # | ||
| # London Stock Exchange holidays th localization. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.100\n" | ||
| "Report-Msgid-Bugs-To: l10n@vacanza.dev\n" | ||
| "POT-Creation-Date: 2026-07-05 09:48+0530\n" | ||
| "PO-Revision-Date: 2026-07-05 09:48+0530\n" | ||
| "Last-Translator: eeshsaxena <eeshsaxena@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: en_GB\n" | ||
|
|
||
| #. %s (half-day closing). | ||
| #, c-format | ||
| msgid "%s (half-day closing)" | ||
| msgstr "%s (ปิดครึ่งวัน)" | ||
|
|
||
| #. Christmas Eve. | ||
| msgid "Christmas Eve" | ||
| msgstr "วันคริสต์มาสอีฟ" | ||
|
|
||
| #. New Year's Eve. | ||
| msgid "New Year's Eve" | ||
| msgstr "วันสิ้นปี" |
Uh oh!
There was an error while loading. Please reload this page.