From 7e4912fc162bf81bdedfc573477786597d6ed073 Mon Sep 17 00:00:00 2001 From: ~Jhellico Date: Mon, 20 Nov 2023 19:56:31 +0200 Subject: [PATCH 01/14] Initialize v0.38 --- CHANGES | 5 +++++ holidays/__init__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 63456b000..158ce16b2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Version 0.38 +============ + +Released ???????? ??, ???? + Version 0.37 ============ diff --git a/holidays/__init__.py b/holidays/__init__.py index f3ef43261..edc036a5c 100644 --- a/holidays/__init__.py +++ b/holidays/__init__.py @@ -16,7 +16,7 @@ from holidays.registry import EntityLoader from holidays.utils import * -__version__ = "0.37" +__version__ = "0.38" EntityLoader.load("countries", globals()) From ee359a7cb340178a93b688108437bf6b50b18ffa Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Tue, 21 Nov 2023 09:24:05 -0800 Subject: [PATCH 02/14] Prepare project for Weblate integration [UA] (#1565) --- .gitignore | 4 +- holidays/locale/pot/UA.pot | 94 +++++++++++++++++++++++++++++++ scripts/l10n/generate_po_files.py | 10 ++++ 3 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 holidays/locale/pot/UA.pot diff --git a/.gitignore b/.gitignore index 783a30b6d..91c6c3b05 100644 --- a/.gitignore +++ b/.gitignore @@ -9,13 +9,13 @@ *.DS_Store *.egg-info *.mo -*.pot *.pyc build/* coverage.lcov dist/ docs/build -holidays/locale/pot +holidays/locale/pot/*.pot +!holidays/locale/pot/UA.pot MANIFEST Pipfile venv/ diff --git a/holidays/locale/pot/UA.pot b/holidays/locale/pot/UA.pot new file mode 100644 index 000000000..fed91938b --- /dev/null +++ b/holidays/locale/pot/UA.pot @@ -0,0 +1,94 @@ +# SOME DESCRIPTIVE TITLE +# This file is distributed under the same license as the Python Holidays package. +# FIRST AUTHOR , 2023. +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.38\n" +"POT-Creation-Date: 2023-11-20 15:58-0800\n" +"PO-Revision-Date: 2023-11-20 15:58-0800\n" +"Last-Translator: \n" +"Language-Team: Python Holidays Localization Team\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Lingua 4.15.0\n" + +#. %s (Observed). +#, c-format +msgid "%s (вихідний)" +msgstr "" + +#. New Year's Day. +msgid "Новий рік" +msgstr "" + +#. Christmas (Julian calendar). +msgid "Різдво Христове (за юліанським календарем)" +msgstr "" + +#. International Women's Day. +msgid "Міжнародний жіночий день" +msgstr "" + +#. Easter Sunday (Pascha). +msgid "Великдень (Пасха)" +msgstr "" + +#. Holy Trinity Day. +msgid "Трійця" +msgstr "" + +#. Labour Day. +msgid "День праці" +msgstr "" + +#. International Workers' Solidarity Day. +msgid "День міжнародної солідарності трудящих" +msgstr "" + +#. Day of Victory over Nazism in World War II (Victory Day). +msgid "День перемоги над нацизмом у Другій світовій війні (День перемоги)" +msgstr "" + +#. Victory Day. +msgid "День перемоги" +msgstr "" + +#. Day of the Constitution of Ukraine. +msgid "День Конституції України" +msgstr "" + +#. Independence Day. +msgid "День незалежності України" +msgstr "" + +#. Day of defenders of Ukraine. +msgid "День захисників і захисниць України" +msgstr "" + +#. Defender of Ukraine Day. +msgid "День захисника України" +msgstr "" + +#. Anniversary of the Great October Socialist Revolution. +msgid "Річниця Великої Жовтневої соціалістичної революції" +msgstr "" + +#. Christmas (Gregorian calendar). +msgid "Різдво Христове (за григоріанським календарем)" +msgstr "" + +#. Presidential decree holiday. +msgid "Вихідний згідно указу Президента" +msgstr "" + +#. Date format (see strftime() Format Codes) +msgid "%d.%m.%Y" +msgstr "" + +#. Day off (substituted from %s). +#, c-format +msgid "Вихідний день (перенесено з %s)" +msgstr "" diff --git a/scripts/l10n/generate_po_files.py b/scripts/l10n/generate_po_files.py index 574e21803..d5273fbe2 100755 --- a/scripts/l10n/generate_po_files.py +++ b/scripts/l10n/generate_po_files.py @@ -92,6 +92,16 @@ def process_countries(self): standalone_mode=False, ) + # Update .pot file metadata. + pot_file = pofile(pot_file_path) + pot_file.metadata.update( + { + "Language-Team": "Python Holidays Localization Team", + "PO-Revision-Date": pot_file.metadata["POT-Creation-Date"], + } + ) + pot_file.save() + # Create country default .po file from the .pot file. po_directory = locale_path / default_language / "LC_MESSAGES" po_directory.mkdir(parents=True, exist_ok=True) From aa780570ea88fc28a6ac1c0e012cebe60b38b233 Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Thu, 23 Nov 2023 12:40:50 -0800 Subject: [PATCH 03/14] Update documentation: add supported entities section (#1564) Co-authored-by: ~Jhellico --- .gitignore | 1 + .pre-commit-config.yaml | 18 ++- CONTRIBUTING.rst | 2 +- Makefile | 1 + docs/source/conf.py | 2 +- docs/source/index.rst | 1 + docs/source/modules.rst | 9 ++ holidays/calendars/__init__.py | 6 +- holidays/countries/algeria.py | 2 +- holidays/countries/angola.py | 24 ++-- holidays/countries/aruba.py | 8 +- holidays/countries/bangladesh.py | 5 +- holidays/countries/belarus.py | 10 +- holidays/countries/brazil.py | 8 +- holidays/countries/canada.py | 18 +-- holidays/countries/china.py | 65 +++++------ holidays/countries/cuba.py | 12 +- holidays/countries/hungary.py | 31 ++--- holidays/countries/kazakhstan.py | 9 +- holidays/countries/madagascar.py | 5 +- holidays/countries/norway.py | 11 +- holidays/countries/portugal.py | 31 ++--- holidays/countries/saudi_arabia.py | 15 +-- holidays/countries/south_korea.py | 60 +++++----- holidays/countries/sweden.py | 10 +- holidays/countries/thailand.py | 181 ++++++++++++++--------------- holidays/countries/ukraine.py | 101 ++++++++-------- holidays/groups/buddhist.py | 2 +- holidays/groups/chinese.py | 2 +- holidays/groups/hindu.py | 2 +- holidays/groups/thai.py | 2 +- pyproject.toml | 2 +- requirements/docs.txt | 4 +- 33 files changed, 340 insertions(+), 320 deletions(-) create mode 100644 docs/source/modules.rst diff --git a/.gitignore b/.gitignore index 91c6c3b05..89f53370c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ build/* coverage.lcov dist/ docs/build +docs/source/_autosummary holidays/locale/pot/*.pot !holidays/locale/pot/UA.pot MANIFEST diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b73627cc7..030efc77b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,11 +6,17 @@ repos: - id: check-builtin-literals - id: check-yaml - id: end-of-file-fixer + exclude_types: + - rst - id: fix-encoding-pragma - args: [--remove] + args: + - --remove - id: mixed-line-ending - args: [--fix=lf] + args: + - --fix=lf - id: trailing-whitespace + exclude_types: + - rst - repo: https://github.com/python/black rev: 23.11.0 @@ -41,8 +47,8 @@ repos: additional_dependencies: [types-all] args: - --ignore-missing-imports - - --show-error-codes - --implicit-optional + - --show-error-codes - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 @@ -53,10 +59,12 @@ repos: rev: v6.2.0 hooks: - id: rstcheck - additional_dependencies: [rstcheck, sphinx] + additional_dependencies: + - rstcheck + - sphinx - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.3.1" + rev: '1.3.1' hooks: - id: tox-ini-fmt diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index d62f6d3f3..b8310144c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -77,7 +77,7 @@ Use pytest directly if you need ``-s`` option: Localization --------------------------- +------------ .. _ISO 639-1 codes: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes In order to add or update existing holiday names translation you'll need to diff --git a/Makefile b/Makefile index 48b625452..0ac6a5904 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ clean: find . -name *.pyc -delete rm -rf .mypy_cache/* rm -rf .pytest_cache/* + rm -rf docs/build/* coverage: pytest --cov=. --cov-config=pyproject.toml --cov-report term-missing --dist loadscope --no-cov-on-fail --numprocesses auto diff --git a/docs/source/conf.py b/docs/source/conf.py index f8251ceec..69554b8c4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -189,7 +189,7 @@ "undoc-members": True, # 'private-members': False, # default # 'special-members': False, # default - "inherited-members": True, + "inherited-members": False, # Disabled due to performance concerns. "show-inheritance": True, # 'ignore-module-all': False, # default # 'imported-members': False, # default diff --git a/docs/source/index.rst b/docs/source/index.rst index dfd878e0e..aa65c10fb 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -18,6 +18,7 @@ examples contributing api + Supported Entities changelog genindex diff --git a/docs/source/modules.rst b/docs/source/modules.rst new file mode 100644 index 000000000..a076b4ef0 --- /dev/null +++ b/docs/source/modules.rst @@ -0,0 +1,9 @@ +Supported Entities +================== + +.. autosummary:: + :toctree: _autosummary + :recursive: + + holidays.countries + holidays.financial diff --git a/holidays/calendars/__init__.py b/holidays/calendars/__init__.py index 97fbc5031..a47d07fa8 100644 --- a/holidays/calendars/__init__.py +++ b/holidays/calendars/__init__.py @@ -11,12 +11,12 @@ # flake8: noqa: F401 -from holidays.calendars.buddhist import _CustomBuddhistHolidays, _BuddhistLunisolar -from holidays.calendars.chinese import _CustomChineseHolidays, _ChineseLunisolar +from holidays.calendars.buddhist import _BuddhistLunisolar, _CustomBuddhistHolidays +from holidays.calendars.chinese import _ChineseLunisolar, _CustomChineseHolidays from holidays.calendars.custom import _CustomCalendar from holidays.calendars.gregorian import GREGORIAN_CALENDAR from holidays.calendars.hebrew import _HebrewLunisolar -from holidays.calendars.hindu import _HinduLunisolar, _CustomHinduHolidays +from holidays.calendars.hindu import _CustomHinduHolidays, _HinduLunisolar from holidays.calendars.islamic import _CustomIslamicHolidays, _IslamicLunar from holidays.calendars.julian import JULIAN_CALENDAR from holidays.calendars.julian_revised import JULIAN_REVISED_CALENDAR diff --git a/holidays/countries/algeria.py b/holidays/countries/algeria.py index 458ccbbeb..ff81a68e7 100644 --- a/holidays/countries/algeria.py +++ b/holidays/countries/algeria.py @@ -11,7 +11,7 @@ from gettext import gettext as tr -from holidays.groups import IslamicHolidays, InternationalHolidays +from holidays.groups import InternationalHolidays, IslamicHolidays from holidays.holiday_base import HolidayBase diff --git a/holidays/countries/angola.py b/holidays/countries/angola.py index e2fe6e4bb..9db6159f3 100644 --- a/holidays/countries/angola.py +++ b/holidays/countries/angola.py @@ -26,18 +26,18 @@ class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ References: - - https://en.wikipedia.org/wiki/Public_holidays_in_Angola - - http://www.siac.gv.ao/downloads/181029-Lei-Feriados.pdf - - [Decree #5/75] https://www.lexlink.eu/FileGet.aspx?FileId=3023486 - - [Decree #92/80] https://www.lexlink.eu/FileGet.aspx?FileId=3023473 - - [Decree #7/92] https://www.lexlink.eu/FileGet.aspx?FileId=3023485 - - [Law #16/96] https://www.lexlink.eu/FileGet.aspx?FileId=3037036 - - [Law #1/01] https://www.lexlink.eu/FileGet.aspx?FileId=3029035 - - [Law #7/03] https://www.lexlink.eu/FileGet.aspx?FileId=3002131 - - [Law #10/11] https://equadros.gov.ao/documents/40468/0/lei_10_11-1+%281%29.pdf - - [Law #11/18] https://equadros.gov.ao/documents/40468/0/Lei_no_11-18+%281%29.pdf - - https://www.officeholidays.com/countries/angola/ - - https://www.timeanddate.com/holidays/angola/ + - https://en.wikipedia.org/wiki/Public_holidays_in_Angola + - http://www.siac.gv.ao/downloads/181029-Lei-Feriados.pdf + - `Decree #5/75 `_ + - [Decree #92/80] https://www.lexlink.eu/FileGet.aspx?FileId=3023473 + - [Decree #7/92] https://www.lexlink.eu/FileGet.aspx?FileId=3023485 + - [Law #16/96] https://www.lexlink.eu/FileGet.aspx?FileId=3037036 + - [Law #1/01] https://www.lexlink.eu/FileGet.aspx?FileId=3029035 + - [Law #7/03] https://www.lexlink.eu/FileGet.aspx?FileId=3002131 + - [Law #10/11] https://equadros.gov.ao/documents/40468/0/lei_10_11-1+%281%29.pdf + - [Law #11/18] https://equadros.gov.ao/documents/40468/0/Lei_no_11-18+%281%29.pdf + - https://www.officeholidays.com/countries/angola/ + - https://www.timeanddate.com/holidays/angola/ """ country = "AO" diff --git a/holidays/countries/aruba.py b/holidays/countries/aruba.py index 73b0dcb26..c4f8621b5 100644 --- a/holidays/countries/aruba.py +++ b/holidays/countries/aruba.py @@ -20,12 +20,12 @@ class Aruba(HolidayBase, ChristianHolidays, InternationalHolidays): """ - https://www.government.aw/information-public-services/hiring-people_47940/item/holidays_43823.html # noqa: E501 - https://www.overheid.aw/informatie-dienstverlening/ondernemen-en-werken-subthemas_46970/item/feestdagen_37375.html # noqa: E501 - https://www.gobierno.aw/informacion-tocante-servicio/haci-negoshi-y-traha-sub-topics_47789/item/dia-di-fiesta_41242.html # noqa: E501 + https://www.government.aw/information-public-services/hiring-people_47940/item/holidays_43823.html + https://www.overheid.aw/informatie-dienstverlening/ondernemen-en-werken-subthemas_46970/item/feestdagen_37375.html + https://www.gobierno.aw/informacion-tocante-servicio/haci-negoshi-y-traha-sub-topics_47789/item/dia-di-fiesta_41242.html https://www.visitaruba.com/about-aruba/national-holidays-and-celebrations/ https://www.arubatoday.com/we-celebrate-our-national-hero-betico-croes/ - https://www.caribbeannewsglobal.com/carnival-monday-remains-a-festive-day-in-aruba/ # noqa: E501 + https://www.caribbeannewsglobal.com/carnival-monday-remains-a-festive-day-in-aruba/ https://www.aruba.com/us/calendar/national-anthem-and-flag-day """ diff --git a/holidays/countries/bangladesh.py b/holidays/countries/bangladesh.py index 02b971d07..971cffb79 100644 --- a/holidays/countries/bangladesh.py +++ b/holidays/countries/bangladesh.py @@ -16,8 +16,9 @@ class Bangladesh(HolidayBase, InternationalHolidays): """ - https://mopa.gov.bd/sites/default/files/files/mopa.gov.bd/public_holiday/61c35b73_e335_462a_9bcf_4695b23b6d82/reg4-2019-212.PDF - https://en.wikipedia.org/wiki/Public_holidays_in_Bangladesh + References: + - https://mopa.gov.bd/sites/default/files/files/mopa.gov.bd/public_holiday/61c35b73_e335_462a_9bcf_4695b23b6d82/reg4-2019-212.PDF # noqa: E501 + - https://en.wikipedia.org/wiki/Public_holidays_in_Bangladesh """ country = "BD" diff --git a/holidays/countries/belarus.py b/holidays/countries/belarus.py index 927ceab3c..f611a18a2 100644 --- a/holidays/countries/belarus.py +++ b/holidays/countries/belarus.py @@ -22,11 +22,11 @@ class Belarus(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid Belarus holidays. References: - - http://president.gov.by/en/holidays_en/ - - http://www.belarus.by/en/about-belarus/national-holidays - - http://laws.newsby.org/documents/ukazp/pos05/ukaz05806.htm - - http://president.gov.by/uploads/documents/2019/464uk.pdf - - https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%91%D0%B5%D0%BB%D0%BE%D1%80%D1%83%D1%81%D1%81%D0%B8%D0%B8 # noqa: E501 + - http://president.gov.by/en/holidays_en/ + - http://www.belarus.by/en/about-belarus/national-holidays + - http://laws.newsby.org/documents/ukazp/pos05/ukaz05806.htm + - http://president.gov.by/uploads/documents/2019/464uk.pdf + - https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%91%D0%B5%D0%BB%D0%BE%D1%80%D1%83%D1%81%D1%81%D0%B8%D0%B8 # noqa: E501 """ country = "BY" diff --git a/holidays/countries/brazil.py b/holidays/countries/brazil.py index 48ebef72b..0870c63cc 100644 --- a/holidays/countries/brazil.py +++ b/holidays/countries/brazil.py @@ -21,11 +21,9 @@ class Brazil(HolidayBase, ChristianHolidays, InternationalHolidays): """ References: - - https://pt.wikipedia.org/wiki/Feriados_no_Brasil - - Decreto n. 155-B, de 14.01.1890: - https://www2.camara.leg.br/legin/fed/decret/1824-1899/decreto-155-b-14-janeiro-1890-517534-publicacaooriginal-1-pe.html - - Decreto n. 19.488, de 15.12.1930: - https://www2.camara.leg.br/legin/fed/decret/1930-1939/decreto-19488-15-dezembro-1930-508040-republicacao-85201-pe.html + - https://pt.wikipedia.org/wiki/Feriados_no_Brasil + - `Decreto n. 155-B, de 14.01.1890 `_ # noqa: E501 + - `Decreto n. 19.488, de 15.12.1930 `_ # noqa: E501 """ country = "BR" diff --git a/holidays/countries/canada.py b/holidays/countries/canada.py index 65a38b763..43577af17 100644 --- a/holidays/countries/canada.py +++ b/holidays/countries/canada.py @@ -28,15 +28,15 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ References: - - https://en.wikipedia.org/wiki/Public_holidays_in_Canada - - https://web.archive.org/web/20130703014214/http://www.hrsdc.gc.ca/eng/labour/overviews/employment_standards/holidays.shtml # noqa: E501 - - https://www.alberta.ca/alberta-general-holidays - - https://www2.gov.bc.ca/gov/content/employment-business/employment-standards-advice/employment-standards/statutory-holidays # noqa: E501 - - http://web2.gov.mb.ca/laws/statutes/ccsm/r120e.php - - https://www2.gnb.ca/content/gnb/en/departments/elg/local_government/content/governance/content/days_of_rest_act.html # noqa: E501 - - https://www.ontario.ca/document/your-guide-employment-standards-act-0/public-holidays - - https://www.officeholidays.com/countries/canada/ - - https://www.timeanddate.com/holidays/canada/ + - https://en.wikipedia.org/wiki/Public_holidays_in_Canada + - https://web.archive.org/web/20130703014214/http://www.hrsdc.gc.ca/eng/labour/overviews/employment_standards/holidays.shtml # noqa: E501 + - https://www.alberta.ca/alberta-general-holidays + - https://www2.gov.bc.ca/gov/content/employment-business/employment-standards-advice/employment-standards/statutory-holidays # noqa: E501 + - http://web2.gov.mb.ca/laws/statutes/ccsm/r120e.php + - https://www2.gnb.ca/content/gnb/en/departments/elg/local_government/content/governance/content/days_of_rest_act.html # noqa: E501 + - https://www.ontario.ca/document/your-guide-employment-standards-act-0/public-holidays + - https://www.officeholidays.com/countries/canada/ + - https://www.timeanddate.com/holidays/canada/ """ country = "CA" diff --git a/holidays/countries/china.py b/holidays/countries/china.py index 09d6888d3..75682d758 100644 --- a/holidays/countries/china.py +++ b/holidays/countries/china.py @@ -22,43 +22,42 @@ class China(HolidayBase, ChineseCalendarHolidays, InternationalHolidays, StaticHolidays): """ References: - - https://en.wikipedia.org/wiki/Public_holidays_in_China - - https://zh.wikipedia.org/wiki/中华人民共和国节日与公众假期 - - https://www.gov.cn/gongbao/content/2023/content_5736714.htm # 2023 - - https://www.gov.cn/gongbao/content/2021/content_5651728.htm # 2022 - - https://www.gov.cn/gongbao/content/2020/content_5567750.htm # 2021 - - https://www.gov.cn/gongbao/content/2019/content_5459138.htm # 2020 - - https://www.gov.cn/gongbao/content/2018/content_5350046.htm # 2019 - - https://www.gov.cn/gongbao/content/2017/content_5248221.htm # 2018 - - https://www.gov.cn/gongbao/content/2016/content_5148793.htm # 2017 - - https://www.gov.cn/gongbao/content/2016/content_2979719.htm # 2016 - - https://www.gov.cn/gongbao/content/2015/content_2799019.htm # 2015 - - https://www.gov.cn/gongbao/content/2014/content_2561299.htm # 2014 - - https://www.gov.cn/gongbao/content/2012/content_2292057.htm # 2013 - - https://www.gov.cn/gongbao/content/2011/content_2020918.htm # 2012 - - https://www.gov.cn/gongbao/content/2010/content_1765282.htm # 2011 - - https://www.gov.cn/gongbao/content/2009/content_1487011.htm # 2010 - - https://www.gov.cn/gongbao/content/2008/content_1175823.htm # 2009 - - https://www.gov.cn/gongbao/content/2008/content_859870.htm # 2008 - - https://www.gov.cn/gongbao/content/2007/content_503397.htm # 2007 - - https://zh.wikisource.org/wiki/国务院办公厅关于2006年部分节假日安排的通知 # 2006 - - https://zh.wikisource.org/wiki/国务院办公厅关于2005年部分节假日安排的通知 # 2005 - - https://zh.wikisource.org/wiki/国务院办公厅关于2004年部分节假日安排的通知 # 2004 - - https://zh.wikisource.org/wiki/国务院办公厅关于2003年部分节假日休息安排的通知 # 2003 - - https://zh.wikisource.org/wiki/国务院办公厅关于2002年部分节假日休息安排的通知 # 2002 - - https://zh.wikisource.org/wiki/国务院办公厅关于2001年春节、“五一”、“十一”放假安排的通知 # 2001 + - https://en.wikipedia.org/wiki/Public_holidays_in_China + - `Festivals and Public Holidays `_ + - `2023 `_ + - `2022 `_ + - `2021 `_ + - `2020 `_ + - `2019 `_ + - `2018 `_ + - `2017 `_ + - `2016 `_ + - `2015 `_ + - `2014 `_ + - `2013 `_ + - `2012 `_ + - `2011 `_ + - `2010 `_ + - `2009 `_ + - `2008 `_ + - `2007 `_ + - `2006 `_ + - `2005 `_ + - `2004 `_ + - `2003 `_ + - `2002 `_ + - `2001 `_ Checked With: - - https://www.officeholidays.com/countries/china/2023 - - https://www.china-briefing.com/news/china-public-holiday-2023-schedule/ - - https://www.timeanddate.com/calendar/?year=2023&country=41 - - https://m.wannianli.tianqi.com/fangjiaanpai/2001.html # 2001-2010 + - https://www.officeholidays.com/countries/china/2023 + - https://www.china-briefing.com/news/china-public-holiday-2023-schedule/ + - https://www.timeanddate.com/calendar/?year=2023&country=41 + - `2001-2010 `_ Limitations: - - - Only checked with the official General Office of the State Council Notice from 2001 onwards. - - - Due to its complexity, need yearly checks 3-weeks before year's end each year. + - Only checked with the official General Office of the State Council Notice from 2001 + onwards. + - Due to its complexity, need yearly checks 3-weeks before year's end each year. """ country = "CN" diff --git a/holidays/countries/cuba.py b/holidays/countries/cuba.py index e3878367e..fdda63062 100644 --- a/holidays/countries/cuba.py +++ b/holidays/countries/cuba.py @@ -22,12 +22,12 @@ class Cuba(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): 2007 (NOV 19): https://bit.ly/3oFbhaZ 2013 (DEC 20): https://bit.ly/3zoO3vC Note: for holidays that can be moved to a Monday if they fall on a - Sunday, between 1984 and 2013, the State Committee of Work and - Social Security would determine if they would be moved to the - Monday, or if they would stay on the Sunday, presumably depending - on quotas. After 2013, they always move to Monday. I could not - find any records of this, so I implemented this making it always - go to the next Monday. + Sunday, between 1984 and 2013, the State Committee of Work and + Social Security would determine if they would be moved to the + Monday, or if they would stay on the Sunday, presumably depending + on quotas. After 2013, they always move to Monday. I could not + find any records of this, so I implemented this making it always + go to the next Monday. """ country = "CU" diff --git a/holidays/countries/hungary.py b/holidays/countries/hungary.py index 306c0e460..0bcb8813a 100644 --- a/holidays/countries/hungary.py +++ b/holidays/countries/hungary.py @@ -19,24 +19,25 @@ class Hungary(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ https://en.wikipedia.org/wiki/Public_holidays_in_Hungary + Codification dates: - - https://hvg.hu/gazdasag/20170307_Megszavaztak_munkaszuneti_nap_lett_a_nagypentek - - https://www.tankonyvtar.hu/hu/tartalom/historia/92-10/ch01.html#id496839 + - https://hvg.hu/gazdasag/20170307_Megszavaztak_munkaszuneti_nap_lett_a_nagypentek + - https://www.tankonyvtar.hu/hu/tartalom/historia/92-10/ch01.html#id496839 Substituted holidays official sources: - 2010 - https://njt.hu/jogszabaly/2009-20-20-1X - 2011 - https://njt.hu/jogszabaly/2010-7-20-2X - 2012 - https://njt.hu/jogszabaly/2011-39-20-2X - 2012-2013 - https://njt.hu/jogszabaly/2012-28-20-2X - 2014 - https://njt.hu/jogszabaly/2013-33-20-2X - 2015 - https://njt.hu/jogszabaly/2014-28-20-2X - 2016 - https://njt.hu/jogszabaly/2015-18-20-2X - 2018 - https://njt.hu/jogszabaly/2017-61-B0-15 - 2019 - https://njt.hu/jogszabaly/2018-6-20-53 - 2020 - https://njt.hu/jogszabaly/2019-7-20-53 - 2021 - https://njt.hu/jogszabaly/2020-14-20-7Q - 2022 - https://njt.hu/jogszabaly/2021-23-20-7Q - 2024 - https://njt.hu/jogszabaly/2023-15-20-8P + - `2010 `_ + - `2011 `_ + - `2012 `_ + - `2012-2013 `_ + - `2014 `_ + - `2015 `_ + - `2016 `_ + - `2018 `_ + - `2019 `_ + - `2020 `_ + - `2021 `_ + - `2022 `_ + - `2024 `_ """ country = "HU" diff --git a/holidays/countries/kazakhstan.py b/holidays/countries/kazakhstan.py index 76b53fdf2..1ae25240f 100644 --- a/holidays/countries/kazakhstan.py +++ b/holidays/countries/kazakhstan.py @@ -16,10 +16,11 @@ class Kazakhstan(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays): """ - 1. https://www.officeholidays.com/countries/kazakhstan/2020 - 2. https://egov.kz/cms/en/articles/holidays-calend - 3. https://en.wikipedia.org/wiki/Public_holidays_in_Kazakhstan - 4. https://adilet.zan.kz/rus/docs/Z010000267_/history + References: + - https://www.officeholidays.com/countries/kazakhstan/2020 + - https://egov.kz/cms/en/articles/holidays-calend + - https://en.wikipedia.org/wiki/Public_holidays_in_Kazakhstan + - https://adilet.zan.kz/rus/docs/Z010000267\_/history # noqa W605 """ country = "KZ" diff --git a/holidays/countries/madagascar.py b/holidays/countries/madagascar.py index 4de8af149..fc1590a0d 100644 --- a/holidays/countries/madagascar.py +++ b/holidays/countries/madagascar.py @@ -19,8 +19,9 @@ class Madagascar(HolidayBase, ChristianHolidays, InternationalHolidays): """ - https://www.officeholidays.com/countries/madagascar - https://www.timeanddate.com/holidays/madagascar/ + References: + - https://www.officeholidays.com/countries/madagascar + - https://www.timeanddate.com/holidays/madagascar/ """ country = "MG" diff --git a/holidays/countries/norway.py b/holidays/countries/norway.py index 7e5700808..b34dfa3f3 100644 --- a/holidays/countries/norway.py +++ b/holidays/countries/norway.py @@ -27,9 +27,9 @@ class Norway(HolidayBase, ChristianHolidays, InternationalHolidays): to not include sundays as a holiday. Primary sources: - https://lovdata.no/dokument/NL/lov/1947-04-26-1 - https://no.wikipedia.org/wiki/Helligdager_i_Norge - https://www.timeanddate.no/merkedag/norge/ + - https://lovdata.no/dokument/NL/lov/1947-04-26-1 + - https://no.wikipedia.org/wiki/Helligdager_i_Norge + - https://www.timeanddate.no/merkedag/norge/ """ country = "NO" @@ -38,9 +38,8 @@ class Norway(HolidayBase, ChristianHolidays, InternationalHolidays): def __init__(self, include_sundays=False, *args, **kwargs): """ - :param include_sundays: Whether to consider sundays as a holiday - (which they are in Norway) - :param kwargs: + :param include_sundays: + Whether to consider sundays as a holiday (which they are in Norway) """ self.include_sundays = include_sundays ChristianHolidays.__init__(self) diff --git a/holidays/countries/portugal.py b/holidays/countries/portugal.py index 605e088be..a8374101c 100644 --- a/holidays/countries/portugal.py +++ b/holidays/countries/portugal.py @@ -23,26 +23,17 @@ class Portugal(HolidayBase, ChristianHolidays, InternationalHolidays): in Portugal. References: - - - Based on: - https://en.wikipedia.org/wiki/Public_holidays_in_Portugal - - National Level: - - [Labour Day] - https://www.e-konomista.pt/dia-do-trabalhador/ - - [Portugal Day] - Decreto 17.171 - - [Restoration of Independence Day] - Gazeta de Lisboa, 8 de Dezembro de 1823 (n.º 290), pp. 1789 e 1790 - - Regional Level: - - [Azores] - https://files.dre.pt/1s/1980/08/19200/23052305.pdf - - [Madeira] - https://files.dre.pt/1s/1979/11/25900/28782878.pdf - https://files.dre.pt/1s/1989/02/02800/04360436.pdf - https://files.dre.pt/1s/2002/11/258a00/71837183.pdf - + - https://en.wikipedia.org/wiki/Public_holidays_in_Portugal + - `Labour Day `_ + - Portugal Day - Decreto 17.171 + - Restoration of Independence Day - Gazeta de Lisboa, 8 de Dezembro + de 1823 (n.º 290), pp. 1789 e 1790 + - Azores + - https://files.dre.pt/1s/1980/08/19200/23052305.pdf + - Madeira + - https://files.dre.pt/1s/1979/11/25900/28782878.pdf + - https://files.dre.pt/1s/1989/02/02800/04360436.pdf + - https://files.dre.pt/1s/2002/11/258a00/71837183.pdf """ country = "PT" diff --git a/holidays/countries/saudi_arabia.py b/holidays/countries/saudi_arabia.py index 6a5c0d4fb..b187dc702 100644 --- a/holidays/countries/saudi_arabia.py +++ b/holidays/countries/saudi_arabia.py @@ -30,16 +30,17 @@ class SaudiArabia(ObservedHolidayBase, IslamicHolidays, StaticHolidays): """ There are only 4 official national holidays in Saudi: - https://laboreducation.hrsd.gov.sa/en/gallery/274 - https://laboreducation.hrsd.gov.sa/en/labor-education/322 - https://english.alarabiya.net/News/gulf/2022/01/27/Saudi-Arabia-to-commemorate-Founding-Day-on-Feb-22-annually-Royal-order + - https://laboreducation.hrsd.gov.sa/en/gallery/274 + - https://laboreducation.hrsd.gov.sa/en/labor-education/322 + - https://english.alarabiya.net/News/gulf/2022/01/27/Saudi-Arabia-to-commemorate-Founding-Day-on-Feb-22-annually-Royal-order # noqa: E501 + The national day and the founding day holidays are based on the Georgian calendar while the other two holidays are based on the Islamic Calendar, and they are estimates as they announced each - year and based on moon sightings; - they are: - - Eid al-Fitr - - Eid al-Adha + year and based on moon sightings; they are: + - Eid al-Fitr + - Eid al-Adha + """ country = "SA" diff --git a/holidays/countries/south_korea.py b/holidays/countries/south_korea.py index 53a54f1ae..2034f516e 100644 --- a/holidays/countries/south_korea.py +++ b/holidays/countries/south_korea.py @@ -50,28 +50,36 @@ class SouthKorea( ): """ References: - 1. https://en.wikipedia.org/wiki/Public_holidays_in_South_Korea - 2. https://www.law.go.kr/법령/관공서의%20공휴일에%20관한%20규정 - 3. https://elaw.klri.re.kr/eng_service/lawView.do?lang=ENG&hseq=34678 - 4. https://elaw.klri.re.kr/eng_service/%20lawView.do?hseq=38405&lang=ENG - 5. https://namu.wiki/w/대통령%20선거일 - 6. https://namu.wiki/w/공휴일/대한민국 - 7. https://namu.wiki/w/공휴일/대한민국/역사 - 8. https://namu.wiki/w/대체%20휴일%20제도 - 9. https://overseas.mofa.go.kr/th-th/wpge/m_3133/contents.do (th localization) - 10. https://thailand.korean-culture.org/th/138/korea/38 (th localization) + - https://en.wikipedia.org/wiki/Public_holidays_in_South_Korea + - https://www.law.go.kr/법령/관공서의%20공휴일에%20관한%20규정 + - https://elaw.klri.re.kr/eng_service/lawView.do?lang=ENG&hseq=34678 + - https://elaw.klri.re.kr/eng_service/%20lawView.do?hseq=38405&lang=ENG + - https://namu.wiki/w/대통령%20선거일 + - https://namu.wiki/w/공휴일/대한민국 + - https://namu.wiki/w/공휴일/대한민국/역사 + - https://namu.wiki/w/대체%20휴일%20제도 + - `TH localization 1 `_ + - `TH localization 2 `_ Checked With: - 1. https://publicholidays.co.kr/ko/2020-dates/ - 2. https://publicholidays.co.kr/ko/2022-dates/ + - https://publicholidays.co.kr/ko/2020-dates/ + - https://publicholidays.co.kr/ko/2022-dates/ According to (3), the alt holidays in Korea are as follows: - - The alt holiday means next first non holiday after the holiday. - - Independence Movement Day, Liberation Day, National Foundation Day, - Hangul Day, Children's Day, Birthday of the Buddha, Christmas Day have - alt holiday if they fell on Saturday or Sunday. - - Korean New Year's Day, Korean Mid Autumn Day have alt holiday if they - fell on Sunday. + - The alt holiday means next first non holiday after the holiday. + - Independence Movement Day, Liberation Day, National Foundation Day, + Hangul Day, Children's Day, Birthday of the Buddha, Christmas Day have + alt holiday if they fell on Saturday or Sunday. + - Korean New Year's Day, Korean Mid Autumn Day have alt holiday if they + fell on Sunday. + + The alt holidays in Korea are as follows: + - The alt holiday means next first non holiday after the holiday. + - Independence Movement Day, Liberation Day, National Foundation Day, + Hangul Day, Children's Day, Birthday of the Buddha, Christmas Day have + alt holiday if they fell on Saturday or Sunday. + - Lunar New Year's Day, Korean Mid Autumn Day have alt holiday if they + fell on Sunday. """ @@ -342,14 +350,14 @@ class SouthKoreaLunisolarHolidays(_CustomChineseHolidays): class SouthKoreaStaticHolidays: """ References: - 1. https://namu.wiki/w/임시공휴일 * - 2. https://namu.wiki/w/공휴일/대한민국 ** - 3. https://namu.wiki/w/대체%20휴일%20제도 - - * Election Dates featured here are the ones prior to the proper recodification to - Article 34 of the Public Official Election Act(September 2006) - ** Sabang Day (사방의 날) was technically in the Public Holidays Act itself, but since it was - only celebrated in 1960, this is being put here. + - https://namu.wiki/w/임시공휴일 * + - https://namu.wiki/w/공휴일/대한민국 ** + - https://namu.wiki/w/대체%20휴일%20제도 + + (1) Election Dates featured here are the ones prior to the proper recodification to + Article 34 of the Public Official Election Act(September 2006) + (2) Sabang Day (사방의 날) was technically in the Public Holidays Act itself, but since it was + only celebrated in 1960, this is being put here. """ # Common Special Holiday Types. diff --git a/holidays/countries/sweden.py b/holidays/countries/sweden.py index e1d98f905..5e010f823 100644 --- a/holidays/countries/sweden.py +++ b/holidays/countries/sweden.py @@ -26,9 +26,10 @@ class Sweden(HolidayBase, ChristianHolidays, InternationalHolidays): (https://sv.wikipedia.org/wiki/Helgdagar_i_Sverige). Initialize this class with include_sundays=False to not include sundays as a holiday. + Primary sources: - https://sv.wikipedia.org/wiki/Helgdagar_i_Sverige and - http://www.riksdagen.se/sv/dokument-lagar/dokument/svensk-forfattningssamling/lag-1989253-om-allmanna-helgdagar_sfs-1989-253 + - https://sv.wikipedia.org/wiki/Helgdagar_i_Sverige + - http://www.riksdagen.se/sv/dokument-lagar/dokument/svensk-forfattningssamling/lag-1989253-om-allmanna-helgdagar_sfs-1989-253 # noqa: E501 """ country = "SE" @@ -37,9 +38,8 @@ class Sweden(HolidayBase, ChristianHolidays, InternationalHolidays): def __init__(self, include_sundays=True, *args, **kwargs): """ - :param include_sundays: Whether to consider sundays as a holiday - (which they are in Sweden) - :param kwargs: + :param include_sundays: + Whether to consider sundays as a holiday (which they are in Sweden) """ self.include_sundays = include_sundays ChristianHolidays.__init__(self) diff --git a/holidays/countries/thailand.py b/holidays/countries/thailand.py index b146adc6c..3508d88ba 100644 --- a/holidays/countries/thailand.py +++ b/holidays/countries/thailand.py @@ -31,104 +31,101 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC A subclass of :py:class:`HolidayBase` representing public holidays in Thailand. References: - - - Based on: https://en.wikipedia.org/wiki/Public_holidays_in_Thailand - - Checked with: (Bank of Thailand 's wbm) http://tiny.cc/wa_bot_2023 - - [In Lieus] - (isranews.org 's wbm) http://tiny.cc/wa_isranews_inlieu_hist - https://resolution.soc.go.th/?prep_id=99159317 - https://resolution.soc.go.th/?prep_id=196007 - https://github.com/dr-prodigy/python-holidays/pull/929 - - [New Year's Day] - (wikisource.org 's wbm) http://tiny.cc/wa_wiki_thai_newyear_2483 - - [National Children's Day] - https://thainews.prd.go.th/banner/th/children'sday/ - - [Chakri Memorial Day] - (ocac.got.th 's wbm) http://tiny.cc/wa_ocac_chakri - - [Songkran Festival] - (museumsiam.org 's wbm) http://tiny.cc/wa_museumsiam_songkran - https://resolution.soc.go.th/?prep_id=123659 - - [National Labour Day] - https://www.thairath.co.th/lifestyle/culture/1832869 - - [National Day (24 June: Defunct)] - (Ministry of Culture 's wbm) http://tiny.cc/wa_mincul_nat_day - - [Coronation Day] - https://www.matichon.co.th/politics/news_526200 - https://workpointtoday.com/news1-5/ - - [HM Queen Suthida's Birthday] - https://www.thairath.co.th/news/politic/1567418 - - [HM Maha Vajiralongkorn's Birthday] - https://www.matichon.co.th/politics/news_526200 - - [HM Queen Sirikit the Queen Mother's Birthday] - https://hilight.kapook.com/view/14164 - - [National Mother's Day] - https://www.brh.go.th/index.php/2019-02-27-04-11-52/542-12-2564 - - [HM King Bhumibol Adulyadej Memorial Day] - https://www.matichon.co.th/politics/news_526200 - - [HM King Chulalongkorn Memorial Day] - https://th.wikipedia.org/wiki/วันปิยมหาราช - - [HM King Bhumibol Adulyadej's Birthday] - (Ministry of Culture 's wbm) http://tiny.cc/wa_mincul_nat_day - https://hilight.kapook.com/view/148862 - - [National Father's Day] - https://www.brh.go.th/index.php/2019-02-27-04-12-21/594-5-5 - - [Constitution Day] - https://hilight.kapook.com/view/18208 - (Bank of Thailand 's wbm) http://tiny.cc/wa_bot_1992 - https://www.myhora.com/ปฏิทิน/ปฏิทิน-พ.ศ.2475.aspx - - [New Year's Eve] - (Bank of Thailand 's wbm) http://tiny.cc/wa_bot_1992 - https://resolution.soc.go.th/?prep_id=205799 - https://resolution.soc.go.th/?prep_id=210744 - - [Makha Bucha] - https://www.onab.go.th/th/content/category/detail/id/73/iid/3403 - - [Visakha Bucha] - https://www.onab.go.th/th/content/category/detail/id/73/iid/3401 - - [Asarnha Bucha] - https://www.onab.go.th/th/content/category/detail/id/73/iid/3397 - - [Buddhist Lent Day] - https://www.onab.go.th/th/content/category/detail/id/73/iid/3395 - - [Royal Ploughing Ceremony] - https://en.wikipedia.org/wiki/Royal_Ploughing_Ceremony - https://www.lib.ru.ac.th/journal/may/may_phauchmongkol.html - https://www.myhora.com/ปฏิทิน/ปฏิทิน-พ.ศ.2540.aspx - - [Royal Thai Armed Forces Day] - https://th.wikipedia.org/wiki/วันกองทัพไทย - - [Teacher's Day] - https://www.cabinet.soc.go.th/doc_image/2500/718941.pdf - - !!! If Public Holiday falls on weekends, (in lieu) on workday !!! - Despite the wording, this usually only applies to Monday only for - holidays, consecutive holidays all have their own special in lieu - declared separately. - Data from 1992-1994 and 1998-2000 are declared discretely in - special_holidays declarations above. - Applied Automatically for Monday if on Weekends: 1961-1973 - **NOTE: No New Year's Eve (in lieu) for this period - No In Lieu days available: 1974-1988 - Case-by-Case application for Workday if on Weekends: 1989-1994 - Applied Automatically for Workday if on Weekends: 1995-1997 - Case-by-Case application for Workday if on Weekends: 1998-2000 - Applied Automatically for Workday if on Weekends: 2001-Present + - Based on: https://en.wikipedia.org/wiki/Public_holidays_in_Thailand + - Checked with: `Bank of Thailand lists `_ + - [In Lieus] + - `isranews.org `_ + - https://resolution.soc.go.th/?prep_id=99159317 + - https://resolution.soc.go.th/?prep_id=196007 + - https://github.com/dr-prodigy/python-holidays/pull/929 + - [New Year's Day] + `wikisource.org `_ + - [National Children's Day] + https://thainews.prd.go.th/banner/th/children'sday/ + - [Chakri Memorial Day] + `ocac.got.th `_ + - [Songkran Festival] + - `museumsiam.org `_ + - https://resolution.soc.go.th/?prep_id=123659 + - [National Labour Day] + https://www.thairath.co.th/lifestyle/culture/1832869 + - [National Day (24 June: Defunct)] + `Ministry of Culture `_ + - [Coronation Day] + https://www.matichon.co.th/politics/news_526200 + https://workpointtoday.com/news1-5/ + - [HM Queen Suthida's Birthday] + https://www.thairath.co.th/news/politic/1567418 + - [HM Maha Vajiralongkorn's Birthday] + https://www.matichon.co.th/politics/news_526200 + - [HM Queen Sirikit the Queen Mother's Birthday] + https://hilight.kapook.com/view/14164 + - [National Mother's Day] + https://www.brh.go.th/index.php/2019-02-27-04-11-52/542-12-2564 + - [HM King Bhumibol Adulyadej Memorial Day] + https://www.matichon.co.th/politics/news_526200 + - [HM King Chulalongkorn Memorial Day] + ``_ + - [HM King Bhumibol Adulyadej's Birthday] + - `Ministry of Culture `_ + - https://hilight.kapook.com/view/148862 + - [National Father's Day] + https://www.brh.go.th/index.php/2019-02-27-04-12-21/594-5-5 + - [Constitution Day] + - https://hilight.kapook.com/view/18208 + - `Bank of Thailand `_ + - ``_ + - [New Year's Eve] + - `Bank of Thailand`_ + - https://resolution.soc.go.th/?prep_id=205799 + - https://resolution.soc.go.th/?prep_id=210744 + - [Makha Bucha] + https://www.onab.go.th/th/content/category/detail/id/73/iid/3403 + - [Visakha Bucha] + https://www.onab.go.th/th/content/category/detail/id/73/iid/3401 + - [Asarnha Bucha] + https://www.onab.go.th/th/content/category/detail/id/73/iid/3397 + - [Buddhist Lent Day] + https://www.onab.go.th/th/content/category/detail/id/73/iid/3395 + - [Royal Ploughing Ceremony] + https://en.wikipedia.org/wiki/Royal_Ploughing_Ceremony + https://www.lib.ru.ac.th/journal/may/may_phauchmongkol.html + ``_ + - [Royal Thai Armed Forces Day] + ``_ + - [Teacher's Day] + https://www.cabinet.soc.go.th/doc_image/2500/718941.pdf + + !!! If Public Holiday falls on weekends, (in lieu) on workday !!! + Despite the wording, this usually only applies to Monday only for + holidays, consecutive holidays all have their own special in lieu + declared separately. + Data from 1992-1994 and 1998-2000 are declared discretely in + special_holidays declarations above. + Applied Automatically for Monday if on Weekends: 1961-1973 + **NOTE**: No New Year's Eve (in lieu) for this period + No In Lieu days available: 1974-1988 + Case-by-Case application for Workday if on Weekends: 1989-1994 + Applied Automatically for Workday if on Weekends: 1995-1997 + Case-by-Case application for Workday if on Weekends: 1998-2000 + Applied Automatically for Workday if on Weekends: 2001-Present Limitations: + - This is only 100% accurate for 1997-2023; any future dates are up to the + Royal Thai Government Gazette which updates on a year-by-year basis. - - This is only 100% accurate for 1997-2023; any future dates are up to the - Royal Thai Government Gazette which updates on a year-by-year basis. - - - Approx. date only goes as far back as 1941 (B.E. 2484) as the Thai - calendar for B.E. 2483 as we only have nine months from switching - New Year Date (April 1st to January 1st). - - - Thai Lunar Calendar Holidays only work from 1941 (B.E. 2484) onwards - until 2057 (B.E. 2600) as we only have Thai year-type data for - cross-checking until then. + - Approx. date only goes as far back as 1941 (B.E. 2484) as the Thai + calendar for B.E. 2483 as we only have nine months from switching + New Year Date (April 1st to January 1st). - - Royal Ploughing Ceremony Day is date is announced on an annual basis - by the Court Astrologers, thus need an annual update to the library here + - Thai Lunar Calendar Holidays only work from 1941 (B.E. 2484) onwards + until 2057 (B.E. 2600) as we only have Thai year-type data for + cross-checking until then. - - This doesn't cover Thai regional public holidays yet, only stubs added + - Royal Ploughing Ceremony Day is date is announced on an annual basis + by the Court Astrologers, thus need an annual update to the library here + - This doesn't cover Thai regional public holidays yet, only stubs added Country created by: `arkid15r `__ diff --git a/holidays/countries/ukraine.py b/holidays/countries/ukraine.py index 02df68c44..70473727d 100644 --- a/holidays/countries/ukraine.py +++ b/holidays/countries/ukraine.py @@ -34,56 +34,10 @@ class Ukraine(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays): """ - Current holidays list: - https://zakon1.rada.gov.ua/laws/show/322-08/paran454#n454 - - Substituted holidays: - 1992 - https://zakon.rada.gov.ua/laws/show/202-92-%D0%BF, - https://zakon.rada.gov.ua/laws/show/377-91-%D0%BF - 1993 - https://zakon.rada.gov.ua/laws/show/563-93-%D0%BF, - https://zakon.rada.gov.ua/laws/show/725-92-%D0%BF - 1994 - https://zakon.rada.gov.ua/laws/show/98-94-%D0%BF - 1995 - https://zakon.rada.gov.ua/laws/show/852-95-%D0%BF, - https://zakon.rada.gov.ua/laws/show/634-95-%D0%BF, - https://zakon.rada.gov.ua/laws/show/266-95-%D0%BF - 1996 - https://zakon.rada.gov.ua/laws/show/424-96-%D0%BF - 1997 - https://zakon.rada.gov.ua/laws/show/326-97-%D0%BF, - https://zakon.rada.gov.ua/laws/show/1547-96-%D0%BF - 1999 - https://zakon.rada.gov.ua/laws/show/1433-99-%D0%BF, - https://zakon.rada.gov.ua/laws/show/558-99-%D0%BF, - https://zakon.rada.gov.ua/laws/show/2070-98-%D0%BF - 2000 - https://zakon.rada.gov.ua/laws/show/1251-2000-%D0%BF, - https://zakon.rada.gov.ua/laws/show/717-2000-%D0%BF - 2001 - https://zakon.rada.gov.ua/laws/show/138-2001-%D1%80, - https://zakon.rada.gov.ua/laws/show/210-2001-%D0%BF - 2002, - 2003 - https://zakon.rada.gov.ua/laws/show/202-2002-%D1%80, - https://zakon.rada.gov.ua/laws/show/705-2002-%D1%80 - 2004 - https://zakon.rada.gov.ua/laws/show/773-2003-%D1%80 - 2005 - https://zakon.rada.gov.ua/laws/show/936-2004-%D1%80, - https://zakon.rada.gov.ua/laws/show/133-2005-%D1%80 - 2006 - https://zakon.rada.gov.ua/laws/show/490-2005-%D1%80, - https://zakon.rada.gov.ua/laws/show/562-2005-%D1%80 - 2007 - https://zakon.rada.gov.ua/laws/show/612-2006-%D1%80 - 2008 - https://zakon.rada.gov.ua/laws/show/1059-2007-%D1%80, - https://zakon.rada.gov.ua/laws/show/538-2008-%D1%80 - 2009 - https://zakon.rada.gov.ua/laws/show/1458-2008-%D1%80 - 2010 - https://zakon.rada.gov.ua/laws/show/1412-2009-%D1%80 - 2011 - https://zakon.rada.gov.ua/laws/show/2130-2010-%D1%80 - 2012 - https://zakon.rada.gov.ua/laws/show/1210-2011-%D1%80 - 2013 - https://zakon.rada.gov.ua/laws/show/1043-2012-%D1%80 - 2014 - https://zakon.rada.gov.ua/laws/show/920-2013-%D1%80 - 2015 - https://zakon.rada.gov.ua/laws/show/1084-2014-%D1%80 - 2016 - https://zakon.rada.gov.ua/laws/show/1155-2015-%D1%80 - 2017 - https://zakon.rada.gov.ua/laws/show/850-2016-%D1%80 - 2018 - https://zakon.rada.gov.ua/laws/show/1-2018-%D1%80 - 2019 - https://zakon.rada.gov.ua/laws/show/7-2019-%D1%80 - 2020 - https://zakon.rada.gov.ua/laws/show/995-2019-%D1%80 - 2021 - https://zakon.rada.gov.ua/laws/show/1191-2020-%D1%80 - 2022 - https://zakon.rada.gov.ua/laws/show/1004-2021-%D1%80 + Ukraine holidays. - Special holidays: - 1995 - https://zakon.rada.gov.ua/laws/show/13/95 + Current holidays list: + - https://zakon1.rada.gov.ua/laws/show/322-08/paran454#n454 """ country = "UA" @@ -212,6 +166,55 @@ class UKR(Ukraine): class UkraineStaticHolidays: + """ + Substituted holidays: + - `1992 [1] `_ + - `1992 [2] `_ + - `1993 [1] `_ + - `1993 [2] `_ + - `1994 `_ + - `1995 [1] `_ + - `1995 [2] `_ + - `1995 [3] `_ + - `1996 `_ + - `1997[1] `_ + - `1997[2] `_ + - `1999 [1] `_, + - `1999 [2] `_, + - `1999 [3] `_ + - `2000 [1] `_ + - `2000 [2] `_ + - `2001 [1] `_ + - `2001 [2] `_ + - `2002 `_ + - `2002 - 2003 `_ + - `2004 `_ + - `2005 [1] `_ + - `2005 [2] `_ + - `2006 [1] `_ + - `2006 [2] `_ + - `2007 `_ + - `2008 [1] `_ + - `2008 [2] `_ + - `2009 `_ + - `2010 `_ + - `2011 `_ + - `2012 `_ + - `2013 `_ + - `2014 `_ + - `2015 `_ + - `2016 `_ + - `2017 `_ + - `2018 `_ + - `2019 `_ + - `2020 `_ + - `2021 `_ + - `2022 `_ + + Special holidays: + - `1995 `_ + """ + special_holidays = { # Presidential decree holiday. 1995: (JAN, 9, tr("Вихідний згідно указу Президента")) diff --git a/holidays/groups/buddhist.py b/holidays/groups/buddhist.py index 43685a19d..cb8ba220a 100644 --- a/holidays/groups/buddhist.py +++ b/holidays/groups/buddhist.py @@ -10,7 +10,7 @@ # License: MIT (see LICENSE file) from datetime import date -from typing import Tuple, Optional +from typing import Optional, Tuple from holidays.calendars import _BuddhistLunisolar diff --git a/holidays/groups/chinese.py b/holidays/groups/chinese.py index 816766f50..870d0884f 100644 --- a/holidays/groups/chinese.py +++ b/holidays/groups/chinese.py @@ -11,7 +11,7 @@ from datetime import date from datetime import timedelta as td -from typing import Tuple, Optional +from typing import Optional, Tuple from holidays.calendars import _ChineseLunisolar from holidays.calendars.gregorian import APR diff --git a/holidays/groups/hindu.py b/holidays/groups/hindu.py index 3a2a63ad9..a947a600f 100644 --- a/holidays/groups/hindu.py +++ b/holidays/groups/hindu.py @@ -10,7 +10,7 @@ # License: MIT (see LICENSE file) from datetime import date -from typing import Tuple, Optional +from typing import Optional, Tuple from holidays.calendars import _HinduLunisolar diff --git a/holidays/groups/thai.py b/holidays/groups/thai.py index 4f2643314..81de998cc 100644 --- a/holidays/groups/thai.py +++ b/holidays/groups/thai.py @@ -12,7 +12,7 @@ from datetime import date from typing import Optional -from holidays.calendars.thai import _ThaiLunisolar, THAI_CALENDAR +from holidays.calendars.thai import THAI_CALENDAR, _ThaiLunisolar class ThaiCalendarHolidays: diff --git a/pyproject.toml b/pyproject.toml index b283c9c19..769fdbb78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ module = "holidays.groups.*" disable_error_code = "attr-defined" [tool.rstcheck] -ignore_directives = ["automodule"] +ignore_directives = ["automodule", "autosummary"] ignore_languages = ["python"] [tool.setuptools.dynamic] diff --git a/requirements/docs.txt b/requirements/docs.txt index 01a7d8e49..f6342e766 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,5 +1,5 @@ # pip requirements for building docs. # Must include package `install_requires` entries. python-dateutil -sphinx >= 4.3 -sphinx_rtd_theme >= 1.0 +sphinx +sphinx_rtd_theme From 225a471d8047d1bc2193e82a7f7782815e15ce32 Mon Sep 17 00:00:00 2001 From: ~Jhellico Date: Fri, 24 Nov 2023 22:08:07 +0200 Subject: [PATCH 04/14] Migrate South Korea holidays to ObservedHolidayBase (#1560) --- holidays/countries/south_korea.py | 135 ++++++++++++------------------ holidays/observed_holiday_base.py | 16 ++-- snapshots/countries/KR.json | 4 +- 3 files changed, 67 insertions(+), 88 deletions(-) diff --git a/holidays/countries/south_korea.py b/holidays/countries/south_korea.py index 2034f516e..a461a5ab5 100644 --- a/holidays/countries/south_korea.py +++ b/holidays/countries/south_korea.py @@ -13,24 +13,10 @@ from datetime import date from datetime import timedelta as td from gettext import gettext as tr +from typing import Dict, Set from holidays.calendars import _CustomChineseHolidays -from holidays.calendars.gregorian import ( - JAN, - FEB, - MAR, - APR, - MAY, - JUN, - JUL, - AUG, - SEP, - OCT, - NOV, - DEC, - SAT, - SUN, -) +from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC from holidays.constants import BANK, PUBLIC from holidays.groups import ( ChineseCalendarHolidays, @@ -38,7 +24,11 @@ InternationalHolidays, StaticHolidays, ) -from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NEXT_MON +from holidays.observed_holiday_base import ( + ObservedHolidayBase, + SAT_SUN_TO_NEXT_WORKDAY, + SUN_TO_NEXT_WORKDAY, +) class SouthKorea( @@ -95,66 +85,48 @@ def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) StaticHolidays.__init__(self, cls=SouthKoreaStaticHolidays) - kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON) + kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_WORKDAY) + kwargs.setdefault("observed_since", 2014) super().__init__(*args, **kwargs) - def _add_alt_holiday( - self, dt: date, name: str = "", since: int = 2014, include_sat: bool = True - ) -> None: - """ - Add alternative holiday on first day from the date provided - that's not already a another holiday nor a weekend. - - :param dt: - The date of the holiday. - - :param name: - The name of the holiday. - - :param since: - Year starting from which alt holiday should be added - - :param include_sat: - Whether Saturday is to be considered a weekend in addition to - Sunday. - """ - if not self.observed: - return None - - target_weekday = {SUN} - if include_sat: - target_weekday.add(SAT) - if (dt.weekday() in target_weekday or len(self.get_list(dt)) > 1) and dt.year >= since: - obs_date = dt + td(days=+1) - while obs_date.weekday() in target_weekday or obs_date in self: - obs_date += td(days=+1) - for name in (name,) if name else self.get_list(dt): - if "Alternative holiday" not in name: - self._add_holiday(self.tr(self.observed_label) % self.tr(name), obs_date) - - def _add_three_day_holiday(self, dt: date, name: str) -> None: - """ - Add holiday for the date before and after the given holiday date. - - :param dt: - The date of the holiday. - - :param name: - The name of the holiday. - """ - for dt_alt in ( - # The day preceding %s. - self._add_holiday(self.tr("%s 전날") % self.tr(name), dt + td(days=-1)), - dt, - # The second day of %s. - self._add_holiday(self.tr("%s 다음날") % self.tr(name), dt + td(days=+1)), - ): - self._add_alt_holiday(dt_alt, name=name, include_sat=False) # type: ignore[arg-type] + def _populate_observed(self, dts: Set[date], three_day_holidays: Dict[date, str]) -> None: + for dt in sorted(dts.union(three_day_holidays.keys())): + if not self._is_observed(dt): + continue + dt_observed = self._get_observed_date( + dt, SUN_TO_NEXT_WORKDAY if dt in three_day_holidays else SAT_SUN_TO_NEXT_WORKDAY + ) + if dt_observed != dt or len(self.get_list(dt)) > 1: + if dt_observed == dt: + dt_observed = self._get_next_workday(dt) + names = ( + (three_day_holidays[dt],) if dt in three_day_holidays else self.get_list(dt) + ) + for name in names: + self._add_holiday(self.tr(self.observed_label) % self.tr(name), dt_observed) def _populate_public_holidays(self): + def append_observed(dt: date, since: int): + if self._year >= since: + dts_observed.add(dt) + + def add_three_day_holiday(dt: date, name: str): + name = self.tr(name) + for dt_alt in ( + # The day preceding %s. + self._add_holiday(self.tr("%s 전날") % name, dt + td(days=-1)), + dt, + # The second day of %s. + self._add_holiday(self.tr("%s 다음날") % name, dt + td(days=+1)), + ): + three_days_holidays[dt_alt] = name + if self._year <= 1947: return None + dts_observed = set() + three_days_holidays = {} + # Fixed Date Holidays. # New Year's Day. @@ -175,12 +147,12 @@ def _populate_public_holidays(self): ) korean_new_year = self._add_chinese_new_years_day(name) if self._year >= 1989: - self._add_three_day_holiday(korean_new_year, name) + add_three_day_holiday(korean_new_year, name) # Independence Movement Day. mar_1 = self._add_holiday_mar_1(tr("삼일절")) # mar_1 is used later for Presidential Election Day. - self._add_alt_holiday(mar_1, since=2022) + append_observed(mar_1, 2022) if 1949 <= self._year <= 2005 and self._year != 1960: # Tree Planting Day. @@ -194,34 +166,34 @@ def _populate_public_holidays(self): # Buddha's Birthday. else tr("석가탄신일") ) - self._add_alt_holiday(self._add_chinese_birthday_of_buddha(name), since=2023) + append_observed(self._add_chinese_birthday_of_buddha(name), 2023) if self._year >= 1975: # Children's Day. - self._add_alt_holiday(self._add_holiday_may_5(tr("어린이날")), since=2015) + append_observed(self._add_holiday_may_5(tr("어린이날")), 2015) if self._year >= 1956: # Memorial Day. jun_6 = self._add_holiday_jun_6(tr("현충일")) - # jun_6 is used later for Local Election Day. + # jun_6 is used later for Local Election Day. if self._year <= 2007: # Constitution Day. self._add_holiday_jul_17(tr("제헌절")) # Liberation Day. - self._add_alt_holiday(self._add_holiday_aug_15(tr("광복절")), since=2021) + append_observed(self._add_holiday_aug_15(tr("광복절")), 2021) if 1976 <= self._year <= 1990: # Armed Forces Day. self._add_holiday_oct_1(tr("국군의 날")) # National Foundation Day. - self._add_alt_holiday(self._add_holiday_oct_3(tr("개천절")), since=2021) + append_observed(self._add_holiday_oct_3(tr("개천절")), 2021) if self._year <= 1990 or self._year >= 2013: # Hangul Day. - self._add_alt_holiday(self._add_holiday_oct_9(tr("한글날")), since=2021) + append_observed(self._add_holiday_oct_9(tr("한글날")), 2021) if 1950 <= self._year <= 1975: # United Nations Day. @@ -233,10 +205,10 @@ def _populate_public_holidays(self): if 1986 <= self._year <= 1988: self._add_mid_autumn_festival_day_two(self.tr("%s 다음날") % self.tr(name)) elif self._year >= 1989: - self._add_three_day_holiday(chuseok, name) + add_three_day_holiday(chuseok, name) # Christmas Day. - self._add_alt_holiday(self._add_christmas_day(tr("기독탄신일")), since=2023) + append_observed(self._add_christmas_day(tr("기독탄신일")), 2023) # Election Days since Sep 2006; excluding the 2017 Special Presidential Election Day. @@ -292,6 +264,9 @@ def _populate_public_holidays(self): else: self._add_holiday_1st_wed_of_jun(name) + if self.observed: + self._populate_observed(dts_observed, three_days_holidays) + def _populate_bank_holidays(self): if self._year <= 1947: return None diff --git a/holidays/observed_holiday_base.py b/holidays/observed_holiday_base.py index 00979ece6..fc04a9ce0 100644 --- a/holidays/observed_holiday_base.py +++ b/holidays/observed_holiday_base.py @@ -105,16 +105,20 @@ def __init__(self, observed_rule: ObservedRule, observed_since: int = None, *arg def _is_observed(self, *args, **kwargs) -> bool: return self._observed_since is None or self._year >= self._observed_since + def _get_next_workday(self, dt: date, delta: int = +1) -> date: + dt_work = dt + td(days=delta) + while dt_work.year == self._year: + if dt_work in self or self._is_weekend(dt_work): # type: ignore[operator] + dt_work += td(days=delta) + else: + return dt_work + return dt + def _get_observed_date(self, dt: date, rule: ObservedRule) -> date: delta = rule.get(dt.weekday(), 0) if delta != 0: if abs(delta) == 7: - delta //= 7 - dt += td(days=delta) - while dt.year == self._year and ( - dt in self or self._is_weekend(dt) # type: ignore[operator] - ): - dt += td(days=delta) + dt = self._get_next_workday(dt, delta // 7) else: dt += td(days=delta) return dt diff --git a/snapshots/countries/KR.json b/snapshots/countries/KR.json index 5218ac8c5..0f42e28e9 100644 --- a/snapshots/countries/KR.json +++ b/snapshots/countries/KR.json @@ -1513,8 +1513,8 @@ "2036-04-09": "National Assembly Election Day", "2036-05-01": "Workers' Day", "2036-05-03": "Buddha's Birthday", - "2036-05-05": "Alternative holiday for Buddha's Birthday; Children's Day", - "2036-05-06": "Alternative holiday for Children's Day", + "2036-05-05": "Children's Day", + "2036-05-06": "Alternative holiday for Buddha's Birthday", "2036-06-06": "Memorial Day", "2036-08-15": "Liberation Day", "2036-10-03": "National Foundation Day; The day preceding Chuseok", From 171a13668fe5ff28ea96f17f36acf185a1fa369e Mon Sep 17 00:00:00 2001 From: Jose Riha Date: Sat, 25 Nov 2023 01:39:12 +0100 Subject: [PATCH 05/14] Update Czechia holidays: add sk localization (#1568) Co-authored-by: Arkadii Yakovets --- README.rst | 2 +- holidays/countries/czechia.py | 2 +- holidays/locale/sk/LC_MESSAGES/CZ.po | 77 ++++++++++++++++++++++++++++ tests/countries/test_czechia.py | 18 +++++++ 4 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 holidays/locale/sk/LC_MESSAGES/CZ.po diff --git a/README.rst b/README.rst index aed605d8c..1028d2b9f 100644 --- a/README.rst +++ b/README.rst @@ -365,7 +365,7 @@ The list of supported countries, their subdivisions, supported languages and cat * - Czechia - CZ - - - **cs**, en_US, uk + - **cs**, en_US, sk, uk - * - Denmark - DK diff --git a/holidays/countries/czechia.py b/holidays/countries/czechia.py index a80579c9c..e50e30d9c 100644 --- a/holidays/countries/czechia.py +++ b/holidays/countries/czechia.py @@ -22,7 +22,7 @@ class Czechia(HolidayBase, ChristianHolidays, InternationalHolidays): country = "CZ" default_language = "cs" - supported_languages = ("cs", "en_US", "uk") + supported_languages = ("cs", "en_US", "sk", "uk") def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) diff --git a/holidays/locale/sk/LC_MESSAGES/CZ.po b/holidays/locale/sk/LC_MESSAGES/CZ.po new file mode 100644 index 000000000..ada78a723 --- /dev/null +++ b/holidays/locale/sk/LC_MESSAGES/CZ.po @@ -0,0 +1,77 @@ +# Czechia holidays sk localization. +# This file is distributed under the same license as the Python Holidays package. +# Authors: Jose Riha , (c) 2023. +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.38\n" +"POT-Creation-Date: 2023-11-24 00:14+0100\n" +"PO-Revision-Date: 2023-11-24 00:17+0100\n" +"Last-Translator: Jose Riha \n" +"Language-Team: Python Holidays Localization Team\n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n>=2 && n<=4 ? 1 : 2);\n" +"Generated-By: Lingua 4.15.0\n" +"X-Generator: Poedit 3.4.1\n" + +#. Independent Czech State Restoration Day. +msgid "Den obnovy samostatného českého státu" +msgstr "Deň obnovy samostatného českého štátu" + +#. New Year's Day. +msgid "Nový rok" +msgstr "Nový rok" + +#. Good Friday. +msgid "Velký pátek" +msgstr "Veľký piatok" + +#. Easter Monday. +msgid "Velikonoční pondělí" +msgstr "Veľkonočný pondelok" + +#. Labor Day. +msgid "Svátek práce" +msgstr "Sviatok práce" + +#. Victory Day. +msgid "Den vítězství" +msgstr "Deň víťazstva" + +#. Day of Victory over Fascism. +msgid "Den vítězství nad hitlerovským fašismem" +msgstr "Deň víťazstva nad hitlerovským fašizmom" + +#. Saints Cyril and Methodius Day. +msgid "Den slovanských věrozvěstů Cyrila a Metoděje" +msgstr "Deň slovanských vierozvestcov Cyrila a Metoda" + +#. Jan Hus Day. +msgid "Den upálení mistra Jana Husa" +msgstr "Deň upálenia majstra Jána Husa" + +#. Statehood Day. +msgid "Den české státnosti" +msgstr "Deň českej štátnosti" + +#. Independent Czechoslovak State Day. +msgid "Den vzniku samostatného československého státu" +msgstr "Deň vzniku samostatného československého štátu" + +#. Struggle for Freedom and Democracy Day. +msgid "Den boje za svobodu a demokracii" +msgstr "Deň boja za slobodu a demokraciu" + +#. Christmas Eve. +msgid "Štědrý den" +msgstr "Štedrý deň" + +#. Christmas Day. +msgid "1. svátek vánoční" +msgstr "1. sviatok vianočný" + +#. Second Day of Christmas. +msgid "2. svátek vánoční" +msgstr "2. sviatok vianočný" diff --git a/tests/countries/test_czechia.py b/tests/countries/test_czechia.py index 713d0c9e8..12d89bb46 100644 --- a/tests/countries/test_czechia.py +++ b/tests/countries/test_czechia.py @@ -151,6 +151,24 @@ def test_l10n_en_us(self): ("2022-12-26", "Second Day of Christmas"), ) + def test_l10n_sk(self): + self.assertLocalizedHolidays( + "sk", + ("2022-01-01", "Deň obnovy samostatného českého štátu"), + ("2022-04-15", "Veľký piatok"), + ("2022-04-18", "Veľkonočný pondelok"), + ("2022-05-01", "Sviatok práce"), + ("2022-05-08", "Deň víťazstva"), + ("2022-07-05", "Deň slovanských vierozvestcov Cyrila a Metoda"), + ("2022-07-06", "Deň upálenia majstra Jána Husa"), + ("2022-09-28", "Deň českej štátnosti"), + ("2022-10-28", "Deň vzniku samostatného československého štátu"), + ("2022-11-17", "Deň boja za slobodu a demokraciu"), + ("2022-12-24", "Štedrý deň"), + ("2022-12-25", "1. sviatok vianočný"), + ("2022-12-26", "2. sviatok vianočný"), + ) + def test_l10n_uk(self): self.assertLocalizedHolidays( "uk", From ab9959597627cfc8e67d18a6e8f3e3b55500cf50 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:49:16 -0800 Subject: [PATCH 06/14] Update pre-commit hooks (#1572) Co-authored-by: arkid15r --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 030efc77b..39e32df77 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: exclude: ^(docs) - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.0 + rev: v1.7.1 hooks: - id: mypy additional_dependencies: [types-all] From ff1b55c985f21cbd2855787dadba238674555d5a Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Sun, 26 Nov 2023 08:15:42 -0800 Subject: [PATCH 07/14] Update test coverage to 100% (#1573) --- holidays/countries/china.py | 4 ++-- tests/countries/test_china.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/holidays/countries/china.py b/holidays/countries/china.py index 75682d758..a24ee74e4 100644 --- a/holidays/countries/china.py +++ b/holidays/countries/china.py @@ -145,7 +145,7 @@ def _add_observed_one_off_holidays(self, dt: date): # 2 Extra Days for May Day >= 2020: self._add_holiday(self[dt], dt + td(days=+3)) self._add_holiday(self[dt], dt + td(days=+4)) - elif 2012 <= self._year <= 2019: + else: # [FRI]-SUN self._add_holiday(self[dt], dt + td(days=-1)) self._add_holiday(self[dt], dt + td(days=+1)) @@ -154,7 +154,7 @@ def _add_observed_one_off_holidays(self, dt: date): # MON-TUE self._add_holiday(self[dt], dt + td(days=+1)) self._add_holiday(self[dt], dt + td(days=+2)) - elif 2008 <= self._year <= 2011 or self._year >= 2020: + else: # [SAT]-MON self._add_holiday(self[dt], dt + td(days=-1)) self._add_holiday(self[dt], dt + td(days=+1)) diff --git a/tests/countries/test_china.py b/tests/countries/test_china.py index aa6ef8939..054c673ba 100644 --- a/tests/countries/test_china.py +++ b/tests/countries/test_china.py @@ -286,6 +286,22 @@ def test_2007_public_holiday(self): ("2007-12-31", "元旦"), ) + self.assertNonObservedHolidays( + China(categories=PUBLIC, observed=False, years=2007), + ("2007-01-01", "元旦"), + ("2007-02-18", "春节"), + ("2007-02-19", "春节"), + ("2007-02-20", "春节"), + ("2007-05-01", "劳动节"), + ("2007-05-02", "劳动节"), + ("2007-05-03", "劳动节"), + ("2007-10-01", "国庆节"), + ("2007-10-02", "国庆节"), + ("2007-10-03", "国庆节"), + ("2007-12-30", "元旦"), + ("2007-12-31", "元旦"), + ) + def test_2008_public_holiday(self): # https://www.gov.cn/gongbao/content/2008/content_859870.htm self.assertHolidays( From ea38c85e6f997f14801d8c932e14f95f85a6fa73 Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Sun, 26 Nov 2023 08:40:18 -0800 Subject: [PATCH 08/14] Update PR template and contributing guidelines (#1574) --- .github/PULL_REQUEST_TEMPLATE.md | 5 ++--- CONTRIBUTING.rst | 9 +++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 53fa4cecc..d81d30823 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -34,9 +34,8 @@ Your PR description goes here. --> - [ ] I've followed the [contributing guidelines][contributing-guidelines] -- [ ] I've added references to all holidays information sources used in this PR -- [ ] The code style looks good: `make pre-commit` command generates no changes -- [ ] All tests pass locally: `make test`, `make tox` (we strongly encourage adding tests to your code) +- [ ] I've run `make pre-commit`, it didn't generate any changes +- [ ] I've run `make test`, all tests passed locally