Skip to content

Commit

Permalink
Categories constants
Browse files Browse the repository at this point in the history
  • Loading branch information
KJhellico committed Jun 23, 2023
1 parent 7308de4 commit 4c98230
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
24 changes: 24 additions & 0 deletions holidays/categories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# python-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: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)

# Supported holiday categories constants
BANK_HOLIDAYS = "BANK"
EXTENDED_HOLIDAYS = "EXTENDED"
GOVERNMENT_HOLIDAYS = "GOVERNMENT"
HALF_DAY_HOLIDAYS = "HALF-DAY"
PUBLIC_HOLIDAYS = "PUBLIC"
SCHOOL_HOLIDAYS = "SCHOOL"

CHINESE_HOLIDAYS = "CHINESE"
CHRISTIAN_HOLIDAYS = "CHRISTIAN"
HINDU_HOLIDAYS = "HINDU"
ISLAMIC_HOLIDAYS = "ISLAMIC"
JEWISH_HOLIDAYS = "JEWISH"
3 changes: 2 additions & 1 deletion holidays/countries/austria.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from gettext import gettext as tr

from holidays.categories import BANK_HOLIDAYS, PUBLIC_HOLIDAYS
from holidays.constants import OCT, NOV
from holidays.holiday_base import HolidayBase
from holidays.holiday_groups import ChristianHolidays, InternationalHolidays
Expand All @@ -19,7 +20,7 @@
class Austria(HolidayBase, ChristianHolidays, InternationalHolidays):
country = "AT"
default_language = "de"
supported_categories = ("bank", "public")
supported_categories = (BANK_HOLIDAYS, PUBLIC_HOLIDAYS)
supported_languages = ("de", "en_US", "uk")
subdivisions = ("1", "2", "3", "4", "5", "6", "7", "8", "9")

Expand Down
3 changes: 2 additions & 1 deletion holidays/holiday_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from dateutil.parser import parse

from holidays.categories import PUBLIC_HOLIDAYS
from holidays.constants import HOLIDAY_NAME_DELIMITER, MON, TUE, WED, THU, FRI, SAT, SUN
from holidays.helpers import _normalize_tuple

Expand Down Expand Up @@ -270,7 +271,7 @@ def __init__(
self.language = language.lower() if language else None
self.observed = observed
self.subdiv = subdiv or prov or state
self.categories = categories or ("public",)
self.categories = categories or (PUBLIC_HOLIDAYS,)

self.tr = gettext # Default translation method.

Expand Down

0 comments on commit 4c98230

Please sign in to comment.