pandas-market-calendars 4.3.0__py3-none-any.whl → 4.3.1__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.
- pandas_market_calendars/calendars/__init__.py +0 -0
- pandas_market_calendars/calendars/asx.py +63 -0
- pandas_market_calendars/calendars/bmf.py +227 -0
- pandas_market_calendars/calendars/bse.py +409 -0
- pandas_market_calendars/calendars/cboe.py +115 -0
- pandas_market_calendars/calendars/cme.py +240 -0
- pandas_market_calendars/calendars/cme_globex_agriculture.py +103 -0
- pandas_market_calendars/calendars/cme_globex_base.py +103 -0
- pandas_market_calendars/calendars/cme_globex_crypto.py +147 -0
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +138 -0
- pandas_market_calendars/calendars/cme_globex_equities.py +104 -0
- pandas_market_calendars/calendars/cme_globex_fixed_income.py +113 -0
- pandas_market_calendars/calendars/cme_globex_fx.py +78 -0
- pandas_market_calendars/calendars/eurex.py +119 -0
- pandas_market_calendars/calendars/hkex.py +408 -0
- pandas_market_calendars/calendars/ice.py +65 -0
- pandas_market_calendars/calendars/iex.py +98 -0
- pandas_market_calendars/calendars/jpx.py +103 -0
- pandas_market_calendars/calendars/lse.py +91 -0
- pandas_market_calendars/calendars/mirror.py +114 -0
- pandas_market_calendars/calendars/nyse.py +1127 -0
- pandas_market_calendars/calendars/ose.py +150 -0
- pandas_market_calendars/calendars/sifma.py +297 -0
- pandas_market_calendars/calendars/six.py +114 -0
- pandas_market_calendars/calendars/sse.py +290 -0
- pandas_market_calendars/calendars/tase.py +195 -0
- pandas_market_calendars/calendars/tsx.py +159 -0
- pandas_market_calendars/holidays/__init__.py +0 -0
- pandas_market_calendars/holidays/cme.py +340 -0
- pandas_market_calendars/holidays/cme_globex.py +198 -0
- pandas_market_calendars/holidays/cn.py +1436 -0
- pandas_market_calendars/holidays/jp.py +396 -0
- pandas_market_calendars/holidays/jpx_equinox.py +147 -0
- pandas_market_calendars/holidays/nyse.py +1472 -0
- pandas_market_calendars/holidays/oz.py +65 -0
- pandas_market_calendars/holidays/sifma.py +321 -0
- pandas_market_calendars/holidays/uk.py +180 -0
- pandas_market_calendars/holidays/us.py +360 -0
- {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/METADATA +1 -1
- pandas_market_calendars-4.3.1.dist-info/RECORD +49 -0
- pandas_market_calendars-4.3.0.dist-info/RECORD +0 -11
- {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/LICENSE +0 -0
- {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/NOTICE +0 -0
- {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/WHEEL +0 -0
- {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,340 @@
|
|
1
|
+
import datetime
|
2
|
+
|
3
|
+
from dateutil.relativedelta import (MO, TH, FR)
|
4
|
+
from pandas import (DateOffset, Timestamp)
|
5
|
+
from pandas.tseries.holiday import (Holiday, Easter)
|
6
|
+
from pandas.tseries.holiday import (nearest_workday)
|
7
|
+
from pandas.tseries.offsets import (Day)
|
8
|
+
|
9
|
+
|
10
|
+
#########
|
11
|
+
# Martin Luther King
|
12
|
+
#########
|
13
|
+
USMartinLutherKingJrAfter1998Before2022 = Holiday(
|
14
|
+
'Dr. Martin Luther King Jr. Day',
|
15
|
+
month=1,
|
16
|
+
day=1,
|
17
|
+
# The US markets didn't observe MLK day as a holiday until 1998.
|
18
|
+
start_date=Timestamp('1998-01-01'),
|
19
|
+
end_date=Timestamp('2021-12-31'),
|
20
|
+
offset=DateOffset(weekday=MO(3)),
|
21
|
+
)
|
22
|
+
|
23
|
+
USMartinLutherKingJrAfter1998Before2015 = Holiday(
|
24
|
+
'Dr. Martin Luther King Jr. Day',
|
25
|
+
month=1,
|
26
|
+
day=1,
|
27
|
+
# The US markets didn't observe MLK day as a holiday until 1998.
|
28
|
+
start_date=Timestamp('1998-01-01'),
|
29
|
+
end_date=Timestamp('2014-12-31'),
|
30
|
+
offset=DateOffset(weekday=MO(3)),)
|
31
|
+
|
32
|
+
USMartinLutherKingJrAfter2015 = Holiday(
|
33
|
+
'Dr. Martin Luther King Jr. Day',
|
34
|
+
month=1,
|
35
|
+
day=1,
|
36
|
+
# The US markets didn't observe MLK day as a holiday until 1998.
|
37
|
+
start_date=Timestamp('2015-01-01'),
|
38
|
+
offset=DateOffset(weekday=MO(3)),)
|
39
|
+
|
40
|
+
USMartinLutherKingJrAfter1998Before2016FridayBefore = Holiday(
|
41
|
+
"Dr. Martin Luther King Jr. Day",
|
42
|
+
month= 1,
|
43
|
+
day= 1,
|
44
|
+
start_date= Timestamp("1998-01-01"),
|
45
|
+
end_date= Timestamp("2015-12-31"),
|
46
|
+
offset= [DateOffset(weekday= MO(3)), DateOffset(weekday= FR(-1))]
|
47
|
+
)
|
48
|
+
|
49
|
+
#########
|
50
|
+
# President's Day
|
51
|
+
#########
|
52
|
+
USPresidentsDayBefore2022 = Holiday(
|
53
|
+
'President''s Day',
|
54
|
+
start_date=Timestamp('1971-01-01'),
|
55
|
+
end_date=Timestamp('2021-12-31'),
|
56
|
+
month=2, day=1,
|
57
|
+
offset=DateOffset(weekday=MO(3)),
|
58
|
+
)
|
59
|
+
USPresidentsDayBefore2015 = Holiday(
|
60
|
+
'President''s Day',
|
61
|
+
start_date=Timestamp('1971-01-01'),
|
62
|
+
end_date=Timestamp('2014-12-31'),
|
63
|
+
month=2, day=1,
|
64
|
+
offset=DateOffset(weekday=MO(3)),)
|
65
|
+
|
66
|
+
USPresidentsDayAfter2015 = Holiday(
|
67
|
+
'President''s Day',
|
68
|
+
start_date=Timestamp('2015-01-01'),
|
69
|
+
month=2, day=1,
|
70
|
+
offset=DateOffset(weekday=MO(3)),)
|
71
|
+
|
72
|
+
USPresidentsDayBefore2016FridayBefore = Holiday(
|
73
|
+
'President''s Day',
|
74
|
+
start_date=Timestamp('1971-01-01'),
|
75
|
+
end_date=Timestamp('2015-12-31'),
|
76
|
+
month=2, day=1,
|
77
|
+
offset=[DateOffset(weekday=MO(3)), DateOffset(weekday= FR(-1))]
|
78
|
+
)
|
79
|
+
|
80
|
+
#########
|
81
|
+
# Good Friday
|
82
|
+
#########
|
83
|
+
|
84
|
+
|
85
|
+
GoodFridayBefore2021 = Holiday(
|
86
|
+
"Good Friday",
|
87
|
+
month=1, day=1,
|
88
|
+
offset=[Easter(), Day(-2)],
|
89
|
+
end_date=Timestamp('2020-12-31'),
|
90
|
+
)
|
91
|
+
|
92
|
+
# On some years (i.e. 2010,2012,2015) there is a special close for equities at 08:15
|
93
|
+
# so here it is made sure that those are not full holidays
|
94
|
+
easter = Easter()
|
95
|
+
daymin2 = Day(-2)
|
96
|
+
def not_0815_close(dt):
|
97
|
+
if dt.year in (2010, 2012, 2015):
|
98
|
+
return None
|
99
|
+
else:
|
100
|
+
return dt + easter + daymin2
|
101
|
+
|
102
|
+
GoodFridayBefore2021NotEarlyClose = Holiday(
|
103
|
+
"Good Friday",
|
104
|
+
month=1, day=1,
|
105
|
+
observance=not_0815_close,
|
106
|
+
end_date=Timestamp('2020-12-31'),
|
107
|
+
)
|
108
|
+
|
109
|
+
## CME Interest Rate Products have this odd close
|
110
|
+
GoodFriday2009 = Holiday(
|
111
|
+
"Good Friday",
|
112
|
+
month= 1, day= 1,
|
113
|
+
offset= [Easter(), Day(-3)],
|
114
|
+
start_date= Timestamp("2009-01-01"),
|
115
|
+
end_date= Timestamp("2009-12-31"),
|
116
|
+
)
|
117
|
+
|
118
|
+
GoodFriday2021 = Holiday(
|
119
|
+
"Good Friday",
|
120
|
+
month=1, day=1,
|
121
|
+
offset=[Easter(), Day(-2)],
|
122
|
+
start_date=Timestamp('2021-01-01'),
|
123
|
+
end_date=Timestamp('2021-12-31'),
|
124
|
+
)
|
125
|
+
GoodFridayAfter2021 = Holiday(
|
126
|
+
"Good Friday",
|
127
|
+
month=1, day=1,
|
128
|
+
offset=[Easter(), Day(-2)],
|
129
|
+
start_date=Timestamp('2022-01-01'),
|
130
|
+
)
|
131
|
+
# Dates when equities closed at 08:15
|
132
|
+
GoodFriday2010 = Holiday(
|
133
|
+
"Good Friday",
|
134
|
+
month=1, day=1,
|
135
|
+
offset=[Easter(), Day(-2)],
|
136
|
+
start_date=Timestamp('2010-01-01'),
|
137
|
+
end_date=Timestamp('2010-12-31'),
|
138
|
+
)
|
139
|
+
GoodFriday2012 = Holiday(
|
140
|
+
"Good Friday",
|
141
|
+
month=1, day=1,
|
142
|
+
offset=[Easter(), Day(-2)],
|
143
|
+
start_date=Timestamp('2012-01-01'),
|
144
|
+
end_date=Timestamp('2012-12-31'),)
|
145
|
+
|
146
|
+
GoodFriday2015 = Holiday(
|
147
|
+
"Good Friday",
|
148
|
+
month=1, day=1,
|
149
|
+
offset=[Easter(), Day(-2)],
|
150
|
+
start_date=Timestamp('2015-01-01'),
|
151
|
+
end_date=Timestamp('2015-12-31'),
|
152
|
+
)
|
153
|
+
|
154
|
+
#########
|
155
|
+
# Memorial Day
|
156
|
+
#########
|
157
|
+
|
158
|
+
USMemorialDay2021AndPrior = Holiday(
|
159
|
+
'Memorial Day',
|
160
|
+
month=5,
|
161
|
+
day=25,
|
162
|
+
start_date=Timestamp('1971-01-01'),
|
163
|
+
end_date=Timestamp('2021-12-31'),
|
164
|
+
offset=DateOffset(weekday=MO(1)),
|
165
|
+
)#### Equity Products
|
166
|
+
USMemorialDay2013AndPrior = Holiday(
|
167
|
+
'Memorial Day',
|
168
|
+
month=5,
|
169
|
+
day=25,
|
170
|
+
start_date=Timestamp('1971-01-01'),
|
171
|
+
end_date=Timestamp('2013-12-31'),
|
172
|
+
offset=DateOffset(weekday=MO(1)),
|
173
|
+
)
|
174
|
+
USMemorialDayAfter2013 = Holiday(
|
175
|
+
'Memorial Day',
|
176
|
+
month=5,
|
177
|
+
day=25,
|
178
|
+
start_date=Timestamp('2014-01-01'),
|
179
|
+
offset=DateOffset(weekday=MO(1)),
|
180
|
+
)
|
181
|
+
USMemorialDay2015AndPriorFridayBefore = Holiday(
|
182
|
+
'Memorial Day',
|
183
|
+
month=5,
|
184
|
+
day=25,
|
185
|
+
start_date=Timestamp('1971-01-01'),
|
186
|
+
end_date=Timestamp('2015-12-31'),
|
187
|
+
offset=[DateOffset(weekday=MO(1)), DateOffset(weekday= FR(-1))],
|
188
|
+
)
|
189
|
+
|
190
|
+
#######
|
191
|
+
# Independence Day
|
192
|
+
#######
|
193
|
+
|
194
|
+
USIndependenceDayBefore2022 = Holiday(
|
195
|
+
'July 4th',
|
196
|
+
month=7,
|
197
|
+
day=4,
|
198
|
+
start_date=Timestamp('1954-01-01'),
|
199
|
+
end_date=Timestamp('2021-12-31'),
|
200
|
+
observance=nearest_workday,)
|
201
|
+
USIndependenceDayBefore2014 = Holiday(
|
202
|
+
'July 4th',
|
203
|
+
month=7,
|
204
|
+
day=4,
|
205
|
+
start_date=Timestamp('1954-01-01'),
|
206
|
+
end_date=Timestamp('2013-12-31'),
|
207
|
+
observance=nearest_workday,)
|
208
|
+
USIndependenceDayAfter2014 = Holiday(
|
209
|
+
'July 4th',
|
210
|
+
month=7,
|
211
|
+
day=4,
|
212
|
+
start_date=Timestamp('2014-01-01'),
|
213
|
+
observance=nearest_workday,)
|
214
|
+
|
215
|
+
# Necessary for equities and crypto
|
216
|
+
def previous_workday_if_july_4th_is_tue_to_fri(dt):
|
217
|
+
july4th = datetime.datetime(dt.year, 7, 4)
|
218
|
+
if july4th.weekday() in (1, 2, 3, 4):
|
219
|
+
return july4th - datetime.timedelta(days=1)
|
220
|
+
# else None
|
221
|
+
|
222
|
+
USIndependenceDayBefore2022PreviousDay = Holiday(
|
223
|
+
'July 4th',
|
224
|
+
month=7,
|
225
|
+
day=4,
|
226
|
+
start_date=Timestamp('1954-01-01'),
|
227
|
+
observance= previous_workday_if_july_4th_is_tue_to_fri
|
228
|
+
)
|
229
|
+
|
230
|
+
#########
|
231
|
+
# Labor Day
|
232
|
+
#########
|
233
|
+
|
234
|
+
USLaborDayStarting1887Before2022 = Holiday(
|
235
|
+
"Labor Day",
|
236
|
+
month=9,
|
237
|
+
day=1,
|
238
|
+
start_date=Timestamp("1887-01-01"),
|
239
|
+
end_date=Timestamp('2021-12-31'),
|
240
|
+
offset=DateOffset(weekday=MO(1))
|
241
|
+
)
|
242
|
+
USLaborDayStarting1887Before2014 = Holiday(
|
243
|
+
"Labor Day",
|
244
|
+
month=9,
|
245
|
+
day=1,
|
246
|
+
start_date=Timestamp("1887-01-01"),
|
247
|
+
end_date=Timestamp('2013-12-31'),
|
248
|
+
offset=DateOffset(weekday=MO(1))
|
249
|
+
)
|
250
|
+
USLaborDayStarting1887Before2015FridayBefore = Holiday(
|
251
|
+
"Labor Day",
|
252
|
+
month=9,
|
253
|
+
day=1,
|
254
|
+
start_date=Timestamp("1887-01-01"),
|
255
|
+
end_date=Timestamp('2014-12-31'),
|
256
|
+
offset=[DateOffset(weekday=MO(1)), DateOffset(weekday=FR(-1))]
|
257
|
+
|
258
|
+
)
|
259
|
+
USLaborDayStarting1887After2014 = Holiday(
|
260
|
+
"Labor Day",
|
261
|
+
month=9,
|
262
|
+
day=1,
|
263
|
+
start_date=Timestamp("2014-01-01"),
|
264
|
+
offset=DateOffset(weekday=MO(1))
|
265
|
+
)
|
266
|
+
|
267
|
+
|
268
|
+
#########
|
269
|
+
# Thanksgiving
|
270
|
+
#########
|
271
|
+
|
272
|
+
USThanksgivingBefore2022 = Holiday(
|
273
|
+
'ThanksgivingFriday',
|
274
|
+
start_date=Timestamp('1942-01-01'),
|
275
|
+
end_date=Timestamp('2021-12-31'),
|
276
|
+
month=11, day=1,
|
277
|
+
offset=DateOffset(weekday=TH(4)),
|
278
|
+
)
|
279
|
+
USThanksgivingBefore2014 = Holiday(
|
280
|
+
'ThanksgivingFriday',
|
281
|
+
start_date=Timestamp('1942-01-01'),
|
282
|
+
end_date=Timestamp('2013-12-31'),
|
283
|
+
month=11, day=1,
|
284
|
+
offset=DateOffset(weekday=TH(4)),
|
285
|
+
)
|
286
|
+
USThanksgivingAfter2014 = Holiday(
|
287
|
+
'ThanksgivingFriday',
|
288
|
+
start_date=Timestamp('2014-01-01'),
|
289
|
+
month=11, day=1,
|
290
|
+
offset=DateOffset(weekday=TH(4)),
|
291
|
+
)
|
292
|
+
|
293
|
+
######## The following Holidays shouldn't be set with the FR offset
|
294
|
+
## In 2013, Nov 1st is a friday, so the 4th Friday is before the 4th Thursday...
|
295
|
+
# the observance rule defined herafter fixes this
|
296
|
+
|
297
|
+
# USThanksgivingFridayBefore2022 = Holiday(
|
298
|
+
# 'ThanksgivingFriday',
|
299
|
+
# start_date=Timestamp('1942-01-01'),
|
300
|
+
# end_date=Timestamp('2021-12-31'),
|
301
|
+
# month=11, day=1,
|
302
|
+
# offset=DateOffset(weekday=FR(4)),
|
303
|
+
# )
|
304
|
+
#
|
305
|
+
# USThanksgivingFriday2022AndAfter = Holiday(
|
306
|
+
# 'ThanksgivingFriday',
|
307
|
+
# start_date=Timestamp('2022-01-01'),
|
308
|
+
# month=11, day=1,
|
309
|
+
# offset=DateOffset(weekday=FR(4)),
|
310
|
+
# )
|
311
|
+
# USThanksgivingFriday = Holiday(
|
312
|
+
# 'ThanksgivingFriday',
|
313
|
+
# month=11, day=1,
|
314
|
+
# offset=DateOffset(weekday=FR(4)),
|
315
|
+
# )
|
316
|
+
|
317
|
+
def fri_after_4th_thu(dt):
|
318
|
+
# dt will just be Nov 1st
|
319
|
+
diff_to_thu = 3 - dt.weekday()
|
320
|
+
if diff_to_thu < 0: diff_to_thu += 7
|
321
|
+
return dt + datetime.timedelta(days=diff_to_thu + 22)
|
322
|
+
|
323
|
+
USThanksgivingFriday = Holiday(
|
324
|
+
'ThanksgivingFriday',
|
325
|
+
start_date=Timestamp('1942-01-01'),
|
326
|
+
month=11, day=1,
|
327
|
+
observance= fri_after_4th_thu,
|
328
|
+
)
|
329
|
+
|
330
|
+
USThanksgivingFriday2022AndAfter = Holiday(
|
331
|
+
'ThanksgivingFriday',
|
332
|
+
start_date=Timestamp('2022-01-01'),
|
333
|
+
month=11, day=1,
|
334
|
+
observance= fri_after_4th_thu,
|
335
|
+
)
|
336
|
+
# USThanksgivingFriday = Holiday(
|
337
|
+
# 'ThanksgivingFriday',
|
338
|
+
# month=11, day=1,
|
339
|
+
# observance= fri_after_4th_thu,
|
340
|
+
# )
|
@@ -0,0 +1,198 @@
|
|
1
|
+
from dateutil.relativedelta import (MO, TU, WE, TH, FR, SA, SU)
|
2
|
+
from pandas import (DateOffset, Timestamp, date_range)
|
3
|
+
from datetime import timedelta
|
4
|
+
from pandas.tseries.holiday import (Holiday, nearest_workday, sunday_to_monday, Easter)
|
5
|
+
from pandas.tseries.offsets import Day, CustomBusinessDay
|
6
|
+
|
7
|
+
from pandas_market_calendars.market_calendar import ( MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY)
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
####################################################
|
12
|
+
# US New Years Day Jan 1
|
13
|
+
#####################################################
|
14
|
+
USNewYearsDay = Holiday(
|
15
|
+
'New Years Day',
|
16
|
+
month=1,
|
17
|
+
day=1,
|
18
|
+
start_date = Timestamp('1952-09-29'),
|
19
|
+
#observance=sunday_to_monday,
|
20
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,)
|
21
|
+
)
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
#########################################################################
|
26
|
+
# Martin Luther King Jr.
|
27
|
+
# Starting 1998
|
28
|
+
##########################################################################
|
29
|
+
USMartinLutherKingJrFrom2022 = Holiday(
|
30
|
+
'Dr. Martin Luther King Jr. Day',
|
31
|
+
month=1,
|
32
|
+
day=1,
|
33
|
+
start_date=Timestamp('2022-01-01'),
|
34
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,),
|
35
|
+
offset=DateOffset(weekday=MO(3)),
|
36
|
+
)
|
37
|
+
|
38
|
+
USMartinLutherKingJrPre2022 = Holiday(
|
39
|
+
'Dr. Martin Luther King Jr. Day',
|
40
|
+
month=1,
|
41
|
+
day=1,
|
42
|
+
start_date=Timestamp('1998-01-01'),
|
43
|
+
end_date=Timestamp("2021-12-31"),
|
44
|
+
offset=DateOffset(weekday=MO(3)),
|
45
|
+
)
|
46
|
+
|
47
|
+
|
48
|
+
#########################################################################
|
49
|
+
# US Presidents Day Feb
|
50
|
+
##########################################################################
|
51
|
+
USPresidentsDayFrom2022 = Holiday('President''s Day',
|
52
|
+
start_date=Timestamp('2022-01-01'),
|
53
|
+
month=2, day=1,
|
54
|
+
offset=DateOffset(weekday=MO(3)))
|
55
|
+
|
56
|
+
USPresidentsDayPre2022 = Holiday('President''s Day',
|
57
|
+
end_date=Timestamp('2021-12-31'),
|
58
|
+
month=2, day=1,
|
59
|
+
offset=DateOffset(weekday=MO(3)))
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
############################################################
|
64
|
+
# Good Friday
|
65
|
+
############################################################
|
66
|
+
GoodFriday = Holiday(
|
67
|
+
"Good Friday 1908+",
|
68
|
+
start_date=Timestamp('1908-01-01'),
|
69
|
+
month=1,
|
70
|
+
day=1,
|
71
|
+
offset=[Easter(), Day(-2)]
|
72
|
+
)
|
73
|
+
|
74
|
+
##################################################
|
75
|
+
# US Memorial Day (Decoration Day) May 30
|
76
|
+
##################################################
|
77
|
+
USMemorialDayFrom2022 = Holiday(
|
78
|
+
'Memorial Day',
|
79
|
+
month=5,
|
80
|
+
day=25,
|
81
|
+
start_date=Timestamp('2022-01-01'),
|
82
|
+
offset=DateOffset(weekday=MO(1)),
|
83
|
+
)
|
84
|
+
|
85
|
+
USMemorialDayPre2022 = Holiday(
|
86
|
+
'Memorial Day',
|
87
|
+
month=5,
|
88
|
+
day=25,
|
89
|
+
end_date=Timestamp('2021-12-31'),
|
90
|
+
offset=DateOffset(weekday=MO(1)),
|
91
|
+
)
|
92
|
+
|
93
|
+
#######################################
|
94
|
+
# US Juneteenth (June 19th)
|
95
|
+
#######################################
|
96
|
+
USJuneteenthFrom2022 = Holiday(
|
97
|
+
'Juneteenth Starting at 2022',
|
98
|
+
start_date=Timestamp('2022-06-19'),
|
99
|
+
month=6, day=19,
|
100
|
+
observance=nearest_workday,
|
101
|
+
)
|
102
|
+
|
103
|
+
#######################################
|
104
|
+
# US Independence Day July 4
|
105
|
+
#######################################
|
106
|
+
USIndependenceDayFrom2022 = Holiday(
|
107
|
+
'July 4th',
|
108
|
+
month=7,
|
109
|
+
day=4,
|
110
|
+
start_date=Timestamp('2022-01-01'),
|
111
|
+
observance=nearest_workday,
|
112
|
+
)
|
113
|
+
USIndependenceDayPre2022 = Holiday(
|
114
|
+
'July 4th',
|
115
|
+
month=7,
|
116
|
+
day=4,
|
117
|
+
end_date=Timestamp('2021-12-31'),
|
118
|
+
observance=nearest_workday,
|
119
|
+
)
|
120
|
+
|
121
|
+
|
122
|
+
#################################################
|
123
|
+
# US Labor Day Starting 1887
|
124
|
+
#################################################
|
125
|
+
USLaborDayFrom2022 = Holiday(
|
126
|
+
'Labor Day',
|
127
|
+
month=9,
|
128
|
+
day=1,
|
129
|
+
start_date=Timestamp('2022-01-01'),
|
130
|
+
offset=DateOffset(weekday=MO(1)),
|
131
|
+
)
|
132
|
+
USLaborDayPre2022 = Holiday(
|
133
|
+
'Labor Day',
|
134
|
+
month=9,
|
135
|
+
day=1,
|
136
|
+
end_date=Timestamp('2021-12-31'),
|
137
|
+
offset=DateOffset(weekday=MO(1)),
|
138
|
+
)
|
139
|
+
USLaborDay = Holiday(
|
140
|
+
"Labor Day",
|
141
|
+
month=9,
|
142
|
+
day=1,
|
143
|
+
start_date=Timestamp("1887-01-01"),
|
144
|
+
offset=DateOffset(weekday=MO(1))
|
145
|
+
)
|
146
|
+
|
147
|
+
|
148
|
+
################################################
|
149
|
+
# US Thanksgiving Nov 30
|
150
|
+
################################################
|
151
|
+
USThanksgivingDayFrom2022 = Holiday(
|
152
|
+
'Thanksgiving',
|
153
|
+
start_date=Timestamp('2022-01-01'),
|
154
|
+
month=11, day=1,
|
155
|
+
offset=DateOffset(weekday=TH(4))
|
156
|
+
)
|
157
|
+
|
158
|
+
USThanksgivingDayPre2022 = Holiday(
|
159
|
+
'Thanksgiving',
|
160
|
+
end_date=Timestamp('2021-12-31'),
|
161
|
+
month=11, day=1,
|
162
|
+
offset=DateOffset(weekday=TH(4))
|
163
|
+
)
|
164
|
+
|
165
|
+
FridayAfterThanksgiving = Holiday(
|
166
|
+
'Friday after Thanksgiving',
|
167
|
+
month=11,
|
168
|
+
day=1,
|
169
|
+
offset=[DateOffset(weekday=TH(4)), Day(1)],
|
170
|
+
)
|
171
|
+
|
172
|
+
USThanksgivingFridayFrom2021 = Holiday(
|
173
|
+
'Thanksgiving Friday',
|
174
|
+
month=11,
|
175
|
+
day=1,
|
176
|
+
offset=[DateOffset(weekday=TH(4)), Day(1)],
|
177
|
+
start_date=Timestamp('2021-01-01'),
|
178
|
+
)
|
179
|
+
|
180
|
+
USThanksgivingFridayPre2021 = Holiday(
|
181
|
+
'Thanksgiving Friday',
|
182
|
+
month=11,
|
183
|
+
day=1,
|
184
|
+
offset=[DateOffset(weekday=TH(4)), Day(1)],
|
185
|
+
end_date=Timestamp('2020-12-31'),
|
186
|
+
)
|
187
|
+
|
188
|
+
################################
|
189
|
+
# Christmas Dec 25
|
190
|
+
################################
|
191
|
+
ChristmasCME = Holiday(
|
192
|
+
'Christmas',
|
193
|
+
month=12,
|
194
|
+
day=25,
|
195
|
+
start_date=Timestamp('1999-01-01'),
|
196
|
+
observance=nearest_workday,
|
197
|
+
)
|
198
|
+
|