holidays 0.47__py3-none-any.whl → 0.49__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/calendars/gregorian.py +31 -7
- holidays/calendars/persian.py +3 -2
- holidays/calendars/thai.py +24 -20
- holidays/countries/__init__.py +1 -0
- holidays/countries/angola.py +2 -2
- holidays/countries/aruba.py +2 -3
- holidays/countries/australia.py +1 -3
- holidays/countries/belgium.py +1 -2
- holidays/countries/bolivia.py +1 -2
- holidays/countries/brazil.py +1 -2
- holidays/countries/cambodia.py +7 -8
- holidays/countries/canada.py +2 -1
- holidays/countries/chile.py +6 -6
- holidays/countries/colombia.py +1 -2
- holidays/countries/curacao.py +3 -4
- holidays/countries/cyprus.py +1 -2
- holidays/countries/denmark.py +1 -2
- holidays/countries/finland.py +3 -3
- holidays/countries/france.py +1 -2
- holidays/countries/greece.py +11 -6
- holidays/countries/hongkong.py +398 -133
- holidays/countries/israel.py +13 -13
- holidays/countries/italy.py +2 -4
- holidays/countries/japan.py +17 -6
- holidays/countries/jersey.py +2 -2
- holidays/countries/laos.py +7 -23
- holidays/countries/madagascar.py +2 -3
- holidays/countries/malaysia.py +545 -235
- holidays/countries/moldova.py +1 -2
- holidays/countries/netherlands.py +2 -3
- holidays/countries/new_zealand.py +10 -11
- holidays/countries/palau.py +127 -0
- holidays/countries/portugal.py +2 -6
- holidays/countries/saudi_arabia.py +2 -3
- holidays/countries/south_korea.py +18 -5
- holidays/countries/sweden.py +2 -3
- holidays/countries/switzerland.py +2 -3
- holidays/countries/timor_leste.py +23 -1
- holidays/countries/united_states.py +1 -1
- holidays/countries/uruguay.py +3 -4
- holidays/financial/__init__.py +1 -0
- holidays/financial/ice_futures_europe.py +47 -0
- holidays/financial/ny_stock_exchange.py +17 -4
- holidays/groups/chinese.py +2 -3
- holidays/groups/christian.py +18 -19
- holidays/groups/international.py +10 -0
- holidays/groups/islamic.py +2 -2
- holidays/groups/persian.py +2 -2
- holidays/helpers.py +9 -3
- holidays/holiday_base.py +133 -66
- holidays/locale/en_US/LC_MESSAGES/MY.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MY.po +250 -0
- holidays/locale/ms_MY/LC_MESSAGES/MY.mo +0 -0
- holidays/locale/ms_MY/LC_MESSAGES/MY.po +250 -0
- holidays/mixins.py +31 -0
- holidays/observed_holiday_base.py +25 -13
- holidays/registry.py +2 -0
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/METADATA +29 -21
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/RECORD +64 -57
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/AUTHORS +0 -0
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/LICENSE +0 -0
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/WHEEL +0 -0
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/top_level.txt +0 -0
holidays/countries/moldova.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
15
|
from holidays.calendars.gregorian import GREGORIAN_CALENDAR
|
|
@@ -60,7 +59,7 @@ class Moldova(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
60
59
|
self._add_easter_monday(name)
|
|
61
60
|
|
|
62
61
|
# Day of Rejoicing.
|
|
63
|
-
self.
|
|
62
|
+
self._add_holiday_8_days_past_easter(tr("Paștele blajinilor"))
|
|
64
63
|
|
|
65
64
|
# International Workers' Solidarity Day.
|
|
66
65
|
self._add_labor_day(tr("Ziua internaţională a solidarităţii oamenilor muncii"))
|
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
from gettext import gettext as tr
|
|
16
15
|
|
|
17
|
-
from holidays.calendars.gregorian import APR, AUG
|
|
16
|
+
from holidays.calendars.gregorian import APR, AUG, _timedelta
|
|
18
17
|
from holidays.constants import OPTIONAL, PUBLIC
|
|
19
18
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
20
19
|
from holidays.holiday_base import HolidayBase
|
|
@@ -65,7 +64,7 @@ class Netherlands(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
65
64
|
else:
|
|
66
65
|
dt = date(self._year, AUG, 31)
|
|
67
66
|
if self._is_sunday(dt):
|
|
68
|
-
dt
|
|
67
|
+
dt = _timedelta(dt, -1 if self._year >= 1980 else +1)
|
|
69
68
|
self._add_holiday(name, dt)
|
|
70
69
|
|
|
71
70
|
if self._year >= 1950 and self._year % 5 == 0:
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from
|
|
14
|
+
from typing import Optional
|
|
15
15
|
|
|
16
|
-
from holidays.calendars.gregorian import JAN, FEB, MAR, JUN, JUL, SEP, NOV, DEC
|
|
16
|
+
from holidays.calendars.gregorian import JAN, FEB, MAR, JUN, JUL, SEP, NOV, DEC, _timedelta
|
|
17
17
|
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
18
18
|
from holidays.observed_holiday_base import (
|
|
19
19
|
ObservedHolidayBase,
|
|
@@ -75,7 +75,7 @@ class NewZealand(ObservedHolidayBase, ChristianHolidays, InternationalHolidays,
|
|
|
75
75
|
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
|
|
76
76
|
super().__init__(*args, **kwargs)
|
|
77
77
|
|
|
78
|
-
def _get_nearest_monday(self, *args) -> date:
|
|
78
|
+
def _get_nearest_monday(self, *args) -> Optional[date]:
|
|
79
79
|
dt = args if len(args) > 1 else args[0]
|
|
80
80
|
dt = dt if isinstance(dt, date) else date(self._year, *dt)
|
|
81
81
|
return self._get_observed_date(dt, rule=ALL_TO_NEAREST_MON)
|
|
@@ -243,20 +243,19 @@ class NewZealand(ObservedHolidayBase, ChristianHolidays, InternationalHolidays,
|
|
|
243
243
|
def _populate_subdiv_ota_public_holidays(self):
|
|
244
244
|
# there is no easily determined single day of local observance?!?!
|
|
245
245
|
dt = self._get_nearest_monday(MAR, 23)
|
|
246
|
-
if dt == self._easter_sunday +
|
|
247
|
-
dt
|
|
246
|
+
if dt == _timedelta(self._easter_sunday, +1): # Avoid Easter Monday
|
|
247
|
+
dt = _timedelta(dt, +1)
|
|
248
248
|
self._add_holiday("Otago Anniversary Day", dt)
|
|
249
249
|
|
|
250
250
|
def _populate_subdiv_stc_public_holidays(self):
|
|
251
251
|
self._add_holiday_4th_mon_of_sep("South Canterbury Anniversary Day")
|
|
252
252
|
|
|
253
253
|
def _populate_subdiv_stl_public_holidays(self):
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
self._add_holiday("Southland Anniversary Day", dt)
|
|
254
|
+
name = "Southland Anniversary Day"
|
|
255
|
+
if self._year >= 2012:
|
|
256
|
+
self._add_holiday_2_days_past_easter(name)
|
|
257
|
+
else:
|
|
258
|
+
self._add_holiday(name, self._get_nearest_monday(JAN, 17))
|
|
260
259
|
|
|
261
260
|
def _populate_subdiv_tki_public_holidays(self):
|
|
262
261
|
self._add_holiday_2nd_mon_of_mar("Taranaki Anniversary Day")
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# holidays
|
|
2
|
+
# --------
|
|
3
|
+
# A fast, efficient Python library for generating country, province and state
|
|
4
|
+
# specific sets of holidays on the fly. It aims to make determining whether a
|
|
5
|
+
# specific date is a holiday as fast and flexible as possible.
|
|
6
|
+
#
|
|
7
|
+
# Authors: Vacanza Team and individual contributors (see AUTHORS file)
|
|
8
|
+
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
|
|
9
|
+
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
|
|
10
|
+
# Website: https://github.com/vacanza/python-holidays
|
|
11
|
+
# License: MIT (see LICENSE file)
|
|
12
|
+
|
|
13
|
+
from holidays.calendars.gregorian import SEP, NOV
|
|
14
|
+
from holidays.constants import ARMED_FORCES, HALF_DAY, PUBLIC
|
|
15
|
+
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
16
|
+
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_PREV_FRI, SUN_TO_NEXT_MON
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Palau(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
20
|
+
"""
|
|
21
|
+
References:
|
|
22
|
+
- http://www.paclii.org/pw/legis/consol_act/gpt1262/ # Chapter 7, Holidays.
|
|
23
|
+
- https://www.palaugov.pw/wp-content/uploads/2017/11/RPPL-No.-10-15-re.-Family-Day-Holiday.pdf
|
|
24
|
+
- https://www.facebook.com/PalauPresident/posts/195883107230463 # EO336 Memorial Day repealed
|
|
25
|
+
- https://www.taiwanembassy.org/pal_en/post/792.html # Earliest source for President's Day
|
|
26
|
+
|
|
27
|
+
If any of the holidays enumerated in section 701 of this chapter falls on Sunday, the
|
|
28
|
+
following Monday shall be observed as a holiday. If any of the holidays enumerated in
|
|
29
|
+
section 701 of this chapter falls on Saturday, the preceding Friday shall be observed
|
|
30
|
+
as a holiday.
|
|
31
|
+
|
|
32
|
+
As there's no record of President's Day (Jun 1) and Independence Day (Oct 1) being
|
|
33
|
+
legal holiday before 2017, as seen in RPRL 10-15, they shall be assumed to start in 2018
|
|
34
|
+
for our current implementation.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
country = "PW"
|
|
38
|
+
supported_categories = (ARMED_FORCES, HALF_DAY, PUBLIC)
|
|
39
|
+
observed_label = "%s (observed)"
|
|
40
|
+
|
|
41
|
+
def __init__(self, *args, **kwargs):
|
|
42
|
+
ChristianHolidays.__init__(self)
|
|
43
|
+
InternationalHolidays.__init__(self)
|
|
44
|
+
StaticHolidays.__init__(self, PalauStaticHolidays)
|
|
45
|
+
kwargs.setdefault("observed_rule", SAT_TO_PREV_FRI + SUN_TO_NEXT_MON)
|
|
46
|
+
super().__init__(*args, **kwargs)
|
|
47
|
+
|
|
48
|
+
def _populate_public_holidays(self):
|
|
49
|
+
# Republic of Palau Public Law No. 2-15.
|
|
50
|
+
# The legislation was first adopted by the 2nd Olbiil Era Kelulau (1984-1988),
|
|
51
|
+
# but since we cannot find any info on its actual adoption date, we may as
|
|
52
|
+
# well use the formation date of the country as the placeholder cut-off date.
|
|
53
|
+
if self._year <= 1980:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
# Fixed Date Public Holidays.
|
|
57
|
+
|
|
58
|
+
# New Year's Day.
|
|
59
|
+
name = "New Year's Day"
|
|
60
|
+
self._add_observed(self._add_new_years_day(name))
|
|
61
|
+
self._add_observed(self._next_year_new_years_day, name=name, rule=SAT_TO_PREV_FRI)
|
|
62
|
+
|
|
63
|
+
# Youth Day.
|
|
64
|
+
self._add_observed(self._add_holiday_mar_15("Youth Day"))
|
|
65
|
+
|
|
66
|
+
# Senior Citizens Day.
|
|
67
|
+
self._add_observed(self._add_holiday_may_5("Senior Citizens Day"))
|
|
68
|
+
|
|
69
|
+
if self._year in {2011, 2012}:
|
|
70
|
+
# Memorial Day.
|
|
71
|
+
self._add_holiday_last_mon_of_may("Memorial Day")
|
|
72
|
+
|
|
73
|
+
if self._year >= 2018:
|
|
74
|
+
# President's Day.
|
|
75
|
+
self._add_observed(self._add_holiday_jun_1("President's Day"))
|
|
76
|
+
|
|
77
|
+
# Constitution Day.
|
|
78
|
+
self._add_observed(self._add_holiday_jul_9("Constitution Day"))
|
|
79
|
+
|
|
80
|
+
# Labor Day.
|
|
81
|
+
self._add_holiday_1st_mon_of_sep("Labor Day")
|
|
82
|
+
|
|
83
|
+
if self._year >= 2018:
|
|
84
|
+
# Independence Day.
|
|
85
|
+
self._add_observed(self._add_holiday_oct_1("Independence Day"))
|
|
86
|
+
|
|
87
|
+
# United Nations Day.
|
|
88
|
+
self._add_observed(self._add_united_nations_day("United Nations Day"))
|
|
89
|
+
|
|
90
|
+
# Thanksgiving Day.
|
|
91
|
+
self._add_holiday_4th_thu_of_nov("Thanksgiving Day")
|
|
92
|
+
|
|
93
|
+
if self._year >= 2017:
|
|
94
|
+
# Family Day.
|
|
95
|
+
self._add_holiday_4th_fri_of_nov("Family Day")
|
|
96
|
+
|
|
97
|
+
# Christmas Day.
|
|
98
|
+
self._add_observed(self._add_christmas_day("Christmas Day"))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class PW(Palau):
|
|
102
|
+
pass
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class PLW(Palau):
|
|
106
|
+
pass
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class PalauStaticHolidays:
|
|
110
|
+
"""
|
|
111
|
+
Sources:
|
|
112
|
+
- https://www.facebook.com/photo?fbid=1774513196034105&set=a.175933635892077
|
|
113
|
+
- https://www.facebook.com/photo/?fbid=1794692910682800&set=a.175933635892077
|
|
114
|
+
- https://www.facebook.com/photo/?fbid=1408133829338712&set=a.175933635892077
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
special_armed_forces_holidays = {
|
|
118
|
+
2020: (NOV, 11, "Veterans Day"),
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
special_half_day_holidays = {
|
|
122
|
+
2019: (SEP, 30, "Preparation for the 25th Independence Day of the Republic of Palau"),
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
special_public_holidays = {
|
|
126
|
+
2020: (NOV, 3, "National Day of Democracy"),
|
|
127
|
+
}
|
holidays/countries/portugal.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
15
|
from holidays.constants import OPTIONAL, PUBLIC
|
|
@@ -184,11 +183,8 @@ class Portugal(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
184
183
|
self._add_holiday_aug_22(tr("Dia de Nossa Senhora das Graças"))
|
|
185
184
|
|
|
186
185
|
def _populate_subdiv_05_public_holidays(self):
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
tr("Dia de Nossa Senhora de Mércoles"),
|
|
190
|
-
self._easter_sunday + td(days=+16),
|
|
191
|
-
)
|
|
186
|
+
# Feast of Our Lady of Mércoles.
|
|
187
|
+
self._add_holiday_16_days_past_easter(tr("Dia de Nossa Senhora de Mércoles"))
|
|
192
188
|
|
|
193
189
|
def _populate_subdiv_06_public_holidays(self):
|
|
194
190
|
# St. Elizabeth's Day.
|
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
from gettext import gettext as tr
|
|
16
15
|
from typing import Set
|
|
17
16
|
|
|
18
|
-
from holidays.calendars.gregorian import JAN, FEB, SEP, NOV, THU, FRI, SAT
|
|
17
|
+
from holidays.calendars.gregorian import JAN, FEB, SEP, NOV, THU, FRI, SAT, _timedelta
|
|
19
18
|
from holidays.groups import IslamicHolidays, StaticHolidays
|
|
20
19
|
from holidays.observed_holiday_base import (
|
|
21
20
|
ObservedHolidayBase,
|
|
@@ -67,7 +66,7 @@ class SaudiArabia(ObservedHolidayBase, IslamicHolidays, StaticHolidays):
|
|
|
67
66
|
observed_rule = THU_FRI_TO_NEXT_WORKDAY if self._year <= 2012 else FRI_SAT_TO_NEXT_WORKDAY
|
|
68
67
|
for dt in dts:
|
|
69
68
|
for i in range(4):
|
|
70
|
-
self._add_observed(dt
|
|
69
|
+
self._add_observed(_timedelta(dt, -i), name=self[dt], rule=observed_rule)
|
|
71
70
|
|
|
72
71
|
def _populate_public_holidays(self):
|
|
73
72
|
# Weekend used to be THU, FRI before June 28th, 2013.
|
|
@@ -12,12 +12,25 @@
|
|
|
12
12
|
|
|
13
13
|
import warnings
|
|
14
14
|
from datetime import date
|
|
15
|
-
from datetime import timedelta as td
|
|
16
15
|
from gettext import gettext as tr
|
|
17
16
|
from typing import Dict, Set
|
|
18
17
|
|
|
19
18
|
from holidays.calendars import _CustomChineseHolidays
|
|
20
|
-
from holidays.calendars.gregorian import
|
|
19
|
+
from holidays.calendars.gregorian import (
|
|
20
|
+
JAN,
|
|
21
|
+
FEB,
|
|
22
|
+
MAR,
|
|
23
|
+
APR,
|
|
24
|
+
MAY,
|
|
25
|
+
JUN,
|
|
26
|
+
JUL,
|
|
27
|
+
AUG,
|
|
28
|
+
SEP,
|
|
29
|
+
OCT,
|
|
30
|
+
NOV,
|
|
31
|
+
DEC,
|
|
32
|
+
_timedelta,
|
|
33
|
+
)
|
|
21
34
|
from holidays.constants import BANK, PUBLIC
|
|
22
35
|
from holidays.groups import (
|
|
23
36
|
ChineseCalendarHolidays,
|
|
@@ -115,10 +128,10 @@ class SouthKorea(
|
|
|
115
128
|
name = self.tr(name)
|
|
116
129
|
for dt_alt in (
|
|
117
130
|
# The day preceding %s.
|
|
118
|
-
self._add_holiday(self.tr("%s 전날") % name, dt
|
|
131
|
+
self._add_holiday(self.tr("%s 전날") % name, _timedelta(dt, -1)),
|
|
119
132
|
dt,
|
|
120
133
|
# The second day of %s.
|
|
121
|
-
self._add_holiday(self.tr("%s 다음날") % name, dt +
|
|
134
|
+
self._add_holiday(self.tr("%s 다음날") % name, _timedelta(dt, +1)),
|
|
122
135
|
):
|
|
123
136
|
three_days_holidays[dt_alt] = name
|
|
124
137
|
|
|
@@ -198,7 +211,7 @@ class SouthKorea(
|
|
|
198
211
|
|
|
199
212
|
if 1950 <= self._year <= 1975:
|
|
200
213
|
# United Nations Day.
|
|
201
|
-
self.
|
|
214
|
+
self._add_united_nations_day(tr("국제연합일"))
|
|
202
215
|
|
|
203
216
|
# Chuseok.
|
|
204
217
|
name = tr("추석")
|
holidays/countries/sweden.py
CHANGED
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
|
-
from holidays.calendars.gregorian import _get_all_sundays
|
|
15
|
+
from holidays.calendars.gregorian import _timedelta, _get_all_sundays
|
|
17
16
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
18
17
|
from holidays.holiday_base import HolidayBase
|
|
19
18
|
|
|
@@ -101,7 +100,7 @@ class Sweden(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
101
100
|
)
|
|
102
101
|
|
|
103
102
|
# Midsummer Day.
|
|
104
|
-
self._add_holiday(tr("Midsommardagen"), dt +
|
|
103
|
+
self._add_holiday(tr("Midsommardagen"), _timedelta(dt, +1))
|
|
105
104
|
|
|
106
105
|
# All Saints' Day.
|
|
107
106
|
self._add_holiday_1st_sat_from_oct_31(tr("Alla helgons dag"))
|
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
|
-
from holidays.calendars.gregorian import APR, THU, _get_nth_weekday_of_month
|
|
15
|
+
from holidays.calendars.gregorian import APR, THU, _timedelta, _get_nth_weekday_of_month
|
|
17
16
|
from holidays.constants import HALF_DAY, OPTIONAL, PUBLIC
|
|
18
17
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
19
18
|
from holidays.holiday_base import HolidayBase
|
|
@@ -202,7 +201,7 @@ class Switzerland(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
202
201
|
self._add_holiday(
|
|
203
202
|
# Battle of Naefels Victory Day.
|
|
204
203
|
tr("Näfelser Fahrt"),
|
|
205
|
-
dt +
|
|
204
|
+
_timedelta(dt, +7) if dt == _timedelta(self._easter_sunday, -3) else dt,
|
|
206
205
|
)
|
|
207
206
|
|
|
208
207
|
self._add_good_friday(tr("Karfreitag"))
|
|
@@ -31,10 +31,11 @@ class TimorLeste(
|
|
|
31
31
|
References:
|
|
32
32
|
- https://mj.gov.tl/jornal/lawsTL/RDTL-Law/RDTL-Laws/Law-2005-10.pdf # 2005 Law
|
|
33
33
|
- http://timor-leste.gov.tl/?p=14494&lang=en # 2016 Amendment
|
|
34
|
+
- http://timor-leste.gov.tl/?p=30266&lang=en # 2022
|
|
34
35
|
- http://timor-leste.gov.tl/?p=31750&lang=en # 2023 (en_US)
|
|
35
36
|
- http://timor-leste.gov.tl/?p=31750&lang=pt # 2023 (pt_PT)
|
|
36
37
|
- http://timor-leste.gov.tl/?p=31750&lang=tp # 2023 (tet)
|
|
37
|
-
- http://timor-leste.gov.tl/?p=
|
|
38
|
+
- http://timor-leste.gov.tl/?p=35833&lang=en # 2024
|
|
38
39
|
|
|
39
40
|
Limitations:
|
|
40
41
|
|
|
@@ -201,6 +202,7 @@ class TimorLesteIslamicHolidays(_CustomIslamicHolidays):
|
|
|
201
202
|
2021: (JUL, 19),
|
|
202
203
|
2022: (JUL, 9),
|
|
203
204
|
2023: (JUN, 29),
|
|
205
|
+
2024: (JUN, 17),
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
EID_AL_FITR_DATES = {
|
|
@@ -396,20 +398,28 @@ class TimorLesteStaticHolidays:
|
|
|
396
398
|
(JAN, 2, special_national_holidays),
|
|
397
399
|
# http://timor-leste.gov.tl/?p=23607&lang=en
|
|
398
400
|
(FEB, 26, special_national_holidays),
|
|
401
|
+
# http://timor-leste.gov.tl/?p=25455&lang=en
|
|
402
|
+
(AUG, 20, special_national_holidays),
|
|
399
403
|
# http://timor-leste.gov.tl/?p=25502&lang=en
|
|
400
404
|
(AUG, 31, special_national_holidays),
|
|
401
405
|
# http://timor-leste.gov.tl/?p=26030&lang=en
|
|
402
406
|
(NOV, 3, special_national_holidays),
|
|
407
|
+
# http://timor-leste.gov.tl/?p=26365&lang=en
|
|
408
|
+
(DEC, 24, special_national_holidays),
|
|
403
409
|
),
|
|
404
410
|
2021: (
|
|
405
411
|
# http://timor-leste.gov.tl/?p=26865&lang=en
|
|
406
412
|
(FEB, 12, special_national_holidays),
|
|
413
|
+
# http://timor-leste.gov.tl/?p=26896&lang=en
|
|
414
|
+
(FEB, 17, special_national_holidays),
|
|
407
415
|
# http://timor-leste.gov.tl/?p=29682&lang=en
|
|
408
416
|
(NOV, 3, special_national_holidays),
|
|
409
417
|
),
|
|
410
418
|
2022: (
|
|
411
419
|
# http://timor-leste.gov.tl/?p=30029&lang=en
|
|
412
420
|
(FEB, 1, special_national_holidays),
|
|
421
|
+
# http://timor-leste.gov.tl/?p=30194&lang=en
|
|
422
|
+
(MAR, 2, special_national_holidays),
|
|
413
423
|
# http://timor-leste.gov.tl/?p=30254&lang=en
|
|
414
424
|
(MAR, 18, presidential_election),
|
|
415
425
|
# http://timor-leste.gov.tl/?p=30429&lang=en
|
|
@@ -417,11 +427,23 @@ class TimorLesteStaticHolidays:
|
|
|
417
427
|
(APR, 18, presidential_election),
|
|
418
428
|
(APR, 19, presidential_election),
|
|
419
429
|
(APR, 20, presidential_election),
|
|
430
|
+
# http://timor-leste.gov.tl/?p=31404&lang=en
|
|
431
|
+
(OCT, 31, special_national_holidays),
|
|
432
|
+
# http://timor-leste.gov.tl/?p=31574&lang=en
|
|
433
|
+
(DEC, 9, special_national_holidays),
|
|
434
|
+
# http://timor-leste.gov.tl/?p=31633&lang=en
|
|
435
|
+
(DEC, 26, special_national_holidays),
|
|
420
436
|
),
|
|
421
437
|
2023: (
|
|
422
438
|
# http://timor-leste.gov.tl/?p=31641&lang=en
|
|
423
439
|
(JAN, 2, special_national_holidays),
|
|
424
440
|
# http://timor-leste.gov.tl/?p=31798&lang=en
|
|
425
441
|
(JAN, 23, special_national_holidays),
|
|
442
|
+
# http://timor-leste.gov.tl/?p=32191&lang=en
|
|
443
|
+
(FEB, 22, special_national_holidays),
|
|
444
|
+
),
|
|
445
|
+
2024: (
|
|
446
|
+
# http://timor-leste.gov.tl/?p=36002&lang=en
|
|
447
|
+
(FEB, 14, special_national_holidays),
|
|
426
448
|
),
|
|
427
449
|
}
|
|
@@ -609,7 +609,7 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
609
609
|
|
|
610
610
|
# Confederate Memorial Day
|
|
611
611
|
if self._year >= 1866:
|
|
612
|
-
self.
|
|
612
|
+
self._add_holiday_last_mon_of_apr("Confederate Memorial Day")
|
|
613
613
|
|
|
614
614
|
def _populate_subdiv_mt_public_holidays(self):
|
|
615
615
|
# Election Day
|
holidays/countries/uruguay.py
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
from gettext import gettext as tr
|
|
16
15
|
|
|
17
16
|
from holidays.calendars.gregorian import MAR
|
|
@@ -123,9 +122,9 @@ class Uruguay(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
|
|
|
123
122
|
|
|
124
123
|
# Tourism Week.
|
|
125
124
|
name = tr("Semana de Turismo")
|
|
126
|
-
self.
|
|
127
|
-
self.
|
|
128
|
-
self.
|
|
125
|
+
self._add_holiday_6_days_prior_easter(name)
|
|
126
|
+
self._add_holiday_5_days_prior_easter(name)
|
|
127
|
+
self._add_holiday_4_days_prior_easter(name)
|
|
129
128
|
self._add_holy_thursday(name)
|
|
130
129
|
self._add_good_friday(name)
|
|
131
130
|
|
holidays/financial/__init__.py
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# holidays
|
|
2
|
+
# --------
|
|
3
|
+
# A fast, efficient Python library for generating country, province and state
|
|
4
|
+
# specific sets of holidays on the fly. It aims to make determining whether a
|
|
5
|
+
# specific date is a holiday as fast and flexible as possible.
|
|
6
|
+
#
|
|
7
|
+
# Authors: Vacanza Team and individual contributors (see AUTHORS file)
|
|
8
|
+
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
|
|
9
|
+
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
|
|
10
|
+
# Website: https://github.com/vacanza/python-holidays
|
|
11
|
+
# License: MIT (see LICENSE file)
|
|
12
|
+
|
|
13
|
+
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
14
|
+
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_NONE, SUN_TO_NEXT_MON
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ICEFuturesEurope(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
18
|
+
"""
|
|
19
|
+
References:
|
|
20
|
+
- https://www.ice.com/publicdocs/futures/Trading_Schedule_Migrated_Liffe_Contracts.pdf
|
|
21
|
+
- https://www.ice.com/publicdocs/Trading_Schedule.pdf
|
|
22
|
+
- https://web.archive.org/web/20230927015846/https://www.ice.com/publicdocs/Trading_Schedule.pdf
|
|
23
|
+
- https://web.archive.org/web/20211022183728/https://www.ice.com/publicdocs/Trading_Schedule.pdf
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
market = "IFEU"
|
|
27
|
+
|
|
28
|
+
def __init__(self, *args, **kwargs):
|
|
29
|
+
ChristianHolidays.__init__(self)
|
|
30
|
+
InternationalHolidays.__init__(self)
|
|
31
|
+
kwargs.setdefault("observed_rule", SAT_TO_NONE + SUN_TO_NEXT_MON)
|
|
32
|
+
super().__init__(*args, **kwargs)
|
|
33
|
+
|
|
34
|
+
def _populate(self, year):
|
|
35
|
+
if year <= 2013:
|
|
36
|
+
return None
|
|
37
|
+
super()._populate(year)
|
|
38
|
+
|
|
39
|
+
self._move_holiday(self._add_new_years_day("New Year's Day"))
|
|
40
|
+
|
|
41
|
+
self._add_good_friday("Good Friday")
|
|
42
|
+
|
|
43
|
+
self._move_holiday(self._add_christmas_day("Christmas Day"))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class IFEU(ICEFuturesEurope):
|
|
47
|
+
pass
|
|
@@ -11,9 +11,22 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
|
|
16
|
-
from holidays.calendars.gregorian import
|
|
15
|
+
from holidays.calendars.gregorian import (
|
|
16
|
+
JAN,
|
|
17
|
+
FEB,
|
|
18
|
+
MAR,
|
|
19
|
+
APR,
|
|
20
|
+
MAY,
|
|
21
|
+
JUN,
|
|
22
|
+
JUL,
|
|
23
|
+
AUG,
|
|
24
|
+
SEP,
|
|
25
|
+
OCT,
|
|
26
|
+
NOV,
|
|
27
|
+
DEC,
|
|
28
|
+
_timedelta,
|
|
29
|
+
)
|
|
17
30
|
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
18
31
|
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_PREV_FRI, SUN_TO_NEXT_MON
|
|
19
32
|
|
|
@@ -114,7 +127,7 @@ class NewYorkStockExchange(
|
|
|
114
127
|
# Beginning of WWI.
|
|
115
128
|
begin = date(year, JUL, 31)
|
|
116
129
|
end = date(year, NOV, 27)
|
|
117
|
-
for dt in (begin
|
|
130
|
+
for dt in (_timedelta(begin, n) for n in range((end - begin).days + 1)):
|
|
118
131
|
if self._is_weekend(dt) or dt in self:
|
|
119
132
|
continue
|
|
120
133
|
self._add_holiday("World War I", dt)
|
|
@@ -122,7 +135,7 @@ class NewYorkStockExchange(
|
|
|
122
135
|
begin = date(year, JUN, 12)
|
|
123
136
|
end = date(year, DEC, 24)
|
|
124
137
|
# Wednesday special holiday.
|
|
125
|
-
for dt in (begin
|
|
138
|
+
for dt in (_timedelta(begin, n) for n in range(0, (end - begin).days + 1, 7)):
|
|
126
139
|
self._add_holiday("Paper Crisis", dt)
|
|
127
140
|
|
|
128
141
|
|
holidays/groups/chinese.py
CHANGED
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
from typing import Optional, Tuple
|
|
16
15
|
|
|
17
16
|
from holidays.calendars import _ChineseLunisolar
|
|
18
|
-
from holidays.calendars.gregorian import APR
|
|
17
|
+
from holidays.calendars.gregorian import APR, _timedelta
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
class ChineseCalendarHolidays:
|
|
@@ -61,7 +60,7 @@ class ChineseCalendarHolidays:
|
|
|
61
60
|
dt, is_estimated = dt_estimated
|
|
62
61
|
|
|
63
62
|
if days_delta != 0:
|
|
64
|
-
dt
|
|
63
|
+
dt = _timedelta(dt, days_delta)
|
|
65
64
|
|
|
66
65
|
return self._add_holiday(
|
|
67
66
|
self.tr(estimated_label) % self.tr(name)
|