Skip to content

Commit

Permalink
Update documentation: add supported entities section (#1564)
Browse files Browse the repository at this point in the history
Co-authored-by: ~Jhellico <[email protected]>
  • Loading branch information
arkid15r and KJhellico authored Nov 23, 2023
1 parent ee359a7 commit aa78057
Show file tree
Hide file tree
Showing 33 changed files with 340 additions and 320 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ build/*
coverage.lcov
dist/
docs/build
docs/source/_autosummary
holidays/locale/pot/*.pot
!holidays/locale/pot/UA.pot
MANIFEST
Expand Down
18 changes: 13 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
examples
contributing
api
Supported Entities <modules>
changelog
genindex

Expand Down
9 changes: 9 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Supported Entities
==================

.. autosummary::
:toctree: _autosummary
:recursive:

holidays.countries
holidays.financial
6 changes: 3 additions & 3 deletions holidays/calendars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/algeria.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
24 changes: 12 additions & 12 deletions holidays/countries/angola.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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/
"""

country = "AO"
Expand Down
8 changes: 4 additions & 4 deletions holidays/countries/aruba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""

Expand Down
5 changes: 3 additions & 2 deletions holidays/countries/bangladesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions holidays/countries/belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 3 additions & 5 deletions holidays/countries/brazil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://www2.camara.leg.br/legin/fed/decret/1824-1899/decreto-155-b-14-janeiro-1890-517534-publicacaooriginal-1-pe.html>`_ # noqa: E501
- `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>`_ # noqa: E501
"""

country = "BR"
Expand Down
18 changes: 9 additions & 9 deletions holidays/countries/canada.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
65 changes: 32 additions & 33 deletions holidays/countries/china.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://zh.wikipedia.org/wiki/中华人民共和国节日与公众假期>`_
- `2023 <https://www.gov.cn/gongbao/content/2023/content_5736714.htm>`_
- `2022 <https://www.gov.cn/gongbao/content/2021/content_5651728.htm>`_
- `2021 <https://www.gov.cn/gongbao/content/2020/content_5567750.htm>`_
- `2020 <https://www.gov.cn/gongbao/content/2019/content_5459138.htm>`_
- `2019 <https://www.gov.cn/gongbao/content/2018/content_5350046.htm>`_
- `2018 <https://www.gov.cn/gongbao/content/2017/content_5248221.htm>`_
- `2017 <https://www.gov.cn/gongbao/content/2016/content_5148793.htm>`_
- `2016 <https://www.gov.cn/gongbao/content/2016/content_2979719.htm>`_
- `2015 <https://www.gov.cn/gongbao/content/2015/content_2799019.htm>`_
- `2014 <https://www.gov.cn/gongbao/content/2014/content_2561299.htm>`_
- `2013 <https://www.gov.cn/gongbao/content/2012/content_2292057.htm>`_
- `2012 <https://www.gov.cn/gongbao/content/2011/content_2020918.htm>`_
- `2011 <https://www.gov.cn/gongbao/content/2010/content_1765282.htm>`_
- `2010 <https://www.gov.cn/gongbao/content/2009/content_1487011.htm>`_
- `2009 <https://www.gov.cn/gongbao/content/2008/content_1175823.htm>`_
- `2008 <https://www.gov.cn/gongbao/content/2008/content_859870.htm>`_
- `2007 <https://www.gov.cn/gongbao/content/2007/content_503397.htm>`_
- `2006 <https://zh.wikisource.org/wiki/国务院办公厅关于2006年部分节假日安排的通知>`_
- `2005 <https://zh.wikisource.org/wiki/国务院办公厅关于2005年部分节假日安排的通知>`_
- `2004 <https://zh.wikisource.org/wiki/国务院办公厅关于2004年部分节假日安排的通知>`_
- `2003 <https://zh.wikisource.org/wiki/国务院办公厅关于2003年部分节假日休息安排的通知>`_
- `2002 <https://zh.wikisource.org/wiki/国务院办公厅关于2002年部分节假日休息安排的通知>`_
- `2001 <https://zh.wikisource.org/wiki/国务院办公厅关于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 <https://m.wannianli.tianqi.com/fangjiaanpai/2001.html>`_
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"
Expand Down
12 changes: 6 additions & 6 deletions holidays/countries/cuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
31 changes: 16 additions & 15 deletions holidays/countries/hungary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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>`_
"""

country = "HU"
Expand Down
Loading

0 comments on commit aa78057

Please sign in to comment.