-
-
Notifications
You must be signed in to change notification settings - Fork 688
Add Guyana holidays #2614
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
Add Guyana holidays #2614
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
65d0584
add guyana holidays
kritibirda 7b93a2e
archive links
kritibirda 95e2536
rearrange __init__ params
kritibirda 9556590
fix language and test
kritibirda a8fdf3d
Apply suggestions from code review
kritibirda 03eea9f
address feedback from code review
kritibirda f55cd5c
Merge branch 'dev' into guyana
kritibirda 8c3ccd7
add caricom, arrival, emancipation and independence day
kritibirda 953bd2a
fix readme
kritibirda 973a379
Update holidays/countries/guyana.py
kritibirda 514bf2a
fix diwali and test eid/mawlid for 2025
kritibirda a2b9e0f
Update holidays/countries/guyana.py
kritibirda a846d22
Apply suggestions from code review
kritibirda 5bd8c68
add missing )
kritibirda 0a17fe5
update comment
kritibirda 5103e1d
Update code
arkid15r 13d288c
Update holidays/countries/guyana.py
arkid15r a63245e
fix emancipation day test
kritibirda 641e744
update comment
kritibirda 1f32a3f
Merge branch 'dev' into pr/kritibirda26/2614
arkid15r 07ab4ad
Update README.md, add snapshots
arkid15r b9ce755
Apply suggestions from code review
kritibirda 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,279 @@ | ||
| # 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.calendars import _CustomHinduHolidays, _CustomIslamicHolidays | ||
| from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC | ||
| from holidays.groups import ( | ||
| ChristianHolidays, | ||
| HinduCalendarHolidays, | ||
| InternationalHolidays, | ||
| IslamicHolidays, | ||
| StaticHolidays, | ||
| ) | ||
| from holidays.observed_holiday_base import ( | ||
| ObservedHolidayBase, | ||
| SAT_SUN_TO_NEXT_MON, | ||
| SAT_SUN_TO_NEXT_MON_TUE, | ||
| SUN_TO_NEXT_MON, | ||
| ) | ||
|
|
||
|
|
||
| class Guyana( | ||
| ObservedHolidayBase, | ||
| ChristianHolidays, | ||
| HinduCalendarHolidays, | ||
| InternationalHolidays, | ||
| IslamicHolidays, | ||
| StaticHolidays, | ||
| ): | ||
| """Guyana holidays. | ||
|
|
||
| References: | ||
| * [Public Holidays Amendment Act 1967](https://web.archive.org/web/20241125073357/https://parliament.gov.gy/documents/bills/11264-bill_6_of_1967_public_holidays.pdf) | ||
| * [Public Holidays Amendment Act 1969](https://web.archive.org/web/20250424211718/https://parliament.gov.gy/documents/bills/11891-bill_26_of_1969_1.pdf) | ||
| * [Public Holidays Act Consolidated as of 2012](https://web.archive.org/web/20250608202320/https://mola.gov.gy/laws/Volume%206%20Cap.%2018.01%20-%2023.011696968337.pdf) | ||
|
kritibirda marked this conversation as resolved.
|
||
| * [2021-2025](https://web.archive.org/web/20250614200338/https://moha.gov.gy/public-holidays/) | ||
|
|
||
| The holidays below are not part of the latest Public Holidays Act but have been notified | ||
| every year as a holiday by Gazette notifications for many years. The earliest and latest | ||
| available notifications for each are linked below. | ||
|
|
||
| * Independence Day: | ||
| * [Extraordinary Gazette 14 May 2016](https://web.archive.org/web/20250210091920/https://officialgazette.gov.gy/images/gazettes-files/Extraordinary-gazette_14may161.pdf) | ||
| * [Extraordinary Gazette 10 May 2025](https://web.archive.org/web/20250611200312/https://officialgazette.gov.gy/images/gazette2025/may/Extra_10MAY2025NotiPHA.pdf) | ||
| * CARICOM Day: | ||
| * [Extraordinary Gazette 29 June 2016](https://web.archive.org/web/20250209205727/https://officialgazette.gov.gy/images/gazettes-files/Extraordinary-gazette_29jun16.pdf) | ||
| * [Extraordinary Gazette 22 June 2024](https://web.archive.org/web/20250209154128/https://officialgazette.gov.gy/images/gazette2024/jun/Extra_22JUNE2024NotiPHA.pdf) | ||
| * Arrival Day: | ||
| * [Extraordinary Gazette 16 April 2019](https://web.archive.org/web/20221118182239/https://officialgazette.gov.gy/images/gazette2019/apr/Extra_20APRIL2019NotPubHol.pdf) | ||
| * [Extraordinary Gazette 26 April 2025](https://web.archive.org/web/20250611200310/https://officialgazette.gov.gy/images/gazette2025/apr/Extra_26APRIL2025PHA.pdf) | ||
| * Commonwealth Day / Emancipation Day: | ||
| * No amendment act removing Commonwealth Day and adding Emancipation Day it has been that | ||
| way in annual Gazette notifications for years. | ||
| * [Extraordinary Gazette 21 July 2016](https://web.archive.org/web/20250211095036/https://officialgazette.gov.gy/images/gazettes-files/Extraordinary-gazette_21jul16.pdf) | ||
| * [Extraordinary Gazette 16 July 2022](https://web.archive.org/web/20231214011437/https://officialgazette.gov.gy/images/gazette2022/jul/Extra_16JULY2022NotificPHA.pdf) | ||
|
KJhellico marked this conversation as resolved.
|
||
| """ | ||
|
|
||
| country = "GY" | ||
| default_language = "en_GY" | ||
| # %s (estimated). | ||
| estimated_label = tr("%s (estimated)") | ||
| # %s (observed). | ||
| observed_label = tr("%s (observed)") | ||
| # %s (observed, estimated). | ||
| observed_estimated_label = tr("%s (observed, estimated)") | ||
| start_year = 1968 | ||
| supported_languages = ("en_GY", "en_US") | ||
|
|
||
| def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs): | ||
|
PPsyrius marked this conversation as resolved.
|
||
| """ | ||
| Args: | ||
| islamic_show_estimated: | ||
| Whether to add "estimated" label to Islamic holidays name | ||
| if holiday date is estimated. | ||
| """ | ||
| ChristianHolidays.__init__(self) | ||
| HinduCalendarHolidays.__init__(self, cls=GuyanaHinduHolidays) | ||
| InternationalHolidays.__init__(self) | ||
| IslamicHolidays.__init__( | ||
| self, cls=GuyanaIslamicHolidays, show_estimated=islamic_show_estimated | ||
| ) | ||
|
PPsyrius marked this conversation as resolved.
|
||
| StaticHolidays.__init__(self, cls=GuyanaStaticHolidays) | ||
| kwargs.setdefault("observed_rule", SUN_TO_NEXT_MON) | ||
| super().__init__(*args, **kwargs) | ||
|
|
||
| def _populate_public_holidays(self): | ||
| # New Year's Day. | ||
| self._add_observed(self._add_new_years_day(tr("New Year's Day")), rule=SAT_SUN_TO_NEXT_MON) | ||
|
|
||
| if self._year <= 1969 or self._year >= 2016: | ||
| # Independence Day. | ||
| self._add_holiday_may_26(tr("Independence Day")) | ||
|
|
||
| if self._year >= 1970: | ||
|
PPsyrius marked this conversation as resolved.
|
||
| # Republic Day. | ||
| self._add_holiday_feb_23(tr("Republic Day")) | ||
|
|
||
| # Good Friday. | ||
| self._add_good_friday(tr("Good Friday")) | ||
|
|
||
| # Easter Monday. | ||
| self._add_easter_monday(tr("Easter Monday")) | ||
|
|
||
| # Labor Day. | ||
| self._add_observed(self._add_labor_day(tr("Labour Day"))) | ||
|
|
||
|
KJhellico marked this conversation as resolved.
|
||
| if self._year >= 2019: | ||
| # Arrival Day. | ||
| self._add_observed(self._add_holiday_may_5(tr("Arrival Day"))) | ||
|
|
||
|
KJhellico marked this conversation as resolved.
|
||
| if self._year >= 2016: | ||
| # CARICOM Day. | ||
| self._add_holiday_1st_mon_of_jul(tr("CARICOM Day")) | ||
|
|
||
| if self._year >= 2016: | ||
| # Emancipation Day. | ||
| self._add_observed(self._add_holiday_aug_1(tr("Emancipation Day"))) | ||
| else: | ||
| # Commonwealth Day. | ||
| self._add_holiday_1st_mon_of_aug(tr("Commonwealth Day")) | ||
|
|
||
| self._add_observed( | ||
| # Christmas Day. | ||
| self._add_christmas_day(tr("Christmas Day")), | ||
| rule=SAT_SUN_TO_NEXT_MON_TUE, | ||
| ) | ||
|
|
||
| self._add_observed( | ||
| # Day after Christmas. | ||
| self._add_christmas_day_two(tr("Day after Christmas")), | ||
| rule=SAT_SUN_TO_NEXT_MON_TUE, | ||
| ) | ||
|
|
||
| # Holi. | ||
| self._add_observed(self._add_holi(tr("Phagwah"))) | ||
|
|
||
| # Diwali. | ||
| self._add_observed(self._add_diwali_india(tr("Deepavali"))) | ||
|
|
||
| # Prophet's Birthday. | ||
| for dt in self._add_mawlid_day(tr("Youman Nabi")): | ||
| self._add_observed(dt) | ||
|
|
||
| # Eid al-Adha. | ||
| for dt in self._add_eid_al_adha_day(tr("Eid-Ul-Azha")): | ||
| self._add_observed(dt) | ||
|
|
||
|
|
||
| class GY(Guyana): | ||
| pass | ||
|
|
||
|
|
||
| class GUY(Guyana): | ||
| pass | ||
|
|
||
|
|
||
| class GuyanaHinduHolidays(_CustomHinduHolidays): | ||
| # https://web.archive.org/web/20250428060218/https://www.timeanddate.com/holidays/guyana/deepavali | ||
| DIWALI_INDIA_DATES = { | ||
| 2016: (OCT, 30), | ||
| 2017: (OCT, 19), | ||
| 2018: (NOV, 7), | ||
| 2019: (OCT, 27), | ||
| 2020: (NOV, 14), | ||
| 2021: (NOV, 4), | ||
| 2022: (OCT, 24), | ||
| 2023: (NOV, 12), | ||
| 2024: (OCT, 31), | ||
| 2025: (OCT, 20), | ||
| } | ||
|
KJhellico marked this conversation as resolved.
|
||
|
|
||
| # https://web.archive.org/web/20250324205940/https://www.timeanddate.com/holidays/guyana/phagwah | ||
| HOLI_DATES = { | ||
| 2005: (MAR, 26), | ||
| 2006: (MAR, 15), | ||
| 2007: (MAR, 4), | ||
| 2008: (MAR, 22), | ||
| 2009: (MAR, 11), | ||
| 2010: (MAR, 1), | ||
| 2011: (MAR, 20), | ||
| 2012: (MAR, 8), | ||
| 2013: (MAR, 27), | ||
| 2014: (MAR, 17), | ||
| 2015: (MAR, 6), | ||
| 2016: (MAR, 23), | ||
| 2017: (MAR, 12), | ||
| 2018: (MAR, 2), | ||
| 2019: (MAR, 21), | ||
| 2020: (MAR, 10), | ||
| 2021: (MAR, 28), | ||
| 2022: (MAR, 18), | ||
| 2023: (MAR, 7), | ||
| 2024: (MAR, 25), | ||
| 2025: (MAR, 14), | ||
| 2026: (MAR, 3), | ||
| } | ||
|
|
||
|
|
||
| class GuyanaIslamicHolidays(_CustomIslamicHolidays): | ||
| # https://web.archive.org/web/20250424074512/https://www.timeanddate.com/holidays/guyana/eid-al-adha | ||
| EID_AL_ADHA_DATES = { | ||
| 2001: (MAR, 6), | ||
| 2002: (FEB, 23), | ||
| 2003: (FEB, 12), | ||
| 2004: (FEB, 2), | ||
| 2005: (JAN, 21), | ||
| 2006: ((JAN, 10), (DEC, 31)), | ||
| 2007: (DEC, 20), | ||
| 2008: (DEC, 9), | ||
| 2009: (NOV, 28), | ||
| 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, 21), | ||
| 2022: (JUL, 9), | ||
| 2023: (JUN, 29), | ||
| 2024: (JUN, 17), | ||
| 2025: (JUN, 7), | ||
| } | ||
|
|
||
| # https://web.archive.org/web/20241006104125/https://www.timeanddate.com/holidays/guyana/prophet-birthday | ||
| MAWLID_DATES = { | ||
| 2001: (JUN, 4), | ||
| 2002: (MAY, 24), | ||
| 2003: (MAY, 14), | ||
| 2004: (MAY, 2), | ||
| 2005: (APR, 21), | ||
| 2006: (APR, 11), | ||
| 2007: (MAR, 31), | ||
| 2008: (MAR, 20), | ||
| 2009: (MAR, 9), | ||
| 2010: (FEB, 26), | ||
| 2011: (FEB, 16), | ||
| 2012: (FEB, 5), | ||
| 2013: (JAN, 24), | ||
| 2014: (JAN, 14), | ||
| 2015: ((JAN, 3), (DEC, 24)), | ||
| 2016: (DEC, 12), | ||
| 2017: (DEC, 1), | ||
| 2018: (NOV, 21), | ||
| 2019: (NOV, 10), | ||
| 2020: (OCT, 29), | ||
| 2021: (OCT, 19), | ||
| 2022: (OCT, 9), | ||
| 2023: (SEP, 28), | ||
| 2024: (SEP, 16), | ||
| 2025: (SEP, 5), | ||
| } | ||
|
|
||
|
|
||
| class GuyanaStaticHolidays(StaticHolidays): | ||
| """Guyana special holidays. | ||
|
|
||
| References: | ||
| * [Public Holiday](https://web.archive.org/web/20250207012131/https://officialgazette.gov.gy/images/gazette2020/feb/Extra_27FEBRUARY2020NotPholA.pdf) | ||
| """ | ||
|
|
||
| special_public_holidays = { | ||
| # Public Holiday. | ||
| 2020: (MAR, 2, tr("Public Holiday")), | ||
| } | ||
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.