-
-
Notifications
You must be signed in to change notification settings - Fork 560
Add Togo holidays #2525
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
+597
−1
Merged
Add Togo holidays #2525
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
3595f4a
Initial Setup
Roshan-1024 103c534
Merge branch 'dev' into TG
Roshan-1024 55b077c
Update README.md and add missing tr()
Roshan-1024 2e5004e
Switch to HolidayBase and remove observed labels
Roshan-1024 5d8d2a2
Normalise apostrophes
Roshan-1024 b5efd6c
Update test_togo.py: Add more recent years
Roshan-1024 4944892
Merge branch 'dev' into TG
Roshan-1024 649034b
Merge branch 'dev' into TG
Roshan-1024 f71c8af
Remove 1960s and 1970s assertHolidayName checks for Whit Monday & Asc…
Roshan-1024 2c888bf
Remove Calendarific References
Roshan-1024 ed8687d
Fix date ordering in test_2025
Roshan-1024 b423fea
Expand test coverage for Ascension Day and Whit Monday
Roshan-1024 9e18c68
Add en_US localization and update start_year from 1960 to 1961
Roshan-1024 e807c4b
Add region-specific holiday support and relocate Prophet Mohammed's B…
Roshan-1024 f998a28
Rename to Journée anniversaire de la naissance du prophète Mohamed
Roshan-1024 5ed5b6e
Archive non-Wikipedia References
Roshan-1024 018a848
Merge branch 'dev' into TG
Roshan-1024 afa3ab4
Update References, remove good friday
Roshan-1024 36a2d6e
Merge branch 'dev' into TG
Roshan-1024 e4ae6bd
Shift to WORKDAY from OPTIONAL
Roshan-1024 becdbac
Merge branch 'dev' into TG
Roshan-1024 e499330
Apply suggestions
Roshan-1024 dc0811a
Update Ramadan References
Roshan-1024 b66eb41
Remove Prophet Mohammed's Birthday
Roshan-1024 9066a23
Merge branch 'dev' into TG
Roshan-1024 a8d4baf
Merge branch 'dev' into TG
Roshan-1024 24de3e0
Update countries count
Roshan-1024 6f109d2
Update code
KJhellico 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,182 @@ | ||
| # 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 <[email protected]> (c) 2017-2023 | ||
| # ryanss <[email protected]> (c) 2014-2017 | ||
| # Website: https://github.com/vacanza/holidays | ||
| # License: MIT (see LICENSE file) | ||
|
|
||
| from gettext import gettext as tr | ||
|
|
||
| from holidays.calendars import _CustomIslamicHolidays | ||
| from holidays.calendars.gregorian import MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV | ||
| from holidays.constants import PUBLIC, WORKDAY | ||
| from holidays.groups import ChristianHolidays, InternationalHolidays, IslamicHolidays | ||
| from holidays.holiday_base import HolidayBase | ||
|
|
||
|
|
||
| class Togo(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays): | ||
| """Togo holidays. | ||
|
|
||
| References: | ||
| * <https://en.wikipedia.org/wiki/Public_holidays_in_Togo> | ||
| * <https://web.archive.org/web/20250507123116/https://www.timeanddate.com/holidays/togo/> | ||
| * <https://web.archive.org/web/20250507123425/https://www.goethe.de/ins/tg/fr/ueb/fer.html> | ||
| * <https://web.archive.org/web/20250507123619/https://www.republiquetogolaise.com/politique/2309-3579-23-septembre-le-togo-rend-hommage-a-ses-martyrs> | ||
| * <https://web.archive.org/web/20250507123840/https://islam.zmo.de/s/westafrica/item/25841#?xywh=-405%2C-94%2C2376%2C1868> | ||
| * <https://en.wikipedia.org/wiki/1986_Togolese_coup_attempt> | ||
| * <https://web.archive.org/web/20250507131725/https://www.rfi.fr/fr/afrique/20140112-togo-le-13-janvier-est-plus-jour-fete> | ||
| * <https://web.archive.org/web/20250507124528/https://islam.zmo.de/s/afrique_ouest/item/25800#?xywh=-1641%2C0%2C4303%2C2363> | ||
Roshan-1024 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * <https://web.archive.org/web/20231202052731/https://www.holidayscalendar.com/event/anniversary-of-the-failed-attack-on-lome/> | ||
|
|
||
| Ramadan start dates: | ||
| * [2015](https://web.archive.org/web/20150825071241/https://www.republicoftogo.com/toutes-les-rubriques/societe/le-mois-du-jeune-debute-le-18-juin) | ||
| * [2016](https://web.archive.org/web/20250507125256/https://www.republicoftogo.com/toutes-les-rubriques/societe/le-ramadan-debute-le-6-juin) | ||
| * [2017](https://web.archive.org/web/20250507125353/https://www.tf1info.fr/societe/le-ramadan-2017-1438-commence-le-samedi-27-mai-comment-la-date-du-debut-du-jeune-est-elle-fixee-1512235.html) | ||
| * [2018](https://web.archive.org/web/20250507125622/https://www.republicoftogo.com/toutes-les-rubriques/societe/debut-du-ramadan-demain) | ||
| * [2019](https://web.archive.org/web/20250507130404/https://www.republiquetogolaise.com/social/0605-3100-la-communaute-musulmane-du-togo-entame-ce-lundi-le-jeune-du-mois-de-ramadan) | ||
| * [2020](https://web.archive.org/web/20250507125837/https://www.republiquetogolaise.com/culture/2404-4278-debut-du-mois-de-ramadan) | ||
| * [2021](https://web.archive.org/web/20250507130643/https://www.republiquetogolaise.com/culture/1304-5393-debut-du-mois-de-ramadan) | ||
| * [2022](https://web.archive.org/web/20250507130847/https://www.republiquetogolaise.com/culture/0304-6745-debut-du-mois-de-ramadan) | ||
| * [2023](https://web.archive.org/web/20250507131022/https://www.republiquetogolaise.com/culture/2303-7864-debut-du-mois-de-ramadan) | ||
| * [2024](https://web.archive.org/web/20250507131215/https://www.republiquetogolaise.com/culture/1103-9017-debut-du-mois-de-ramadan) | ||
| * [2025](https://web.archive.org/web/20250507131439/https://www.republiquetogolaise.com/culture/2802-10360-le-jeune-de-ramadan-debute-le-1er-mars) | ||
| """ | ||
|
|
||
| country = "TG" | ||
| default_language = "fr" | ||
| supported_categories = (PUBLIC, WORKDAY) | ||
| # %s (estimated). | ||
| estimated_label = tr("%s (estimé)") | ||
| supported_languages = ("en_US", "fr") | ||
| # Togo gained independence on April 27, 1960. | ||
| start_year = 1961 | ||
|
|
||
| def __init__(self, islamic_show_estimated: bool = True, *args, **kwargs): | ||
| """ | ||
| Args: | ||
| islamic_show_estimated: | ||
| Whether to add "estimated" label to Islamic holidays name | ||
| if holiday date is estimated. | ||
| """ | ||
| ChristianHolidays.__init__(self) | ||
| InternationalHolidays.__init__(self) | ||
| IslamicHolidays.__init__( | ||
| self, cls=TogoIslamicHolidays, show_estimated=islamic_show_estimated | ||
| ) | ||
| super().__init__(*args, **kwargs) | ||
|
|
||
| def _populate_public_holidays(self): | ||
| # New Year's Day. | ||
| self._add_new_years_day(tr("Jour de l'an")) | ||
|
|
||
| if 1967 <= self._year <= 2013: | ||
| # Liberation Day. | ||
| self._add_holiday_jan_13(tr("Fête de la libération nationale")) | ||
|
|
||
| # Easter Monday. | ||
| self._add_easter_monday(tr("Lundi de Pâques")) | ||
|
|
||
| # Independence Day. | ||
| self._add_holiday_apr_27(tr("Fête de l'indépendance")) | ||
|
|
||
| # Labor Day. | ||
| self._add_holiday_may_1(tr("Fête du travail")) | ||
|
|
||
| # Ascension Day. | ||
| self._add_ascension_thursday(tr("Fête de l'Ascension")) | ||
|
|
||
| # Whit Monday. | ||
| self._add_whit_monday(tr("Lundi de Pentecôte")) | ||
|
|
||
| # Martyrs' Day. | ||
| self._add_holiday_jun_21(tr("Fête des Martyrs")) | ||
|
|
||
| # Assumption Day. | ||
| self._add_holiday_aug_15(tr("Assomption")) | ||
|
|
||
| # All Saints' Day. | ||
| self._add_all_saints_day(tr("Toussaint")) | ||
|
|
||
| # Christmas Day. | ||
| self._add_christmas_day(tr("Noël")) | ||
|
|
||
| # First Day of Ramadan. | ||
| self._add_ramadan_beginning_day(tr("Ramadan")) | ||
|
|
||
| # Eid al-Fitr. | ||
| self._add_eid_al_fitr_day(tr("l'Aïd El-Fitr")) | ||
|
|
||
| # Eid al-Adha. | ||
| self._add_eid_al_adha_day(tr("Tabaski")) | ||
|
|
||
| def _populate_workday_holidays(self): | ||
| if self._year >= 1987: | ||
| # Anniversary of the Failed Attack on Lomé. | ||
| self._add_holiday_sep_24(tr("Anniversaire de l'attentat manqué contre Lomé")) | ||
Roshan-1024 marked this conversation as resolved.
Show resolved
Hide resolved
KJhellico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| class TG(Togo): | ||
| pass | ||
|
|
||
|
|
||
| class TGO(Togo): | ||
| pass | ||
|
|
||
|
|
||
| class TogoIslamicHolidays(_CustomIslamicHolidays): | ||
| EID_AL_ADHA_DATES = { | ||
| 2010: (NOV, 17), | ||
| 2011: (NOV, 7), | ||
| 2012: (OCT, 26), | ||
| 2013: (OCT, 15), | ||
| 2014: (OCT, 5), | ||
| 2015: (SEP, 24), | ||
| 2016: (SEP, 13), | ||
| 2017: (SEP, 2), | ||
| 2018: (AUG, 22), | ||
| 2019: (AUG, 11), | ||
| 2020: (JUL, 31), | ||
| 2021: (JUL, 20), | ||
| 2022: (JUL, 9), | ||
| 2023: (JUN, 28), | ||
| 2024: (JUN, 16), | ||
| 2025: (JUN, 7), | ||
Roshan-1024 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| EID_AL_FITR_DATES = { | ||
| 2010: (SEP, 10), | ||
| 2011: (AUG, 31), | ||
| 2012: (AUG, 19), | ||
| 2013: (AUG, 8), | ||
| 2014: (JUL, 29), | ||
| 2015: (JUL, 18), | ||
| 2016: (JUL, 7), | ||
| 2017: (JUN, 26), | ||
| 2018: (JUN, 15), | ||
| 2019: (JUN, 5), | ||
| 2020: (MAY, 24), | ||
| 2021: (MAY, 13), | ||
| 2022: (MAY, 2), | ||
| 2023: (APR, 21), | ||
| 2024: (APR, 10), | ||
| 2025: (MAR, 30), | ||
| } | ||
|
|
||
| RAMADAN_BEGINNING_DATES = { | ||
| 2015: (JUN, 18), | ||
| 2016: (JUN, 6), | ||
| 2017: (MAY, 27), | ||
| 2018: (MAY, 17), | ||
| 2019: (MAY, 6), | ||
| 2020: (APR, 24), | ||
| 2021: (APR, 13), | ||
| 2022: (APR, 2), | ||
| 2023: (MAR, 23), | ||
| 2024: (MAR, 11), | ||
| 2025: (MAR, 1), | ||
| } | ||
KJhellico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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,93 @@ | ||
| # 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 <[email protected]> (c) 2017-2023 | ||
| # ryanss <[email protected]> (c) 2014-2017 | ||
| # Website: https://github.com/vacanza/holidays | ||
| # License: MIT (see LICENSE file) | ||
| # | ||
| # Togo holidays en_US localization. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.73\n" | ||
| "POT-Creation-Date: 2025-05-07 4:17+0530\n" | ||
| "PO-Revision-Date: 2025-05-07 4:17+0530\n" | ||
| "Last-Translator: Roshan Pradhan <[email protected]>\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.5\n" | ||
| "X-Generator: Poedit 3.6\n" | ||
| "X-Source-Language: fr\n" | ||
|
|
||
| #. %s (estimated). | ||
| #, c-format | ||
| msgid "%s (estimé)" | ||
| msgstr "%s (estimated)" | ||
|
|
||
| #. New Year's Day. | ||
| msgid "Jour de l'an" | ||
| msgstr "New Year's Day" | ||
|
|
||
| #. Liberation Day. | ||
| msgid "Fête de la libération nationale" | ||
| msgstr "Liberation Day" | ||
|
|
||
| #. Easter Monday. | ||
| msgid "Lundi de Pâques" | ||
| msgstr "Easter Monday" | ||
|
|
||
| #. Independence Day. | ||
| msgid "Fête de l'indépendance" | ||
| msgstr "Independence Day" | ||
|
|
||
| #. Labor Day. | ||
| msgid "Fête du travail" | ||
| msgstr "Labor Day" | ||
|
|
||
| #. Ascension Day. | ||
| msgid "Fête de l'Ascension" | ||
| msgstr "Ascension Day" | ||
|
|
||
| #. Whit Monday. | ||
| msgid "Lundi de Pentecôte" | ||
| msgstr "Whit Monday" | ||
|
|
||
| #. Martyrs' Day. | ||
| msgid "Fête des Martyrs" | ||
| msgstr "Martyrs' Day" | ||
|
|
||
| #. Assumption Day. | ||
| msgid "Assomption" | ||
| msgstr "Assumption Day" | ||
|
|
||
| #. All Saints' Day. | ||
| msgid "Toussaint" | ||
| msgstr "All Saints' Day" | ||
|
|
||
| #. Christmas Day. | ||
| msgid "Noël" | ||
| msgstr "Christmas Day" | ||
|
|
||
| #. First Day of Ramadan. | ||
| msgid "Ramadan" | ||
| msgstr "First Day of Ramadan" | ||
|
|
||
| #. Eid al-Fitr. | ||
| msgid "l'Aïd El-Fitr" | ||
| msgstr "Eid al-Fitr" | ||
|
|
||
| #. Eid al-Adha. | ||
| msgid "Tabaski" | ||
| msgstr "Eid al-Adha" | ||
|
|
||
| #. Anniversary of the Failed Attack on Lomé. | ||
| msgid "Anniversaire de l'attentat manqué contre Lomé" | ||
| msgstr "Anniversary of the Failed Attack on Lomé" |
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.