pandas-market-calendars 4.3.3__py3-none-any.whl → 4.6.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pandas_market_calendars/__init__.py +39 -38
- pandas_market_calendars/calendar_registry.py +57 -53
- pandas_market_calendars/calendar_utils.py +1200 -261
- pandas_market_calendars/calendars/asx.py +66 -66
- pandas_market_calendars/calendars/bmf.py +223 -206
- pandas_market_calendars/calendars/bse.py +421 -407
- pandas_market_calendars/calendars/cboe.py +145 -145
- pandas_market_calendars/calendars/cme.py +405 -402
- pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -126
- pandas_market_calendars/calendars/cme_globex_base.py +119 -119
- pandas_market_calendars/calendars/cme_globex_crypto.py +160 -160
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
- pandas_market_calendars/calendars/cme_globex_equities.py +123 -123
- pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -136
- pandas_market_calendars/calendars/cme_globex_fx.py +101 -101
- pandas_market_calendars/calendars/eurex.py +131 -139
- pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
- pandas_market_calendars/calendars/hkex.py +429 -426
- pandas_market_calendars/calendars/ice.py +81 -81
- pandas_market_calendars/calendars/iex.py +151 -112
- pandas_market_calendars/calendars/jpx.py +113 -109
- pandas_market_calendars/calendars/lse.py +114 -114
- pandas_market_calendars/calendars/mirror.py +149 -130
- pandas_market_calendars/calendars/nyse.py +1466 -1324
- pandas_market_calendars/calendars/ose.py +116 -116
- pandas_market_calendars/calendars/sifma.py +354 -350
- pandas_market_calendars/calendars/six.py +132 -132
- pandas_market_calendars/calendars/sse.py +311 -311
- pandas_market_calendars/calendars/tase.py +220 -197
- pandas_market_calendars/calendars/tsx.py +181 -181
- pandas_market_calendars/holidays/cme.py +385 -385
- pandas_market_calendars/holidays/cme_globex.py +214 -214
- pandas_market_calendars/holidays/cn.py +1476 -1455
- pandas_market_calendars/holidays/jp.py +401 -398
- pandas_market_calendars/holidays/jpx_equinox.py +1 -0
- pandas_market_calendars/holidays/nyse.py +1536 -1531
- pandas_market_calendars/holidays/oz.py +63 -63
- pandas_market_calendars/holidays/sifma.py +350 -338
- pandas_market_calendars/holidays/us.py +376 -376
- pandas_market_calendars/market_calendar.py +1057 -895
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/METADATA +13 -9
- pandas_market_calendars-4.6.0.dist-info/RECORD +50 -0
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/WHEEL +1 -1
- pandas_market_calendars-4.3.3.dist-info/RECORD +0 -50
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/LICENSE +0 -0
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/NOTICE +0 -0
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/top_level.txt +0 -0
@@ -1,338 +1,350 @@
|
|
1
|
-
from dateutil.relativedelta import MO, TH
|
2
|
-
from pandas import DateOffset, Timestamp
|
3
|
-
from pandas.tseries.holiday import (
|
4
|
-
Holiday,
|
5
|
-
nearest_workday,
|
6
|
-
next_monday,
|
7
|
-
sunday_to_monday,
|
8
|
-
previous_workday,
|
9
|
-
Easter,
|
10
|
-
)
|
11
|
-
from pandas.tseries.offsets import Day
|
12
|
-
|
13
|
-
from pandas_market_calendars.market_calendar import (
|
14
|
-
MONDAY,
|
15
|
-
TUESDAY,
|
16
|
-
WEDNESDAY,
|
17
|
-
THURSDAY,
|
18
|
-
FRIDAY,
|
19
|
-
)
|
20
|
-
|
21
|
-
####################################################
|
22
|
-
# US New Years Day Jan 1
|
23
|
-
# When Jan 1 is a Sunday, US markets observe the subsequent Monday.
|
24
|
-
# When Jan 1 is a Saturday (as in 2005 and 2011), no holiday is observed.
|
25
|
-
#####################################################
|
26
|
-
USNewYearsDay = Holiday(
|
27
|
-
"New Years Day US",
|
28
|
-
month=1,
|
29
|
-
day=1,
|
30
|
-
days_of_week=(
|
31
|
-
MONDAY,
|
32
|
-
TUESDAY,
|
33
|
-
WEDNESDAY,
|
34
|
-
THURSDAY,
|
35
|
-
FRIDAY,
|
36
|
-
),
|
37
|
-
observance=sunday_to_monday,
|
38
|
-
)
|
39
|
-
|
40
|
-
USNewYearsEve2pmEarlyClose = Holiday(
|
41
|
-
"New Years Eve US",
|
42
|
-
month=1,
|
43
|
-
day=1,
|
44
|
-
days_of_week=(
|
45
|
-
MONDAY,
|
46
|
-
TUESDAY,
|
47
|
-
WEDNESDAY,
|
48
|
-
THURSDAY,
|
49
|
-
FRIDAY,
|
50
|
-
),
|
51
|
-
observance=previous_workday,
|
52
|
-
)
|
53
|
-
|
54
|
-
#########################################################################
|
55
|
-
# Martin Luther King Jr
|
56
|
-
##########################################################################
|
57
|
-
MartinLutherKingJr = Holiday(
|
58
|
-
"Dr. Martin Luther King Jr. Day",
|
59
|
-
month=1,
|
60
|
-
day=1,
|
61
|
-
days_of_week=(
|
62
|
-
MONDAY,
|
63
|
-
TUESDAY,
|
64
|
-
WEDNESDAY,
|
65
|
-
THURSDAY,
|
66
|
-
FRIDAY,
|
67
|
-
),
|
68
|
-
offset=DateOffset(weekday=MO(3)),
|
69
|
-
)
|
70
|
-
|
71
|
-
#########################################################################
|
72
|
-
# US Presidents Day Feb
|
73
|
-
##########################################################################
|
74
|
-
USPresidentsDay = Holiday(
|
75
|
-
"President" "s Day",
|
76
|
-
start_date=Timestamp("1971-01-01"),
|
77
|
-
month=2,
|
78
|
-
day=1,
|
79
|
-
days_of_week=(
|
80
|
-
MONDAY,
|
81
|
-
TUESDAY,
|
82
|
-
WEDNESDAY,
|
83
|
-
THURSDAY,
|
84
|
-
FRIDAY,
|
85
|
-
),
|
86
|
-
offset=DateOffset(weekday=MO(3)),
|
87
|
-
)
|
88
|
-
|
89
|
-
############################################################
|
90
|
-
# Good Friday
|
91
|
-
############################################################
|
92
|
-
GoodFridayThru2020 = Holiday(
|
93
|
-
"Good Friday 1908+",
|
94
|
-
end_date=Timestamp("2020-12-31"),
|
95
|
-
month=1,
|
96
|
-
day=1,
|
97
|
-
offset=[Easter(), Day(-2)],
|
98
|
-
)
|
99
|
-
|
100
|
-
# 2021 is early close.
|
101
|
-
# 2022 is a full holiday.
|
102
|
-
# 2023 is early close.
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
#################################################
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
)
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
"
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
#
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
#
|
271
|
-
|
272
|
-
"
|
273
|
-
month=
|
274
|
-
day=1,
|
275
|
-
|
276
|
-
)
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
#
|
291
|
-
|
292
|
-
"
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
)
|
297
|
-
|
298
|
-
|
299
|
-
#
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
1
|
+
from dateutil.relativedelta import MO, TH
|
2
|
+
from pandas import DateOffset, Timestamp
|
3
|
+
from pandas.tseries.holiday import (
|
4
|
+
Holiday,
|
5
|
+
nearest_workday,
|
6
|
+
next_monday,
|
7
|
+
sunday_to_monday,
|
8
|
+
previous_workday,
|
9
|
+
Easter,
|
10
|
+
)
|
11
|
+
from pandas.tseries.offsets import Day
|
12
|
+
|
13
|
+
from pandas_market_calendars.market_calendar import (
|
14
|
+
MONDAY,
|
15
|
+
TUESDAY,
|
16
|
+
WEDNESDAY,
|
17
|
+
THURSDAY,
|
18
|
+
FRIDAY,
|
19
|
+
)
|
20
|
+
|
21
|
+
####################################################
|
22
|
+
# US New Years Day Jan 1
|
23
|
+
# When Jan 1 is a Sunday, US markets observe the subsequent Monday.
|
24
|
+
# When Jan 1 is a Saturday (as in 2005 and 2011), no holiday is observed.
|
25
|
+
#####################################################
|
26
|
+
USNewYearsDay = Holiday(
|
27
|
+
"New Years Day US",
|
28
|
+
month=1,
|
29
|
+
day=1,
|
30
|
+
days_of_week=(
|
31
|
+
MONDAY,
|
32
|
+
TUESDAY,
|
33
|
+
WEDNESDAY,
|
34
|
+
THURSDAY,
|
35
|
+
FRIDAY,
|
36
|
+
),
|
37
|
+
observance=sunday_to_monday,
|
38
|
+
)
|
39
|
+
|
40
|
+
USNewYearsEve2pmEarlyClose = Holiday(
|
41
|
+
"New Years Eve US",
|
42
|
+
month=1,
|
43
|
+
day=1,
|
44
|
+
days_of_week=(
|
45
|
+
MONDAY,
|
46
|
+
TUESDAY,
|
47
|
+
WEDNESDAY,
|
48
|
+
THURSDAY,
|
49
|
+
FRIDAY,
|
50
|
+
),
|
51
|
+
observance=previous_workday,
|
52
|
+
)
|
53
|
+
|
54
|
+
#########################################################################
|
55
|
+
# Martin Luther King Jr
|
56
|
+
##########################################################################
|
57
|
+
MartinLutherKingJr = Holiday(
|
58
|
+
"Dr. Martin Luther King Jr. Day",
|
59
|
+
month=1,
|
60
|
+
day=1,
|
61
|
+
days_of_week=(
|
62
|
+
MONDAY,
|
63
|
+
TUESDAY,
|
64
|
+
WEDNESDAY,
|
65
|
+
THURSDAY,
|
66
|
+
FRIDAY,
|
67
|
+
),
|
68
|
+
offset=DateOffset(weekday=MO(3)),
|
69
|
+
)
|
70
|
+
|
71
|
+
#########################################################################
|
72
|
+
# US Presidents Day Feb
|
73
|
+
##########################################################################
|
74
|
+
USPresidentsDay = Holiday(
|
75
|
+
"President" "s Day",
|
76
|
+
start_date=Timestamp("1971-01-01"),
|
77
|
+
month=2,
|
78
|
+
day=1,
|
79
|
+
days_of_week=(
|
80
|
+
MONDAY,
|
81
|
+
TUESDAY,
|
82
|
+
WEDNESDAY,
|
83
|
+
THURSDAY,
|
84
|
+
FRIDAY,
|
85
|
+
),
|
86
|
+
offset=DateOffset(weekday=MO(3)),
|
87
|
+
)
|
88
|
+
|
89
|
+
############################################################
|
90
|
+
# Good Friday
|
91
|
+
############################################################
|
92
|
+
GoodFridayThru2020 = Holiday(
|
93
|
+
"Good Friday 1908+",
|
94
|
+
end_date=Timestamp("2020-12-31"),
|
95
|
+
month=1,
|
96
|
+
day=1,
|
97
|
+
offset=[Easter(), Day(-2)],
|
98
|
+
)
|
99
|
+
|
100
|
+
# 2021 is early close.
|
101
|
+
# 2022 is a full holiday.
|
102
|
+
# 2023 is early close.
|
103
|
+
# 2024 is a full holiday
|
104
|
+
GoodFridayAdHoc = [
|
105
|
+
Timestamp("2022-04-15", tz="UTC"),
|
106
|
+
Timestamp("2024-03-29", tz="UTC"),
|
107
|
+
]
|
108
|
+
|
109
|
+
GoodFriday2pmEarlyCloseAdHoc = [
|
110
|
+
Timestamp("2021-04-02", tz="UTC"),
|
111
|
+
Timestamp("2023-04-07", tz="UTC"),
|
112
|
+
]
|
113
|
+
|
114
|
+
DayBeforeGoodFriday2pmEarlyCloseThru2020 = Holiday(
|
115
|
+
"Day Before Good Friday Thru 2020",
|
116
|
+
end_date=Timestamp("2020-12-31"),
|
117
|
+
month=1,
|
118
|
+
day=1,
|
119
|
+
offset=[Easter(), Day(-3)],
|
120
|
+
)
|
121
|
+
|
122
|
+
DayBeforeGoodFriday2pmEarlyCloseAdHoc = [
|
123
|
+
Timestamp("2022-04-14", tz="UTC"),
|
124
|
+
Timestamp("2024-03-28", tz="UTC"),
|
125
|
+
]
|
126
|
+
|
127
|
+
##################################################
|
128
|
+
# US Memorial Day (Decoration Day) May 30
|
129
|
+
# Closed every year since 1873
|
130
|
+
# Observed on Monday since 1971
|
131
|
+
##################################################
|
132
|
+
USMemorialDay = Holiday(
|
133
|
+
"Memorial Day",
|
134
|
+
month=5,
|
135
|
+
day=25,
|
136
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
137
|
+
offset=DateOffset(weekday=MO(1)),
|
138
|
+
)
|
139
|
+
|
140
|
+
DayBeforeUSMemorialDay2pmEarlyClose = Holiday(
|
141
|
+
"Day Before Memorial Day",
|
142
|
+
month=5,
|
143
|
+
day=25,
|
144
|
+
offset=[DateOffset(weekday=MO(1)), Day(-3)],
|
145
|
+
)
|
146
|
+
|
147
|
+
#######################################
|
148
|
+
# US Juneteenth (June 19th)
|
149
|
+
#######################################
|
150
|
+
USJuneteenthAfter2022 = Holiday(
|
151
|
+
"Juneteenth Starting at 2022",
|
152
|
+
start_date=Timestamp("2022-06-19"),
|
153
|
+
month=6,
|
154
|
+
day=19,
|
155
|
+
observance=nearest_workday,
|
156
|
+
)
|
157
|
+
|
158
|
+
#######################################
|
159
|
+
# US Independence Day July 4
|
160
|
+
#######################################
|
161
|
+
USIndependenceDay = Holiday(
|
162
|
+
"July 4th",
|
163
|
+
month=7,
|
164
|
+
day=4,
|
165
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
166
|
+
observance=nearest_workday,
|
167
|
+
)
|
168
|
+
|
169
|
+
# Day before Independence Day
|
170
|
+
DayBeforeUSIndependenceDay2pmEarlyClose = Holiday(
|
171
|
+
"Day Before Independence Day",
|
172
|
+
month=7,
|
173
|
+
day=4,
|
174
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
175
|
+
observance=previous_workday,
|
176
|
+
)
|
177
|
+
|
178
|
+
# When July 4th is a Saturday, the previous Friday is a holiday
|
179
|
+
# and the previous Thursday is an early close
|
180
|
+
ThursdayBeforeUSIndependenceDay2pmEarlyClose = Holiday(
|
181
|
+
"Thursday Before Independence Day",
|
182
|
+
month=7,
|
183
|
+
day=2,
|
184
|
+
days_of_week=(THURSDAY,),
|
185
|
+
)
|
186
|
+
|
187
|
+
#################################################
|
188
|
+
# US Labor Day
|
189
|
+
#################################################
|
190
|
+
USLaborDay = Holiday("Labor Day", month=9, day=1, offset=DateOffset(weekday=MO(1)))
|
191
|
+
|
192
|
+
#################################################
|
193
|
+
# Columbus Day
|
194
|
+
#################################################
|
195
|
+
USColumbusDay = Holiday(
|
196
|
+
"Columbus Day",
|
197
|
+
month=10,
|
198
|
+
day=1,
|
199
|
+
offset=DateOffset(weekday=MO(2)),
|
200
|
+
)
|
201
|
+
|
202
|
+
##########################################################
|
203
|
+
# Armistice/Veterans day
|
204
|
+
# When falls on Saturday, no holiday is observed.
|
205
|
+
# When falls on Sunday, the Monday following is a holiday.
|
206
|
+
##########################################################
|
207
|
+
USVeteransDay2022 = Holiday(
|
208
|
+
"Veterans Day Prior to 2023",
|
209
|
+
month=11,
|
210
|
+
day=11,
|
211
|
+
end_date=Timestamp("2022-12-31"),
|
212
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
213
|
+
observance=sunday_to_monday,
|
214
|
+
)
|
215
|
+
|
216
|
+
USVeteransDay = Holiday(
|
217
|
+
"Veterans Day",
|
218
|
+
month=11,
|
219
|
+
day=11,
|
220
|
+
start_date=Timestamp("2023-12-31"),
|
221
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
222
|
+
observance=sunday_to_monday,
|
223
|
+
)
|
224
|
+
|
225
|
+
################################################
|
226
|
+
# US Thanksgiving Nov 30
|
227
|
+
################################################
|
228
|
+
USThanksgivingDay = Holiday(
|
229
|
+
"Thanksgiving", month=11, day=1, offset=DateOffset(weekday=TH(4))
|
230
|
+
)
|
231
|
+
|
232
|
+
DayAfterThanksgiving2pmEarlyClose = Holiday(
|
233
|
+
"Black Friday",
|
234
|
+
month=11,
|
235
|
+
day=1,
|
236
|
+
offset=[DateOffset(weekday=TH(4)), Day(1)],
|
237
|
+
)
|
238
|
+
|
239
|
+
################################
|
240
|
+
# Christmas Dec 25
|
241
|
+
################################
|
242
|
+
Christmas = Holiday(
|
243
|
+
"Christmas",
|
244
|
+
month=12,
|
245
|
+
day=25,
|
246
|
+
observance=nearest_workday,
|
247
|
+
)
|
248
|
+
|
249
|
+
ChristmasEve2pmEarlyClose = Holiday(
|
250
|
+
"Christmas Eve",
|
251
|
+
month=12,
|
252
|
+
day=25,
|
253
|
+
observance=previous_workday,
|
254
|
+
)
|
255
|
+
|
256
|
+
# When Christmas is on a Saturday it is observed on Friday the 24th
|
257
|
+
# Early close on Thursday 23rd
|
258
|
+
ChristmasEveThursday2pmEarlyClose = Holiday(
|
259
|
+
"Christmas Eve on Thursday",
|
260
|
+
month=12,
|
261
|
+
day=23,
|
262
|
+
days_of_week=(THURSDAY,),
|
263
|
+
)
|
264
|
+
|
265
|
+
############################################################################
|
266
|
+
# UK Specific Holidays
|
267
|
+
############################################################################
|
268
|
+
|
269
|
+
# Remarkably, in 2022 SIFMA recommended NO new year's day observance in the US (Saturday)
|
270
|
+
# but in the UK it was observed on Monday requiring a different rule
|
271
|
+
UKNewYearsDay = Holiday(
|
272
|
+
"New Years Day",
|
273
|
+
month=1,
|
274
|
+
day=1,
|
275
|
+
observance=next_monday,
|
276
|
+
)
|
277
|
+
|
278
|
+
UKGoodFriday = Holiday("Good Friday", month=1, day=1, offset=[Easter(), Day(-2)])
|
279
|
+
|
280
|
+
UKEasterMonday = Holiday("Easter Monday", month=1, day=1, offset=[Easter(), Day(+1)])
|
281
|
+
|
282
|
+
# Observed first Monday in May
|
283
|
+
UKMayDay = Holiday(
|
284
|
+
"May Day",
|
285
|
+
month=5,
|
286
|
+
day=1,
|
287
|
+
offset=DateOffset(weekday=MO(1)),
|
288
|
+
)
|
289
|
+
|
290
|
+
# Almost always follows US Memorial Day except for
|
291
|
+
UKSpringBankAdHoc = [
|
292
|
+
Timestamp("2022-06-02", tz="UTC"),
|
293
|
+
]
|
294
|
+
|
295
|
+
UKPlatinumJubilee2022 = [
|
296
|
+
Timestamp("2022-06-03", tz="UTC"),
|
297
|
+
]
|
298
|
+
|
299
|
+
# Observed last Monday in August in England, Wales, and Northern Ireland
|
300
|
+
# Observed first Monday in August in Scotland
|
301
|
+
# Coded as last Monday
|
302
|
+
# https://www.timeanddate.com/holidays/uk/summer-bank-holiday
|
303
|
+
UKSummerBank = Holiday(
|
304
|
+
"Summer Bank Holiday",
|
305
|
+
month=8,
|
306
|
+
day=30,
|
307
|
+
offset=DateOffset(weekday=MO(-1)),
|
308
|
+
)
|
309
|
+
|
310
|
+
# UK observes Christmas on Tuesday when Boxing Day is on Monday
|
311
|
+
# UK observes Christmas on Monday when Christmas is on Saturday
|
312
|
+
UKChristmaEve = Holiday(
|
313
|
+
"Christmas",
|
314
|
+
month=12,
|
315
|
+
day=24,
|
316
|
+
days_of_week=(FRIDAY,),
|
317
|
+
)
|
318
|
+
|
319
|
+
UKChristmas = Holiday(
|
320
|
+
"Christmas",
|
321
|
+
month=12,
|
322
|
+
day=25,
|
323
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
324
|
+
)
|
325
|
+
|
326
|
+
# If christmas day is Saturday Monday 27th is a holiday
|
327
|
+
# If christmas day is sunday the Tuesday 27th is a holiday
|
328
|
+
UKWeekendChristmas = Holiday(
|
329
|
+
"Weekend Christmas",
|
330
|
+
month=12,
|
331
|
+
day=27,
|
332
|
+
days_of_week=(MONDAY, TUESDAY),
|
333
|
+
)
|
334
|
+
|
335
|
+
# Boxing day
|
336
|
+
UKBoxingDay = Holiday(
|
337
|
+
"Boxing Day",
|
338
|
+
month=12,
|
339
|
+
day=26,
|
340
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
341
|
+
)
|
342
|
+
|
343
|
+
# If boxing day is saturday then Monday 28th is a holiday
|
344
|
+
# If boxing day is sunday then Tuesday 28th is a holiday
|
345
|
+
UKWeekendBoxingDay = Holiday(
|
346
|
+
"Weekend Boxing Day",
|
347
|
+
month=12,
|
348
|
+
day=28,
|
349
|
+
days_of_week=(MONDAY, TUESDAY),
|
350
|
+
)
|