pandas-market-calendars 4.3.1__py3-none-any.whl → 4.3.3__py3-none-any.whl

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