pandas-market-calendars 4.4.2__py3-none-any.whl → 4.5.0__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.
Files changed (47) hide show
  1. pandas_market_calendars/__init__.py +38 -38
  2. pandas_market_calendars/calendar_registry.py +57 -57
  3. pandas_market_calendars/calendar_utils.py +262 -262
  4. pandas_market_calendars/calendars/asx.py +66 -66
  5. pandas_market_calendars/calendars/bmf.py +223 -223
  6. pandas_market_calendars/calendars/bse.py +421 -421
  7. pandas_market_calendars/calendars/cboe.py +145 -145
  8. pandas_market_calendars/calendars/cme.py +405 -405
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
  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 -131
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
  18. pandas_market_calendars/calendars/hkex.py +429 -429
  19. pandas_market_calendars/calendars/ice.py +81 -81
  20. pandas_market_calendars/calendars/iex.py +112 -112
  21. pandas_market_calendars/calendars/jpx.py +113 -113
  22. pandas_market_calendars/calendars/lse.py +114 -114
  23. pandas_market_calendars/calendars/mirror.py +149 -149
  24. pandas_market_calendars/calendars/nyse.py +1327 -1324
  25. pandas_market_calendars/calendars/ose.py +116 -116
  26. pandas_market_calendars/calendars/sifma.py +354 -354
  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 +197 -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 +1456 -1456
  34. pandas_market_calendars/holidays/jp.py +401 -401
  35. pandas_market_calendars/holidays/jpx_equinox.py +506 -506
  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 -350
  39. pandas_market_calendars/holidays/us.py +376 -376
  40. pandas_market_calendars/market_calendar.py +941 -922
  41. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/METADATA +1 -1
  42. pandas_market_calendars-4.5.0.dist-info/RECORD +50 -0
  43. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/WHEEL +1 -1
  44. pandas_market_calendars-4.4.2.dist-info/RECORD +0 -50
  45. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/LICENSE +0 -0
  46. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/NOTICE +0 -0
  47. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/top_level.txt +0 -0
