holidays 0.42__py3-none-any.whl → 0.44__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- holidays/__init__.py +1 -1
- holidays/constants.py +1 -0
- holidays/countries/american_samoa.py +6 -0
- holidays/countries/austria.py +82 -9
- holidays/countries/ethiopia.py +70 -44
- holidays/countries/guam.py +6 -0
- holidays/countries/ireland.py +27 -23
- holidays/countries/northern_mariana_islands.py +6 -0
- holidays/countries/portugal.py +1 -1
- holidays/countries/puerto_rico.py +6 -0
- holidays/countries/taiwan.py +114 -24
- holidays/countries/thailand.py +4 -1
- holidays/countries/united_states.py +42 -0
- holidays/countries/united_states_minor_outlying_islands.py +6 -0
- holidays/countries/united_states_virgin_islands.py +6 -0
- holidays/holiday_base.py +32 -14
- holidays/locale/am/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/am/LC_MESSAGES/ET.po +31 -27
- holidays/locale/ar/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/ET.po +31 -27
- holidays/locale/de/LC_MESSAGES/AT.mo +0 -0
- holidays/locale/de/LC_MESSAGES/AT.po +25 -1
- holidays/locale/en_US/LC_MESSAGES/AT.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AT.po +25 -1
- holidays/locale/en_US/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ET.po +38 -34
- holidays/locale/en_US/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TW.po +14 -5
- holidays/locale/th/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/th/LC_MESSAGES/TW.po +14 -5
- holidays/locale/uk/LC_MESSAGES/AT.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/AT.po +25 -1
- holidays/locale/uk/LC_MESSAGES/CL.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CL.po +5 -5
- holidays/locale/uk/LC_MESSAGES/LT.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/LT.po +5 -5
- holidays/locale/zh_CN/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/zh_CN/LC_MESSAGES/TW.po +15 -6
- holidays/locale/zh_TW/LC_MESSAGES/TW.mo +0 -0
- holidays/locale/zh_TW/LC_MESSAGES/TW.po +14 -5
- holidays/utils.py +2 -2
- holidays-0.44.dist-info/AUTHORS +131 -0
- {holidays-0.42.dist-info → holidays-0.44.dist-info}/METADATA +25 -21
- {holidays-0.42.dist-info → holidays-0.44.dist-info}/RECORD +47 -46
- {holidays-0.42.dist-info → holidays-0.44.dist-info}/LICENSE +0 -0
- {holidays-0.42.dist-info → holidays-0.44.dist-info}/WHEEL +0 -0
- {holidays-0.42.dist-info → holidays-0.44.dist-info}/top_level.txt +0 -0
holidays/countries/taiwan.py
CHANGED
|
@@ -9,68 +9,86 @@
|
|
|
9
9
|
# Website: https://github.com/dr-prodigy/python-holidays
|
|
10
10
|
# License: MIT (see LICENSE file)
|
|
11
11
|
|
|
12
|
+
from datetime import date
|
|
12
13
|
from gettext import gettext as tr
|
|
14
|
+
from typing import Set
|
|
13
15
|
|
|
14
|
-
from holidays.
|
|
16
|
+
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, SEP, OCT, DEC
|
|
17
|
+
from holidays.groups import ChineseCalendarHolidays, InternationalHolidays, StaticHolidays
|
|
15
18
|
from holidays.observed_holiday_base import (
|
|
16
19
|
ObservedHolidayBase,
|
|
20
|
+
ObservedRule,
|
|
17
21
|
SAT_TO_PREV_WORKDAY,
|
|
18
22
|
SUN_TO_NEXT_WORKDAY,
|
|
23
|
+
SAT_SUN_TO_NEXT_WORKDAY,
|
|
19
24
|
)
|
|
20
25
|
|
|
21
26
|
|
|
22
|
-
class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays):
|
|
27
|
+
class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays, StaticHolidays):
|
|
23
28
|
"""
|
|
24
29
|
References:
|
|
25
|
-
- https://www.dgpa.gov.tw/information?uid=353&pid=10659
|
|
26
30
|
- https://en.wikipedia.org/wiki/Public_holidays_in_Taiwan
|
|
27
31
|
- https://www.officeholidays.com/countries/taiwan
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
- `2024 <https://www.dgpa.gov.tw/en/information?uid=353&pid=11402>`_
|
|
33
|
+
- `2023 <https://www.dgpa.gov.tw/en/information?uid=353&pid=11016>`_
|
|
34
|
+
- `2022 <https://www.dgpa.gov.tw/en/information?uid=353&pid=10659>`_
|
|
35
|
+
- `2021 <https://www.dgpa.gov.tw/en/information?uid=353&pid=10181>`_
|
|
36
|
+
- `2020 <https://www.dgpa.gov.tw/en/information?uid=353&pid=9724>`_
|
|
37
|
+
- `2019 <https://www.dgpa.gov.tw/en/information?uid=353&pid=8178>`_
|
|
38
|
+
- `2018 <https://www.dgpa.gov.tw/en/information?uid=353&pid=7730>`_
|
|
39
|
+
- `2017 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6178>`_
|
|
40
|
+
- `2016 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6180>`_
|
|
41
|
+
- `2015 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6182>`_
|
|
42
|
+
- `2014 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6183>`_
|
|
43
|
+
- `2013 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6186>`_
|
|
44
|
+
- `2012 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6187>`_
|
|
45
|
+
- `2011 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6188>`_
|
|
46
|
+
- `2010 <https://www.dgpa.gov.tw/en/information?uid=353&pid=6189>`_
|
|
32
47
|
"""
|
|
33
48
|
|
|
34
49
|
country = "TW"
|
|
35
50
|
# %s (observed).
|
|
36
|
-
observed_label = tr("%s
|
|
51
|
+
observed_label = tr("%s(慶祝)")
|
|
37
52
|
default_language = "zh_TW"
|
|
38
53
|
supported_languages = ("en_US", "th", "zh_CN", "zh_TW")
|
|
39
54
|
|
|
40
55
|
def __init__(self, *args, **kwargs):
|
|
41
56
|
ChineseCalendarHolidays.__init__(self)
|
|
42
57
|
InternationalHolidays.__init__(self)
|
|
58
|
+
StaticHolidays.__init__(self, TaiwanStaticHolidays)
|
|
43
59
|
kwargs.setdefault("observed_rule", SAT_TO_PREV_WORKDAY + SUN_TO_NEXT_WORKDAY)
|
|
44
|
-
kwargs.setdefault("observed_since", 2015)
|
|
45
60
|
super().__init__(*args, **kwargs)
|
|
46
61
|
|
|
62
|
+
def _populate_observed(
|
|
63
|
+
self, dts: Set[date], rule: ObservedRule = None, since: int = 2015
|
|
64
|
+
) -> None:
|
|
65
|
+
if self._year < since:
|
|
66
|
+
return None
|
|
67
|
+
for dt in sorted(dts):
|
|
68
|
+
for name in self.get_list(dt):
|
|
69
|
+
self._add_observed(dt, name, rule)
|
|
70
|
+
|
|
47
71
|
def _populate_public_holidays(self):
|
|
48
72
|
if self._year <= 1911:
|
|
49
73
|
return None
|
|
50
74
|
|
|
51
75
|
dts_observed = set()
|
|
76
|
+
dts_observed_forward = set()
|
|
52
77
|
|
|
53
78
|
# Founding Day of the Republic of China.
|
|
54
79
|
name = tr("中華民國開國紀念日")
|
|
55
80
|
dts_observed.add(self._add_new_years_day(name))
|
|
56
|
-
self.
|
|
81
|
+
if self._year >= 2015:
|
|
82
|
+
self._add_observed(self._next_year_new_years_day, name=name)
|
|
57
83
|
|
|
58
84
|
# Chinese New Year's Eve.
|
|
59
|
-
self._add_chinese_new_years_eve(tr("農曆除夕"))
|
|
85
|
+
dts_observed_forward.add(self._add_chinese_new_years_eve(tr("農曆除夕")))
|
|
60
86
|
|
|
61
87
|
# Chinese New Year.
|
|
62
88
|
name = tr("春節")
|
|
63
|
-
|
|
64
|
-
self._add_chinese_new_years_day_two(name)
|
|
65
|
-
self._add_chinese_new_years_day_three(name)
|
|
66
|
-
if self.observed and self._year >= 2015:
|
|
67
|
-
if self._is_monday(dt):
|
|
68
|
-
self._add_chinese_new_years_day_four(name)
|
|
69
|
-
elif self._is_thursday(dt):
|
|
70
|
-
self._add_chinese_new_years_day_five(name)
|
|
71
|
-
elif self._is_friday(dt) or self._is_weekend(dt):
|
|
72
|
-
self._add_chinese_new_years_day_four(name)
|
|
73
|
-
self._add_chinese_new_years_day_five(name)
|
|
89
|
+
dts_observed_forward.add(self._add_chinese_new_years_day(name))
|
|
90
|
+
dts_observed_forward.add(self._add_chinese_new_years_day_two(name))
|
|
91
|
+
dts_observed_forward.add(self._add_chinese_new_years_day_three(name))
|
|
74
92
|
|
|
75
93
|
if self._year >= 1997:
|
|
76
94
|
# Peace Memorial Day.
|
|
@@ -78,7 +96,9 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
|
|
|
78
96
|
|
|
79
97
|
if 1990 <= self._year <= 1999 or self._year >= 2011:
|
|
80
98
|
# Children's Day.
|
|
81
|
-
|
|
99
|
+
apr_4 = self._add_holiday_apr_4(tr("兒童節"))
|
|
100
|
+
if self._year != 2021:
|
|
101
|
+
dts_observed.add(apr_4)
|
|
82
102
|
|
|
83
103
|
if self._year >= 1972:
|
|
84
104
|
# Tomb Sweeping Day.
|
|
@@ -94,7 +114,8 @@ class Taiwan(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays
|
|
|
94
114
|
dts_observed.add(self._add_holiday_oct_10(tr("中華民國國慶日")))
|
|
95
115
|
|
|
96
116
|
if self.observed:
|
|
97
|
-
self._populate_observed(dts_observed
|
|
117
|
+
self._populate_observed(dts_observed)
|
|
118
|
+
self._populate_observed(dts_observed_forward, rule=SAT_SUN_TO_NEXT_WORKDAY, since=2010)
|
|
98
119
|
|
|
99
120
|
|
|
100
121
|
class TW(Taiwan):
|
|
@@ -103,3 +124,72 @@ class TW(Taiwan):
|
|
|
103
124
|
|
|
104
125
|
class TWN(Taiwan):
|
|
105
126
|
pass
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class TaiwanStaticHolidays:
|
|
130
|
+
# Date format (see strftime() Format Codes).
|
|
131
|
+
substituted_date_format = tr("%Y-%m-%d")
|
|
132
|
+
# Day off (substituted from %s).
|
|
133
|
+
substituted_label = tr("休息日(%s日起取代)")
|
|
134
|
+
|
|
135
|
+
childrens_day = tr("兒童節")
|
|
136
|
+
|
|
137
|
+
special_public_holidays = {
|
|
138
|
+
2010: (FEB, 19, FEB, 6),
|
|
139
|
+
2012: (
|
|
140
|
+
(JAN, 27, FEB, 4),
|
|
141
|
+
(FEB, 27, MAR, 3),
|
|
142
|
+
(DEC, 31, DEC, 22),
|
|
143
|
+
),
|
|
144
|
+
2013: (
|
|
145
|
+
(FEB, 15, FEB, 23),
|
|
146
|
+
(SEP, 20, SEP, 14),
|
|
147
|
+
),
|
|
148
|
+
2015: (JAN, 2, DEC, 27, 2014),
|
|
149
|
+
2016: (
|
|
150
|
+
(FEB, 12, JAN, 30),
|
|
151
|
+
(JUN, 10, JUN, 4),
|
|
152
|
+
(SEP, 16, SEP, 10),
|
|
153
|
+
),
|
|
154
|
+
2017: (
|
|
155
|
+
(FEB, 27, FEB, 18),
|
|
156
|
+
(MAY, 29, JUN, 3),
|
|
157
|
+
(OCT, 9, SEP, 30),
|
|
158
|
+
),
|
|
159
|
+
2018: (
|
|
160
|
+
(APR, 6, MAR, 31),
|
|
161
|
+
(DEC, 31, DEC, 22),
|
|
162
|
+
),
|
|
163
|
+
2019: (
|
|
164
|
+
(FEB, 8, JAN, 19),
|
|
165
|
+
(MAR, 1, FEB, 23),
|
|
166
|
+
(OCT, 11, OCT, 5),
|
|
167
|
+
),
|
|
168
|
+
2020: (
|
|
169
|
+
(JAN, 23, FEB, 15),
|
|
170
|
+
(JUN, 26, JUN, 20),
|
|
171
|
+
(OCT, 2, SEP, 26),
|
|
172
|
+
),
|
|
173
|
+
2021: (
|
|
174
|
+
(FEB, 10, FEB, 20),
|
|
175
|
+
(SEP, 20, SEP, 11),
|
|
176
|
+
),
|
|
177
|
+
2022: (FEB, 4, JAN, 22),
|
|
178
|
+
2023: (
|
|
179
|
+
(JAN, 20, JAN, 7),
|
|
180
|
+
(JAN, 27, FEB, 4),
|
|
181
|
+
(FEB, 27, FEB, 18),
|
|
182
|
+
(APR, 3, MAR, 25),
|
|
183
|
+
(JUN, 23, JUN, 17),
|
|
184
|
+
(OCT, 9, SEP, 23),
|
|
185
|
+
),
|
|
186
|
+
2024: (FEB, 8, FEB, 17),
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
special_public_holidays_observed = {
|
|
190
|
+
2013: (APR, 5, childrens_day),
|
|
191
|
+
2016: (APR, 5, childrens_day),
|
|
192
|
+
2017: (APR, 3, childrens_day),
|
|
193
|
+
2021: (APR, 2, childrens_day),
|
|
194
|
+
2024: (APR, 5, childrens_day),
|
|
195
|
+
}
|
holidays/countries/thailand.py
CHANGED
|
@@ -829,7 +829,10 @@ class ThailandStaticHolidays:
|
|
|
829
829
|
(JUL, 31, thai_bridge_public_holiday),
|
|
830
830
|
(DEC, 29, thai_bridge_public_holiday),
|
|
831
831
|
),
|
|
832
|
-
2024: (
|
|
832
|
+
2024: (
|
|
833
|
+
(APR, 12, thai_bridge_public_holiday),
|
|
834
|
+
(DEC, 30, thai_bridge_public_holiday),
|
|
835
|
+
),
|
|
833
836
|
}
|
|
834
837
|
special_workday_holidays = {1999: (MAY, 14, tr("วันพืชมงคล"))}
|
|
835
838
|
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
from typing import Tuple, Union
|
|
13
13
|
|
|
14
14
|
from holidays.calendars.gregorian import DEC
|
|
15
|
+
from holidays.constants import PUBLIC, UNOFFICIAL
|
|
15
16
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
16
17
|
from holidays.observed_holiday_base import (
|
|
17
18
|
ObservedHolidayBase,
|
|
@@ -42,6 +43,7 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
42
43
|
"""
|
|
43
44
|
|
|
44
45
|
country = "US"
|
|
46
|
+
supported_categories = (PUBLIC, UNOFFICIAL)
|
|
45
47
|
observed_label = "%s (observed)"
|
|
46
48
|
subdivisions: Union[Tuple[()], Tuple[str, ...]] = (
|
|
47
49
|
"AK", # Alaska.
|
|
@@ -168,6 +170,9 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
168
170
|
)
|
|
169
171
|
|
|
170
172
|
def _populate_subdiv_holidays(self):
|
|
173
|
+
if PUBLIC not in self.categories:
|
|
174
|
+
return None
|
|
175
|
+
|
|
171
176
|
# Martin Luther King Jr. Day
|
|
172
177
|
if self._year >= 1986 and self.subdiv not in {"AL", "AR", "AZ", "GA", "ID", "MS", "NH"}:
|
|
173
178
|
self._add_holiday_3rd_mon_of_jan("Martin Luther King Jr. Day")
|
|
@@ -929,6 +934,43 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
929
934
|
def _populate_subdiv_wy_public_holidays(self):
|
|
930
935
|
pass
|
|
931
936
|
|
|
937
|
+
def _populate_unofficial_holidays(self):
|
|
938
|
+
# Very common celebrated cultural days, but no official observance.
|
|
939
|
+
# Due to its nature, no in-lieus are observed.
|
|
940
|
+
|
|
941
|
+
# Valentine's Day
|
|
942
|
+
# While the modern iteration of Valentine's Day has started in the UK in 1797,
|
|
943
|
+
# it wasn't until 1847 in the US that this started to be observed here.
|
|
944
|
+
|
|
945
|
+
if self._year >= 1847:
|
|
946
|
+
self._add_holiday_feb_14("Valentine's Day")
|
|
947
|
+
|
|
948
|
+
# St. Patrick's Day
|
|
949
|
+
# Started in Boston in 1737 for the US.
|
|
950
|
+
|
|
951
|
+
self._add_holiday_mar_17("St. Patrick's Day")
|
|
952
|
+
|
|
953
|
+
# Halloween
|
|
954
|
+
# Halloween began in the US sometime around the 19th century.
|
|
955
|
+
|
|
956
|
+
self._add_holiday_oct_31("Halloween")
|
|
957
|
+
|
|
958
|
+
# Continental US non-Public dates
|
|
959
|
+
|
|
960
|
+
if self.subdiv not in {"AS", "GU", "MP", "PR", "UM", "VI"}:
|
|
961
|
+
# Groundhog Day
|
|
962
|
+
# First observed on Feb 2 in 1886 in Continental US + Hawaii.
|
|
963
|
+
|
|
964
|
+
if self._year >= 1886:
|
|
965
|
+
self._add_holiday_feb_2("Groundhog Day")
|
|
966
|
+
|
|
967
|
+
# Election Day
|
|
968
|
+
# May be duplicates for certain states which has this as their actual public holiday.
|
|
969
|
+
# The current US Presidential Election date pattern was codified in 1848 nationwide.
|
|
970
|
+
|
|
971
|
+
if self._year >= 1848 and self._year % 4 == 0:
|
|
972
|
+
self._add_holiday_1_day_past_1st_mon_of_nov("Election Day")
|
|
973
|
+
|
|
932
974
|
|
|
933
975
|
class US(UnitedStates):
|
|
934
976
|
pass
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
# Website: https://github.com/dr-prodigy/python-holidays
|
|
10
10
|
# License: MIT (see LICENSE file)
|
|
11
11
|
|
|
12
|
+
from holidays.constants import PUBLIC, UNOFFICIAL
|
|
12
13
|
from holidays.countries.united_states import US
|
|
13
14
|
|
|
14
15
|
|
|
@@ -18,12 +19,17 @@ class HolidaysUM(US):
|
|
|
18
19
|
# https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1
|
|
19
20
|
|
|
20
21
|
country = "UM"
|
|
22
|
+
supported_categories = (PUBLIC, UNOFFICIAL)
|
|
21
23
|
subdivisions = () # Override US subdivisions.
|
|
22
24
|
|
|
23
25
|
def _populate_public_holidays(self) -> None:
|
|
24
26
|
self.subdiv = "UM"
|
|
25
27
|
super()._populate_public_holidays()
|
|
26
28
|
|
|
29
|
+
def _populate_unofficial_holidays(self) -> None:
|
|
30
|
+
self.subdiv = "UM"
|
|
31
|
+
super()._populate_unofficial_holidays()
|
|
32
|
+
|
|
27
33
|
|
|
28
34
|
class UM(HolidaysUM):
|
|
29
35
|
pass
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
# Website: https://github.com/dr-prodigy/python-holidays
|
|
10
10
|
# License: MIT (see LICENSE file)
|
|
11
11
|
|
|
12
|
+
from holidays.constants import PUBLIC, UNOFFICIAL
|
|
12
13
|
from holidays.countries.united_states import US
|
|
13
14
|
|
|
14
15
|
|
|
@@ -18,12 +19,17 @@ class HolidaysVI(US):
|
|
|
18
19
|
# https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1
|
|
19
20
|
|
|
20
21
|
country = "VI"
|
|
22
|
+
supported_categories = (PUBLIC, UNOFFICIAL)
|
|
21
23
|
subdivisions = () # Override US subdivisions.
|
|
22
24
|
|
|
23
25
|
def _populate_public_holidays(self) -> None:
|
|
24
26
|
self.subdiv = "VI"
|
|
25
27
|
super()._populate_public_holidays()
|
|
26
28
|
|
|
29
|
+
def _populate_unofficial_holidays(self) -> None:
|
|
30
|
+
self.subdiv = "VI"
|
|
31
|
+
super()._populate_unofficial_holidays()
|
|
32
|
+
|
|
27
33
|
|
|
28
34
|
class VI(HolidaysVI):
|
|
29
35
|
pass
|
holidays/holiday_base.py
CHANGED
|
@@ -209,6 +209,9 @@ class HolidayBase(Dict[date, str]):
|
|
|
209
209
|
"""The market's ISO 3166-1 alpha-2 code."""
|
|
210
210
|
subdivisions: Tuple[str, ...] = ()
|
|
211
211
|
"""The subdivisions supported for this country (see documentation)."""
|
|
212
|
+
subdivisions_aliases: Dict[str, str] = {}
|
|
213
|
+
"""Aliases for the ISO 3166-2 subdivision codes with the key as alias and
|
|
214
|
+
the value the ISO 3166-2 subdivision code."""
|
|
212
215
|
years: Set[int]
|
|
213
216
|
"""The years calculated."""
|
|
214
217
|
expand: bool
|
|
@@ -217,7 +220,7 @@ class HolidayBase(Dict[date, str]):
|
|
|
217
220
|
observed: bool
|
|
218
221
|
"""Whether dates when public holiday are observed are included."""
|
|
219
222
|
subdiv: Optional[str] = None
|
|
220
|
-
"""The subdiv requested."""
|
|
223
|
+
"""The subdiv requested as ISO 3166-2 code or one of the aliases."""
|
|
221
224
|
special_holidays: Dict[int, Union[SpecialHoliday, SubstitutedHoliday]] = {}
|
|
222
225
|
"""A list of the country-wide special (as opposite to regular) holidays for
|
|
223
226
|
a specific year."""
|
|
@@ -262,8 +265,8 @@ class HolidayBase(Dict[date, str]):
|
|
|
262
265
|
following Monday). This doesn't work for all countries.
|
|
263
266
|
|
|
264
267
|
:param subdiv:
|
|
265
|
-
The subdivision (e.g. state or province)
|
|
266
|
-
countries (see documentation).
|
|
268
|
+
The subdivision (e.g. state or province) as a ISO 3166-2 code
|
|
269
|
+
or its alias; not implemented for all countries (see documentation).
|
|
267
270
|
|
|
268
271
|
:param prov:
|
|
269
272
|
*deprecated* use subdiv instead.
|
|
@@ -304,10 +307,10 @@ class HolidayBase(Dict[date, str]):
|
|
|
304
307
|
if isinstance(subdiv, int):
|
|
305
308
|
subdiv = str(subdiv)
|
|
306
309
|
|
|
310
|
+
subdivisions_aliases = tuple(sorted(self.subdivisions_aliases))
|
|
307
311
|
# Unsupported subdivisions.
|
|
308
|
-
if (
|
|
309
|
-
|
|
310
|
-
and subdiv not in self.subdivisions + self._deprecated_subdivisions
|
|
312
|
+
if not isinstance(self, HolidaySum) and subdiv not in (
|
|
313
|
+
self.subdivisions + subdivisions_aliases + self._deprecated_subdivisions
|
|
311
314
|
):
|
|
312
315
|
raise NotImplementedError(
|
|
313
316
|
f"Entity `{self._entity_code}` does not have subdivision {subdiv}"
|
|
@@ -326,7 +329,9 @@ class HolidayBase(Dict[date, str]):
|
|
|
326
329
|
warnings.warn(
|
|
327
330
|
"This subdivision is deprecated and will be removed after "
|
|
328
331
|
"Dec, 1 2023. The list of supported subdivisions: "
|
|
329
|
-
f"{', '.join(sorted(self.subdivisions))}
|
|
332
|
+
f"{', '.join(sorted(self.subdivisions))}; "
|
|
333
|
+
"the list of supported subdivisions aliases: "
|
|
334
|
+
f"{', '.join(subdivisions_aliases)}.",
|
|
330
335
|
DeprecationWarning,
|
|
331
336
|
)
|
|
332
337
|
|
|
@@ -657,19 +662,32 @@ class HolidayBase(Dict[date, str]):
|
|
|
657
662
|
|
|
658
663
|
@cached_property
|
|
659
664
|
def _normalized_subdiv(self):
|
|
660
|
-
return
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
665
|
+
return (
|
|
666
|
+
self.subdivisions_aliases.get(self.subdiv, self.subdiv)
|
|
667
|
+
.translate(
|
|
668
|
+
str.maketrans(
|
|
669
|
+
{
|
|
670
|
+
"-": "_",
|
|
671
|
+
" ": "_",
|
|
672
|
+
}
|
|
673
|
+
)
|
|
666
674
|
)
|
|
667
|
-
|
|
675
|
+
.lower()
|
|
676
|
+
)
|
|
668
677
|
|
|
669
678
|
@cached_property
|
|
670
679
|
def _sorted_categories(self):
|
|
671
680
|
return sorted(self.categories)
|
|
672
681
|
|
|
682
|
+
@classmethod
|
|
683
|
+
def get_subdivision_aliases(cls) -> Dict[str, List]:
|
|
684
|
+
"""Get subdivision aliases."""
|
|
685
|
+
subdivision_aliases: Dict[str, List[str]] = {s: [] for s in cls.subdivisions}
|
|
686
|
+
for alias, subdivision in cls.subdivisions_aliases.items():
|
|
687
|
+
subdivision_aliases[subdivision].append(alias)
|
|
688
|
+
|
|
689
|
+
return subdivision_aliases
|
|
690
|
+
|
|
673
691
|
def _is_leap_year(self) -> bool:
|
|
674
692
|
"""
|
|
675
693
|
Returns True if the year is leap. Returns False otherwise.
|
|
Binary file
|
|
@@ -3,51 +3,48 @@
|
|
|
3
3
|
#
|
|
4
4
|
msgid ""
|
|
5
5
|
msgstr ""
|
|
6
|
-
"Project-Id-Version: Python Holidays 0.
|
|
6
|
+
"Project-Id-Version: Python Holidays 0.44\n"
|
|
7
7
|
"POT-Creation-Date: 2023-02-15 14:15-0800\n"
|
|
8
|
-
"PO-Revision-Date:
|
|
9
|
-
"Last-Translator:
|
|
8
|
+
"PO-Revision-Date: 2024-02-27 14:46+0200\n"
|
|
9
|
+
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
|
|
10
10
|
"Language-Team: Python Holidays localization team\n"
|
|
11
11
|
"Language: am\n"
|
|
12
12
|
"MIME-Version: 1.0\n"
|
|
13
13
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
14
14
|
"Content-Transfer-Encoding: 8bit\n"
|
|
15
15
|
"Generated-By: Lingua 4.15.0\n"
|
|
16
|
-
"X-Generator: Poedit 3.
|
|
16
|
+
"X-Generator: Poedit 3.4.2\n"
|
|
17
17
|
|
|
18
|
-
#.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
#. Finding of True Cross.
|
|
23
|
-
msgid "መስቀል"
|
|
18
|
+
#. %s (estimated).
|
|
19
|
+
#, c-format
|
|
20
|
+
msgid "%s (ግምት)"
|
|
24
21
|
msgstr ""
|
|
25
22
|
|
|
26
|
-
#.
|
|
23
|
+
#. Christmas Day.
|
|
27
24
|
msgid "ገና"
|
|
28
25
|
msgstr ""
|
|
29
26
|
|
|
30
|
-
#.
|
|
27
|
+
#. Epiphany.
|
|
31
28
|
msgid "ጥምቀት"
|
|
32
29
|
msgstr ""
|
|
33
30
|
|
|
34
|
-
#.
|
|
35
|
-
msgid "
|
|
31
|
+
#. Adwa Victory Day.
|
|
32
|
+
msgid "አድዋ"
|
|
36
33
|
msgstr ""
|
|
37
34
|
|
|
38
|
-
#.
|
|
39
|
-
msgid "
|
|
35
|
+
#. Good Friday.
|
|
36
|
+
msgid "ስቅለት"
|
|
40
37
|
msgstr ""
|
|
41
38
|
|
|
42
|
-
#.
|
|
43
|
-
msgid "
|
|
39
|
+
#. Easter Sunday.
|
|
40
|
+
msgid "ፋሲካ"
|
|
44
41
|
msgstr ""
|
|
45
42
|
|
|
46
|
-
#.
|
|
43
|
+
#. Workers' Day.
|
|
47
44
|
msgid "የሰራተኞች ቀን"
|
|
48
45
|
msgstr ""
|
|
49
46
|
|
|
50
|
-
#. Patriots Day.
|
|
47
|
+
#. Patriots' Day.
|
|
51
48
|
msgid "የአርበኞች ቀን"
|
|
52
49
|
msgstr ""
|
|
53
50
|
|
|
@@ -55,8 +52,20 @@ msgstr ""
|
|
|
55
52
|
msgid "ደርግ የወደቀበት ቀን"
|
|
56
53
|
msgstr ""
|
|
57
54
|
|
|
58
|
-
#.
|
|
59
|
-
msgid "
|
|
55
|
+
#. Ethiopian New Year.
|
|
56
|
+
msgid "እንቁጣጣሽ"
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#. Finding of True Cross.
|
|
60
|
+
msgid "መስቀል"
|
|
61
|
+
msgstr ""
|
|
62
|
+
|
|
63
|
+
#. Revolution Day.
|
|
64
|
+
msgid "የአብዮት ቀን"
|
|
65
|
+
msgstr ""
|
|
66
|
+
|
|
67
|
+
#. October Revolution Day.
|
|
68
|
+
msgid "የጥቅምት አብዮት ቀን"
|
|
60
69
|
msgstr ""
|
|
61
70
|
|
|
62
71
|
#. Eid al-Fitr.
|
|
@@ -70,8 +79,3 @@ msgstr ""
|
|
|
70
79
|
#. Prophet's Birthday.
|
|
71
80
|
msgid "መውሊድ"
|
|
72
81
|
msgstr ""
|
|
73
|
-
|
|
74
|
-
#. %s (estimated).
|
|
75
|
-
#, c-format
|
|
76
|
-
msgid "%s (ግምት)"
|
|
77
|
-
msgstr ""
|
|
Binary file
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# Ethiopia holidays ar localization
|
|
1
|
+
# Ethiopia holidays ar localization.
|
|
2
2
|
# Authors: Arkadii Yakovets <ark@cho.red>, (c) 2023.
|
|
3
3
|
#
|
|
4
4
|
msgid ""
|
|
5
5
|
msgstr ""
|
|
6
|
-
"Project-Id-Version: Python Holidays 0.
|
|
7
|
-
"POT-Creation-Date:
|
|
8
|
-
"PO-Revision-Date:
|
|
9
|
-
"Last-Translator:
|
|
6
|
+
"Project-Id-Version: Python Holidays 0.44\n"
|
|
7
|
+
"POT-Creation-Date: 2024-02-27 14:42+0200\n"
|
|
8
|
+
"PO-Revision-Date: 2024-02-27 14:51+0200\n"
|
|
9
|
+
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
|
|
10
10
|
"Language-Team: Python Holidays localization team\n"
|
|
11
11
|
"Language: ar\n"
|
|
12
12
|
"MIME-Version: 1.0\n"
|
|
@@ -14,46 +14,38 @@ msgstr ""
|
|
|
14
14
|
"Content-Transfer-Encoding: 8bit\n"
|
|
15
15
|
"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n"
|
|
16
16
|
"Generated-By: Lingua 4.15.0\n"
|
|
17
|
-
"X-Generator: Poedit 3.
|
|
17
|
+
"X-Generator: Poedit 3.4.2\n"
|
|
18
18
|
|
|
19
19
|
#. %s (estimated).
|
|
20
20
|
#, c-format
|
|
21
21
|
msgid "%s (ግምት)"
|
|
22
22
|
msgstr "(تقدير) %s"
|
|
23
23
|
|
|
24
|
-
#.
|
|
25
|
-
msgid "አዲስ ዓመት እንቁጣጣሽ"
|
|
26
|
-
msgstr "السنة الإثيوبية الجديدة"
|
|
27
|
-
|
|
28
|
-
#. Finding of True Cross.
|
|
29
|
-
msgid "መስቀል"
|
|
30
|
-
msgstr "العثور على الصليب الحقيقي"
|
|
31
|
-
|
|
32
|
-
#. Orthodox Christmas Day.
|
|
24
|
+
#. Christmas Day.
|
|
33
25
|
msgid "ገና"
|
|
34
26
|
msgstr "عيد الميلاد"
|
|
35
27
|
|
|
36
|
-
#.
|
|
28
|
+
#. Epiphany.
|
|
37
29
|
msgid "ጥምቀት"
|
|
38
30
|
msgstr "عيد الغطاس"
|
|
39
31
|
|
|
40
|
-
#.
|
|
32
|
+
#. Adwa Victory Day.
|
|
33
|
+
msgid "አድዋ"
|
|
34
|
+
msgstr "العدوة"
|
|
35
|
+
|
|
36
|
+
#. Good Friday.
|
|
41
37
|
msgid "ስቅለት"
|
|
42
38
|
msgstr "جمعة جيدة"
|
|
43
39
|
|
|
44
|
-
#.
|
|
40
|
+
#. Easter Sunday.
|
|
45
41
|
msgid "ፋሲካ"
|
|
46
42
|
msgstr "عيد الفصح"
|
|
47
43
|
|
|
48
|
-
#.
|
|
49
|
-
msgid "አድዋ"
|
|
50
|
-
msgstr "العدوة"
|
|
51
|
-
|
|
52
|
-
#. Labor Day.
|
|
44
|
+
#. Workers' Day.
|
|
53
45
|
msgid "የሰራተኞች ቀን"
|
|
54
46
|
msgstr "يوم العمال"
|
|
55
47
|
|
|
56
|
-
#. Patriots Day.
|
|
48
|
+
#. Patriots' Day.
|
|
57
49
|
msgid "የአርበኞች ቀን"
|
|
58
50
|
msgstr "يوم الوطنيين"
|
|
59
51
|
|
|
@@ -61,9 +53,21 @@ msgstr "يوم الوطنيين"
|
|
|
61
53
|
msgid "ደርግ የወደቀበት ቀን"
|
|
62
54
|
msgstr "يوم سقوط ديرج"
|
|
63
55
|
|
|
64
|
-
#.
|
|
65
|
-
msgid "
|
|
66
|
-
msgstr "
|
|
56
|
+
#. Ethiopian New Year.
|
|
57
|
+
msgid "እንቁጣጣሽ"
|
|
58
|
+
msgstr "السنة الإثيوبية الجديدة"
|
|
59
|
+
|
|
60
|
+
#. Finding of True Cross.
|
|
61
|
+
msgid "መስቀል"
|
|
62
|
+
msgstr "مسكل"
|
|
63
|
+
|
|
64
|
+
#. Revolution Day.
|
|
65
|
+
msgid "የአብዮት ቀን"
|
|
66
|
+
msgstr "يوم الثورة"
|
|
67
|
+
|
|
68
|
+
#. October Revolution Day.
|
|
69
|
+
msgid "የጥቅምት አብዮት ቀን"
|
|
70
|
+
msgstr "يوم ثورة أكتوبر"
|
|
67
71
|
|
|
68
72
|
#. Eid al-Fitr.
|
|
69
73
|
msgid "ኢድ አልፈጥር"
|
|
Binary file
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Authors: ~Jhellico <jhellico@gmail.com>, (c) 2023.
|
|
3
3
|
msgid ""
|
|
4
4
|
msgstr ""
|
|
5
|
-
"Project-Id-Version: Python Holidays 0.
|
|
5
|
+
"Project-Id-Version: Python Holidays 0.42\n"
|
|
6
6
|
"POT-Creation-Date: 2023-04-01 17:13+0300\n"
|
|
7
7
|
"PO-Revision-Date: 2023-04-01 17:15+0300\n"
|
|
8
8
|
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
|
|
@@ -78,3 +78,27 @@ msgstr ""
|
|
|
78
78
|
#. New Year's Eve.
|
|
79
79
|
msgid "Silvester"
|
|
80
80
|
msgstr ""
|
|
81
|
+
|
|
82
|
+
#. St. Martin's Day.
|
|
83
|
+
msgid "Hl. Martin"
|
|
84
|
+
msgstr ""
|
|
85
|
+
|
|
86
|
+
#. St. Joseph's Day.
|
|
87
|
+
msgid "Hl. Josef"
|
|
88
|
+
msgstr ""
|
|
89
|
+
|
|
90
|
+
#. 1920 Carinthian plebiscite.
|
|
91
|
+
msgid "Tag der Volksabstimmung"
|
|
92
|
+
msgstr ""
|
|
93
|
+
|
|
94
|
+
#. St. Leopold's Day.
|
|
95
|
+
msgid "Hl. Leopold"
|
|
96
|
+
msgstr ""
|
|
97
|
+
|
|
98
|
+
#. St. Florian's Day.
|
|
99
|
+
msgid "Hl. Florian"
|
|
100
|
+
msgstr ""
|
|
101
|
+
|
|
102
|
+
#. St. Rupert's Day.
|
|
103
|
+
msgid "Hl. Rupert"
|
|
104
|
+
msgstr ""
|
|
Binary file
|