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