@@ -1,354 +1,354 @@
1
- from datetime import time
2
-
3
- from pandas.tseries.holiday import AbstractHolidayCalendar
4
- from pytz import timezone
5
- from itertools import chain
6
-
7
- ########################################################################################################################
8
- # SIFMA Financial Markets Calendar for US, UK, JP
9
- #
10
- # https://www.sifma.com/
11
- #
12
- # US: SIFMAUSExchangeCalendar() ['SIFMAUS', 'SIFMA_US', "Capital_Markets_US", "Financial_Markets_US", "Bond_Markets_US"]
13
- # UK: SIFMAUKExchangeCalendar() ['SIFMAUK', 'SIFMA_UK', "Capital_Markets_UK", "Financial_Markets_UK", "Bond_Markets_UK"]
14
- # JP: SIFMAJPExchangeCalendar() ['SIFMAJP', 'SIFMA_JP', "Capital_Markets_JP", "Financial_Markets_JP", "Bond_Markets_JP"]
15
- #
16
- # Trading Hours:
17
- # US: 7:00 to 17:30
18
- # UK: 8:00 to 17:00
19
- # JP: 8:30 to 18:30
20
- ########################################################################################################################
21
-
22
-
23
- from pandas_market_calendars.holidays.sifma import (
24
- # US Holidays
25
- USNewYearsDay, # Not observed if a Saturday
26
- USNewYearsEve2pmEarlyClose,
27
- MartinLutherKingJr,
28
- USPresidentsDay,
29
- GoodFridayThru2020,
30
- DayBeforeGoodFriday2pmEarlyCloseThru2020,
31
- GoodFridayAdHoc,
32
- GoodFriday2pmEarlyCloseAdHoc,
33
- DayBeforeGoodFriday2pmEarlyCloseAdHoc,
34
- DayBeforeUSMemorialDay2pmEarlyClose,
35
- USMemorialDay,
36
- USJuneteenthAfter2022,
37
- USIndependenceDay,
38
- DayBeforeUSIndependenceDay2pmEarlyClose,
39
- ThursdayBeforeUSIndependenceDay2pmEarlyClose,
40
- USLaborDay,
41
- USColumbusDay,
42
- USVeteransDay2022,
43
- USVeteransDay,
44
- USThanksgivingDay,
45
- DayAfterThanksgiving2pmEarlyClose,
46
- Christmas,
47
- ChristmasEve2pmEarlyClose,
48
- ChristmasEveThursday2pmEarlyClose,
49
- # UK Specific Holidays
50
- UKNewYearsDay, # Saturdays observed on Monday
51
- UKGoodFriday,
52
- UKEasterMonday,
53
- UKMayDay,
54
- UKSpringBankAdHoc, # Usually follows US Memorial Day but not always
55
- UKSummerBank,
56
- UKChristmas,
57
- UKChristmaEve,
58
- UKWeekendChristmas, # Observed Tuesday when Boxing Day is on Monday
59
- UKBoxingDay,
60
- UKWeekendBoxingDay,
61
- UKPlatinumJubilee2022,
62
- )
63
- from pandas_market_calendars.market_calendar import MarketCalendar
64
-
65
-
66
- ########################################################################################################################
67
- # SIFMA Financial Markets Calendar for US, UK, JP
68
- #
69
- # https://www.sifma.com/
70
- #
71
- # US: SIFMAUSExchangeCalendar() ['SIFMAUS', 'SIFMA_US', "Capital_Markets_US", "Financial_Markets_US", "Bond_Markets_US"]
72
- # UK: SIFMAUKExchangeCalendar() ['SIFMAUK', 'SIFMA_UK', "Capital_Markets_UK", "Financial_Markets_UK", "Bond_Markets_UK"]
73
- # JP: SIFMAJPExchangeCalendar() ['SIFMAJP', 'SIFMA_JP', "Capital_Markets_JP", "Financial_Markets_JP", "Bond_Markets_JP"]
74
- #
75
- # Trading Hours:
76
- # US: 7:00 to 17:30
77
- # UK: 8:00 to 17:00
78
- # JP: 8:30 to 18:30
79
- ########################################################################################################################
80
-
81
- # AbstractHolidayCalendar.start_date = '1998-01-01'
82
-
83
- ############################################################
84
- # US
85
- ############################################################
86
-
87
-
88
- class SIFMAUSExchangeCalendar(MarketCalendar):
89
- """
90
- Exchange calendar for SIFMA United States
91
-
92
- https://www.sifma.org/resources/general/holiday-schedule/#US
93
-
94
- """
95
-
96
- aliases = [
97
- "SIFMAUS",
98
- "SIFMA_US",
99
- "Capital_Markets_US",
100
- "Financial_Markets_US",
101
- "Bond_Markets_US",
102
- ]
103
-
104
- regular_market_times = {
105
- "market_open": ((None, time(7)),),
106
- "market_close": ((None, time(17, 30)),),
107
- }
108
-
109
- @property
110
- def name(self):
111
- return "SIFMA_US"
112
-
113
- @property
114
- def tz(self):
115
- return timezone("America/New_York")
116
-
117
- @property
118
- def regular_holidays(self):
119
- return AbstractHolidayCalendar(
120
- rules=[
121
- USNewYearsDay,
122
- MartinLutherKingJr,
123
- USPresidentsDay,
124
- GoodFridayThru2020,
125
- USMemorialDay,
126
- USJuneteenthAfter2022,
127
- USIndependenceDay,
128
- USLaborDay,
129
- USColumbusDay,
130
- USVeteransDay2022,
131
- USVeteransDay,
132
- USThanksgivingDay,
133
- Christmas,
134
- ]
135
- )
136
-
137
- @property
138
- def adhoc_holidays(self):
139
- return list(
140
- chain(
141
- GoodFridayAdHoc,
142
- )
143
- )
144
-
145
- @property
146
- def special_closes(self):
147
- return [
148
- (
149
- time(14),
150
- AbstractHolidayCalendar(
151
- rules=[
152
- DayBeforeGoodFriday2pmEarlyCloseThru2020,
153
- DayBeforeUSMemorialDay2pmEarlyClose,
154
- DayBeforeUSIndependenceDay2pmEarlyClose,
155
- ThursdayBeforeUSIndependenceDay2pmEarlyClose,
156
- DayAfterThanksgiving2pmEarlyClose,
157
- ChristmasEve2pmEarlyClose,
158
- ChristmasEveThursday2pmEarlyClose,
159
- USNewYearsEve2pmEarlyClose,
160
- ]
161
- ),
162
- )
163
- ]
164
-
165
- @property
166
- def special_closes_adhoc(self):
167
- return [
168
- (
169
- time(14, tzinfo=timezone("America/New_York")),
170
- GoodFriday2pmEarlyCloseAdHoc # list
171
- + DayBeforeGoodFriday2pmEarlyCloseAdHoc,
172
- ),
173
- ]
174
-
175
-
176
- ############################################################
177
- # UK
178
- ############################################################
179
-
180
-
181
- class SIFMAUKExchangeCalendar(MarketCalendar):
182
- """
183
- Exchange calendar for SIFMA United Kingdom
184
-
185
- https://www.sifma.org/resources/general/holiday-schedule/#UK
186
-
187
- """
188
-
189
- aliases = [
190
- "SIFMAUK",
191
- "SIFMA_UK",
192
- "Capital_Markets_UK",
193
- "Financial_Markets_UK",
194
- "Bond_Markets_UK",
195
- ]
196
-
197
- regular_market_times = {
198
- "market_open": ((None, time(8)),),
199
- "market_close": ((None, time(17)),),
200
- }
201
-
202
- @property
203
- def name(self):
204
- return "SIFMA_UK"
205
-
206
- @property
207
- def tz(self):
208
- return timezone("Europe/London")
209
-
210
- @property
211
- def regular_holidays(self):
212
- return AbstractHolidayCalendar(
213
- rules=[
214
- UKNewYearsDay,
215
- MartinLutherKingJr,
216
- USPresidentsDay,
217
- UKGoodFriday,
218
- UKEasterMonday,
219
- UKMayDay,
220
- USMemorialDay,
221
- USJuneteenthAfter2022,
222
- USIndependenceDay,
223
- UKSummerBank,
224
- USLaborDay,
225
- USColumbusDay,
226
- USVeteransDay2022,
227
- USVeteransDay,
228
- USThanksgivingDay,
229
- UKChristmas,
230
- UKChristmaEve,
231
- UKWeekendChristmas,
232
- UKBoxingDay,
233
- UKWeekendBoxingDay,
234
- ]
235
- )
236
-
237
- @property
238
- def adhoc_holidays(self):
239
- return list(
240
- chain(
241
- UKSpringBankAdHoc,
242
- UKPlatinumJubilee2022,
243
- )
244
- )
245
-
246
-
247
- ############################################################
248
- # Japan
249
- ############################################################
250
- from pandas_market_calendars.holidays.jp import (
251
- JapanComingOfAgeDay,
252
- JapanNationalFoundationDay,
253
- JapanEmperorsBirthday,
254
- JapanVernalEquinox,
255
- JapanShowaDay,
256
- JapanConstitutionMemorialDay,
257
- JapanGreeneryDay,
258
- JapanChildrensDay,
259
- JapanMarineDay,
260
- JapanMountainDay,
261
- JapanRespectForTheAgedDay,
262
- JapanAutumnalEquinox,
263
- JapanHealthAndSportsDay2000To2019,
264
- JapanSportsDay2020,
265
- JapanSportsDay,
266
- JapanCultureDay,
267
- JapanLaborThanksgivingDay,
268
- )
269
-
270
-
271
- class SIFMAJPExchangeCalendar(MarketCalendar):
272
- """
273
- Exchange calendar for SIFMA Japan
274
-
275
- https://www.sifma.org/resources/general/holiday-schedule/#JP
276
-
277
- """
278
-
279
- aliases = [
280
- "SIFMAJP",
281
- "SIFMA_JP",
282
- "Capital_Markets_JP",
283
- "Financial_Markets_JP",
284
- "Bond_Markets_JP",
285
- ]
286
-
287
- regular_market_times = {
288
- "market_open": ((None, time(8, 30)),),
289
- "market_close": ((None, time(18, 30)),),
290
- }
291
-
292
- @property
293
- def name(self):
294
- return "SIFMA_JP"
295
-
296
- @property
297
- def tz(self):
298
- return timezone("Asia/Tokyo")
299
-
300
- @property
301
- def regular_holidays(self):
302
- return AbstractHolidayCalendar(
303
- rules=[
304
- UKNewYearsDay,
305
- JapanComingOfAgeDay,
306
- MartinLutherKingJr,
307
- JapanNationalFoundationDay,
308
- USPresidentsDay,
309
- JapanEmperorsBirthday,
310
- JapanVernalEquinox,
311
- UKGoodFriday,
312
- UKEasterMonday,
313
- JapanShowaDay,
314
- JapanConstitutionMemorialDay,
315
- JapanGreeneryDay,
316
- JapanChildrensDay,
317
- USMemorialDay,
318
- USJuneteenthAfter2022,
319
- USIndependenceDay,
320
- JapanMarineDay,
321
- JapanMountainDay,
322
- UKSummerBank,
323
- USLaborDay,
324
- JapanRespectForTheAgedDay,
325
- JapanAutumnalEquinox,
326
- JapanSportsDay,
327
- JapanSportsDay2020,
328
- JapanHealthAndSportsDay2000To2019,
329
- JapanCultureDay,
330
- USVeteransDay2022,
331
- USVeteransDay,
332
- JapanLaborThanksgivingDay,
333
- USThanksgivingDay,
334
- UKChristmas,
335
- UKChristmaEve,
336
- UKBoxingDay,
337
- UKWeekendBoxingDay,
338
- ]
339
- )
340
-
341
- @property
342
- def adhoc_holidays(self):
343
- return list(
344
- chain(
345
- UKSpringBankAdHoc,
346
- UKPlatinumJubilee2022,
347
- )
348
- )
349
-
350
- @property
351
- def special_closes(self):
352
- return [
353
- (time(15), AbstractHolidayCalendar(rules=[UKMayDay, UKWeekendChristmas]))
354
- ]
1
+ from datetime import time
2
+
3
+ from pandas.tseries.holiday import AbstractHolidayCalendar
4
+ from pytz import timezone
5
+ from itertools import chain
6
+
7
+ ########################################################################################################################
8
+ # SIFMA Financial Markets Calendar for US, UK, JP
9
+ #
10
+ # https://www.sifma.com/
11
+ #
12
+ # US: SIFMAUSExchangeCalendar() ['SIFMAUS', 'SIFMA_US', "Capital_Markets_US", "Financial_Markets_US", "Bond_Markets_US"]
13
+ # UK: SIFMAUKExchangeCalendar() ['SIFMAUK', 'SIFMA_UK', "Capital_Markets_UK", "Financial_Markets_UK", "Bond_Markets_UK"]
14
+ # JP: SIFMAJPExchangeCalendar() ['SIFMAJP', 'SIFMA_JP', "Capital_Markets_JP", "Financial_Markets_JP", "Bond_Markets_JP"]
15
+ #
16
+ # Trading Hours:
17
+ # US: 7:00 to 17:30
18
+ # UK: 8:00 to 17:00
19
+ # JP: 8:30 to 18:30
20
+ ########################################################################################################################
21
+
22
+
23
+ from pandas_market_calendars.holidays.sifma import (
24
+ # US Holidays
25
+ USNewYearsDay, # Not observed if a Saturday
26
+ USNewYearsEve2pmEarlyClose,
27
+ MartinLutherKingJr,
28
+ USPresidentsDay,
29
+ GoodFridayThru2020,
30
+ DayBeforeGoodFriday2pmEarlyCloseThru2020,
31
+ GoodFridayAdHoc,
32
+ GoodFriday2pmEarlyCloseAdHoc,
33
+ DayBeforeGoodFriday2pmEarlyCloseAdHoc,
34
+ DayBeforeUSMemorialDay2pmEarlyClose,
35
+ USMemorialDay,
36
+ USJuneteenthAfter2022,
37
+ USIndependenceDay,
38
+ DayBeforeUSIndependenceDay2pmEarlyClose,
39
+ ThursdayBeforeUSIndependenceDay2pmEarlyClose,
40
+ USLaborDay,
41
+ USColumbusDay,
42
+ USVeteransDay2022,
43
+ USVeteransDay,
44
+ USThanksgivingDay,
45
+ DayAfterThanksgiving2pmEarlyClose,
46
+ Christmas,
47
+ ChristmasEve2pmEarlyClose,
48
+ ChristmasEveThursday2pmEarlyClose,
49
+ # UK Specific Holidays
50
+ UKNewYearsDay, # Saturdays observed on Monday
51
+ UKGoodFriday,
52
+ UKEasterMonday,
53
+ UKMayDay,
54
+ UKSpringBankAdHoc, # Usually follows US Memorial Day but not always
55
+ UKSummerBank,
56
+ UKChristmas,
57
+ UKChristmaEve,
58
+ UKWeekendChristmas, # Observed Tuesday when Boxing Day is on Monday
59
+ UKBoxingDay,
60
+ UKWeekendBoxingDay,
61
+ UKPlatinumJubilee2022,
62
+ )
63
+ from pandas_market_calendars.market_calendar import MarketCalendar
64
+
65
+
66
+ ########################################################################################################################
67
+ # SIFMA Financial Markets Calendar for US, UK, JP
68
+ #
69
+ # https://www.sifma.com/
70
+ #
71
+ # US: SIFMAUSExchangeCalendar() ['SIFMAUS', 'SIFMA_US', "Capital_Markets_US", "Financial_Markets_US", "Bond_Markets_US"]
72
+ # UK: SIFMAUKExchangeCalendar() ['SIFMAUK', 'SIFMA_UK', "Capital_Markets_UK", "Financial_Markets_UK", "Bond_Markets_UK"]
73
+ # JP: SIFMAJPExchangeCalendar() ['SIFMAJP', 'SIFMA_JP', "Capital_Markets_JP", "Financial_Markets_JP", "Bond_Markets_JP"]
74
+ #
75
+ # Trading Hours:
76
+ # US: 7:00 to 17:30
77
+ # UK: 8:00 to 17:00
78
+ # JP: 8:30 to 18:30
79
+ ########################################################################################################################
80
+
81
+ # AbstractHolidayCalendar.start_date = '1998-01-01'
82
+
83
+ ############################################################
84
+ # US
85
+ ############################################################
86
+
87
+
88
+ class SIFMAUSExchangeCalendar(MarketCalendar):
89
+ """
90
+ Exchange calendar for SIFMA United States
91
+
92
+ https://www.sifma.org/resources/general/holiday-schedule/#US
93
+
94
+ """
95
+
96
+ aliases = [
97
+ "SIFMAUS",
98
+ "SIFMA_US",
99
+ "Capital_Markets_US",
100
+ "Financial_Markets_US",
101
+ "Bond_Markets_US",
102
+ ]
103
+
104
+ regular_market_times = {
105
+ "market_open": ((None, time(7)),),
106
+ "market_close": ((None, time(17, 30)),),
107
+ }
108
+
109
+ @property
110
+ def name(self):
111
+ return "SIFMA_US"
112
+
113
+ @property
114
+ def tz(self):
115
+ return timezone("America/New_York")
116
+
117
+ @property
118
+ def regular_holidays(self):
119
+ return AbstractHolidayCalendar(
120
+ rules=[
121
+ USNewYearsDay,
122
+ MartinLutherKingJr,
123
+ USPresidentsDay,
124
+ GoodFridayThru2020,
125
+ USMemorialDay,
126
+ USJuneteenthAfter2022,
127
+ USIndependenceDay,
128
+ USLaborDay,
129
+ USColumbusDay,
130
+ USVeteransDay2022,
131
+ USVeteransDay,
132
+ USThanksgivingDay,
133
+ Christmas,
134
+ ]
135
+ )
136
+
137
+ @property
138
+ def adhoc_holidays(self):
139
+ return list(
140
+ chain(
141
+ GoodFridayAdHoc,
142
+ )
143
+ )
144
+
145
+ @property
146
+ def special_closes(self):
147
+ return [
148
+ (
149
+ time(14),
150
+ AbstractHolidayCalendar(
151
+ rules=[
152
+ DayBeforeGoodFriday2pmEarlyCloseThru2020,
153
+ DayBeforeUSMemorialDay2pmEarlyClose,
154
+ DayBeforeUSIndependenceDay2pmEarlyClose,
155
+ ThursdayBeforeUSIndependenceDay2pmEarlyClose,
156
+ DayAfterThanksgiving2pmEarlyClose,
157
+ ChristmasEve2pmEarlyClose,
158
+ ChristmasEveThursday2pmEarlyClose,
159
+ USNewYearsEve2pmEarlyClose,
160
+ ]
161
+ ),
162
+ )
163
+ ]
164
+
165
+ @property
166
+ def special_closes_adhoc(self):
167
+ return [
168
+ (
169
+ time(14, tzinfo=timezone("America/New_York")),
170
+ GoodFriday2pmEarlyCloseAdHoc # list
171
+ + DayBeforeGoodFriday2pmEarlyCloseAdHoc,
172
+ ),
173
+ ]
174
+
175
+
176
+ ############################################################
177
+ # UK
178
+ ############################################################
179
+
180
+
181
+ class SIFMAUKExchangeCalendar(MarketCalendar):
182
+ """
183
+ Exchange calendar for SIFMA United Kingdom
184
+
185
+ https://www.sifma.org/resources/general/holiday-schedule/#UK
186
+
187
+ """
188
+
189
+ aliases = [
190
+ "SIFMAUK",
191
+ "SIFMA_UK",
192
+ "Capital_Markets_UK",
193
+ "Financial_Markets_UK",
194
+ "Bond_Markets_UK",
195
+ ]
196
+
197
+ regular_market_times = {
198
+ "market_open": ((None, time(8)),),
199
+ "market_close": ((None, time(17)),),
200
+ }
201
+
202
+ @property
203
+ def name(self):
204
+ return "SIFMA_UK"
205
+
206
+ @property
207
+ def tz(self):
208
+ return timezone("Europe/London")
209
+
210
+ @property
211
+ def regular_holidays(self):
212
+ return AbstractHolidayCalendar(
213
+ rules=[
214
+ UKNewYearsDay,
215
+ MartinLutherKingJr,
216
+ USPresidentsDay,
217
+ UKGoodFriday,
218
+ UKEasterMonday,
219
+ UKMayDay,
220
+ USMemorialDay,
221
+ USJuneteenthAfter2022,
222
+ USIndependenceDay,
223
+ UKSummerBank,
224
+ USLaborDay,
225
+ USColumbusDay,
226
+ USVeteransDay2022,
227
+ USVeteransDay,
228
+ USThanksgivingDay,
229
+ UKChristmas,
230
+ UKChristmaEve,
231
+ UKWeekendChristmas,
232
+ UKBoxingDay,
233
+ UKWeekendBoxingDay,
234
+ ]
235
+ )
236
+
237
+ @property
238
+ def adhoc_holidays(self):
239
+ return list(
240
+ chain(
241
+ UKSpringBankAdHoc,
242
+ UKPlatinumJubilee2022,
243
+ )
244
+ )
245
+
246
+
247
+ ############################################################
248
+ # Japan
249
+ ############################################################
250
+ from pandas_market_calendars.holidays.jp import (
251
+ JapanComingOfAgeDay,
252
+ JapanNationalFoundationDay,
253
+ JapanEmperorsBirthday,
254
+ JapanVernalEquinox,
255
+ JapanShowaDay,
256
+ JapanConstitutionMemorialDay,
257
+ JapanGreeneryDay,
258
+ JapanChildrensDay,
259
+ JapanMarineDay,
260
+ JapanMountainDay,
261
+ JapanRespectForTheAgedDay,
262
+ JapanAutumnalEquinox,
263
+ JapanHealthAndSportsDay2000To2019,
264
+ JapanSportsDay2020,
265
+ JapanSportsDay,
266
+ JapanCultureDay,
267
+ JapanLaborThanksgivingDay,
268
+ )
269
+
270
+
271
+ class SIFMAJPExchangeCalendar(MarketCalendar):
272
+ """
273
+ Exchange calendar for SIFMA Japan
274
+
275
+ https://www.sifma.org/resources/general/holiday-schedule/#JP
276
+
277
+ """
278
+
279
+ aliases = [
280
+ "SIFMAJP",
281
+ "SIFMA_JP",
282
+ "Capital_Markets_JP",
283
+ "Financial_Markets_JP",
284
+ "Bond_Markets_JP",
285
+ ]
286
+
287
+ regular_market_times = {
288
+ "market_open": ((None, time(8, 30)),),
289
+ "market_close": ((None, time(18, 30)),),
290
+ }
291
+
292
+ @property
293
+ def name(self):
294
+ return "SIFMA_JP"
295
+
296
+ @property
297
+ def tz(self):
298
+ return timezone("Asia/Tokyo")
299
+
300
+ @property
301
+ def regular_holidays(self):
302
+ return AbstractHolidayCalendar(
303
+ rules=[
304
+ UKNewYearsDay,
305
+ JapanComingOfAgeDay,
306
+ MartinLutherKingJr,
307
+ JapanNationalFoundationDay,
308
+ USPresidentsDay,
309
+ JapanEmperorsBirthday,
310
+ JapanVernalEquinox,
311
+ UKGoodFriday,
312
+ UKEasterMonday,
313
+ JapanShowaDay,
314
+ JapanConstitutionMemorialDay,
315
+ JapanGreeneryDay,
316
+ JapanChildrensDay,
317
+ USMemorialDay,
318
+ USJuneteenthAfter2022,
319
+ USIndependenceDay,
320
+ JapanMarineDay,
321
+ JapanMountainDay,
322
+ UKSummerBank,
323
+ USLaborDay,
324
+ JapanRespectForTheAgedDay,
325
+ JapanAutumnalEquinox,
326
+ JapanSportsDay,
327
+ JapanSportsDay2020,
328
+ JapanHealthAndSportsDay2000To2019,
329
+ JapanCultureDay,
330
+ USVeteransDay2022,
331
+ USVeteransDay,
332
+ JapanLaborThanksgivingDay,
333
+ USThanksgivingDay,
334
+ UKChristmas,
335
+ UKChristmaEve,
336
+ UKBoxingDay,
337
+ UKWeekendBoxingDay,
338
+ ]
339
+ )
340
+
341
+ @property
342
+ def adhoc_holidays(self):
343
+ return list(
344
+ chain(
345
+ UKSpringBankAdHoc,
346
+ UKPlatinumJubilee2022,
347
+ )
348
+ )
349
+
350
+ @property
351
+ def special_closes(self):
352
+ return [
353
+ (time(15), AbstractHolidayCalendar(rules=[UKMayDay, UKWeekendChristmas]))
354
+ ]