pandas-market-calendars 4.3.2__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.
- pandas_market_calendars/__init__.py +38 -38
- pandas_market_calendars/calendar_registry.py +53 -52
- pandas_market_calendars/calendar_utils.py +261 -261
- pandas_market_calendars/calendars/asx.py +66 -66
- pandas_market_calendars/calendars/bmf.py +206 -206
- pandas_market_calendars/calendars/bse.py +407 -407
- pandas_market_calendars/calendars/cboe.py +145 -145
- pandas_market_calendars/calendars/cme.py +402 -402
- pandas_market_calendars/calendars/cme_globex_agriculture.py +126 -127
- pandas_market_calendars/calendars/cme_globex_base.py +119 -119
- pandas_market_calendars/calendars/cme_globex_crypto.py +160 -147
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
- pandas_market_calendars/calendars/cme_globex_equities.py +123 -121
- pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -134
- pandas_market_calendars/calendars/cme_globex_fx.py +101 -92
- pandas_market_calendars/calendars/eurex.py +139 -139
- pandas_market_calendars/calendars/eurex_fixed_income.py +98 -0
- pandas_market_calendars/calendars/hkex.py +426 -426
- pandas_market_calendars/calendars/ice.py +81 -81
- pandas_market_calendars/calendars/iex.py +112 -111
- pandas_market_calendars/calendars/jpx.py +109 -109
- pandas_market_calendars/calendars/lse.py +114 -114
- pandas_market_calendars/calendars/mirror.py +130 -129
- pandas_market_calendars/calendars/nyse.py +1324 -1324
- pandas_market_calendars/calendars/ose.py +116 -116
- pandas_market_calendars/calendars/sifma.py +350 -335
- pandas_market_calendars/calendars/six.py +132 -132
- pandas_market_calendars/calendars/sse.py +311 -311
- pandas_market_calendars/calendars/tase.py +197 -195
- pandas_market_calendars/calendars/tsx.py +181 -181
- pandas_market_calendars/holidays/cme.py +385 -372
- pandas_market_calendars/holidays/cme_globex.py +214 -223
- pandas_market_calendars/holidays/cn.py +1455 -1455
- pandas_market_calendars/holidays/jp.py +398 -394
- pandas_market_calendars/holidays/nyse.py +1531 -1539
- pandas_market_calendars/holidays/oz.py +63 -65
- pandas_market_calendars/holidays/sifma.py +338 -350
- pandas_market_calendars/holidays/us.py +376 -377
- pandas_market_calendars/market_calendar.py +895 -895
- {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/METADATA +3 -3
- pandas_market_calendars-4.3.3.dist-info/RECORD +50 -0
- pandas_market_calendars-4.3.2.dist-info/RECORD +0 -49
- {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/LICENSE +0 -0
- {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/NOTICE +0 -0
- {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/WHEEL +0 -0
- {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/top_level.txt +0 -0
@@ -1,127 +1,126 @@
|
|
1
|
-
#
|
2
|
-
# Copyright 2016 Quantopian, Inc.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
|
16
|
-
from abc import abstractmethod
|
17
|
-
from
|
18
|
-
|
19
|
-
from
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
@
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
"
|
79
|
-
"
|
80
|
-
"
|
81
|
-
"
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
"
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
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
|
-
]
|
1
|
+
#
|
2
|
+
# Copyright 2016 Quantopian, Inc.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
from abc import abstractmethod
|
17
|
+
from datetime import time
|
18
|
+
|
19
|
+
from pandas.tseries.holiday import (
|
20
|
+
AbstractHolidayCalendar,
|
21
|
+
GoodFriday,
|
22
|
+
USLaborDay,
|
23
|
+
USPresidentsDay,
|
24
|
+
USThanksgivingDay,
|
25
|
+
)
|
26
|
+
|
27
|
+
from pandas_market_calendars.holidays.us import (
|
28
|
+
Christmas,
|
29
|
+
ChristmasEveBefore1993,
|
30
|
+
ChristmasEveInOrAfter1993,
|
31
|
+
USBlackFridayInOrAfter1993,
|
32
|
+
USIndependenceDay,
|
33
|
+
USMartinLutherKingJrAfter1998,
|
34
|
+
USMemorialDay,
|
35
|
+
USNewYearsDay,
|
36
|
+
)
|
37
|
+
from .cme_globex_base import CMEGlobexBaseExchangeCalendar
|
38
|
+
|
39
|
+
|
40
|
+
class CMEGlobexAgricultureExchangeCalendar(CMEGlobexBaseExchangeCalendar):
|
41
|
+
"""
|
42
|
+
Exchange calendar for CME for Agriculture products
|
43
|
+
|
44
|
+
Products:
|
45
|
+
- Grains and Oilseeds (same trading hours and holidays)
|
46
|
+
- Livestock
|
47
|
+
- Dairy
|
48
|
+
- Fertilizer
|
49
|
+
- Lumber and Softs
|
50
|
+
|
51
|
+
|
52
|
+
"""
|
53
|
+
|
54
|
+
@property
|
55
|
+
@abstractmethod
|
56
|
+
def name(self):
|
57
|
+
"""
|
58
|
+
Name of the market
|
59
|
+
|
60
|
+
:return: string name
|
61
|
+
"""
|
62
|
+
raise NotImplementedError()
|
63
|
+
|
64
|
+
|
65
|
+
class CMEGlobexLivestockExchangeCalendar(CMEGlobexAgricultureExchangeCalendar):
|
66
|
+
"""
|
67
|
+
Exchange calendar for CME for Livestock products
|
68
|
+
|
69
|
+
https://www.cmegroup.com/trading/agricultural/livestock.html
|
70
|
+
|
71
|
+
GLOBEX Trading Times
|
72
|
+
https://www.cmegroup.com/markets/agriculture/livestock/live-cattle.contractSpecs.html
|
73
|
+
Monday - Friday: 8:30 a.m. - 1:05 p.m. CT
|
74
|
+
"""
|
75
|
+
|
76
|
+
aliases = [
|
77
|
+
"CMEGlobex_Livestock",
|
78
|
+
"CMEGlobex_Live_Cattle",
|
79
|
+
"CMEGlobex_Feeder_Cattle",
|
80
|
+
"CMEGlobex_Lean_Hog",
|
81
|
+
"CMEGlobex_Port_Cutout",
|
82
|
+
]
|
83
|
+
|
84
|
+
regular_market_times = {
|
85
|
+
"market_open": ((None, time(8, 30)),),
|
86
|
+
"market_close": ((None, time(13, 5)),),
|
87
|
+
}
|
88
|
+
|
89
|
+
@property
|
90
|
+
def name(self):
|
91
|
+
return "CMEGlobex_Livestock"
|
92
|
+
|
93
|
+
@property
|
94
|
+
def regular_holidays(self):
|
95
|
+
return AbstractHolidayCalendar(
|
96
|
+
rules=[
|
97
|
+
USNewYearsDay,
|
98
|
+
USMartinLutherKingJrAfter1998,
|
99
|
+
USPresidentsDay,
|
100
|
+
GoodFriday,
|
101
|
+
USMemorialDay,
|
102
|
+
USIndependenceDay,
|
103
|
+
USLaborDay,
|
104
|
+
USThanksgivingDay,
|
105
|
+
Christmas,
|
106
|
+
]
|
107
|
+
)
|
108
|
+
|
109
|
+
# @property
|
110
|
+
# def adhoc_holidays(self):
|
111
|
+
# return USNationalDaysofMourning
|
112
|
+
|
113
|
+
@property
|
114
|
+
def special_closes(self):
|
115
|
+
return [
|
116
|
+
(
|
117
|
+
time(12, 5),
|
118
|
+
AbstractHolidayCalendar(
|
119
|
+
rules=[
|
120
|
+
USBlackFridayInOrAfter1993,
|
121
|
+
ChristmasEveBefore1993,
|
122
|
+
ChristmasEveInOrAfter1993,
|
123
|
+
]
|
124
|
+
),
|
125
|
+
)
|
126
|
+
]
|
@@ -1,119 +1,119 @@
|
|
1
|
-
#
|
2
|
-
# Copyright 2016 Quantopian, Inc.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
|
16
|
-
from abc import ABC, abstractmethod
|
17
|
-
|
18
|
-
from pandas.tseries.holiday import (
|
19
|
-
AbstractHolidayCalendar,
|
20
|
-
GoodFriday,
|
21
|
-
USLaborDay,
|
22
|
-
USPresidentsDay,
|
23
|
-
USThanksgivingDay,
|
24
|
-
)
|
25
|
-
from pytz import timezone
|
26
|
-
|
27
|
-
from pandas_market_calendars.holidays.us import (
|
28
|
-
Christmas,
|
29
|
-
ChristmasEveBefore1993,
|
30
|
-
ChristmasEveInOrAfter1993,
|
31
|
-
USBlackFridayInOrAfter1993,
|
32
|
-
USIndependenceDay,
|
33
|
-
USMartinLutherKingJrAfter1998,
|
34
|
-
USMemorialDay,
|
35
|
-
USJuneteenthAfter2022,
|
36
|
-
USNewYearsDay,
|
37
|
-
)
|
38
|
-
from pandas_market_calendars.market_calendar import MarketCalendar
|
39
|
-
|
40
|
-
|
41
|
-
class CMEGlobexBaseExchangeCalendar(MarketCalendar, ABC):
|
42
|
-
"""
|
43
|
-
Base Exchange Calendar for CME.
|
44
|
-
|
45
|
-
CME Markets: https://www.cmegroup.com/markets/agriculture.html#overview
|
46
|
-
- Agriculture
|
47
|
-
- Crypto
|
48
|
-
- Energy
|
49
|
-
- Equity Index
|
50
|
-
- FX
|
51
|
-
- Interest Rates
|
52
|
-
- Metals
|
53
|
-
- Options
|
54
|
-
|
55
|
-
Holiays for which entire GLOBEX is closed:
|
56
|
-
- New Years Day
|
57
|
-
- Good Friday
|
58
|
-
- Christmas
|
59
|
-
|
60
|
-
Product Specific Closures:
|
61
|
-
- MLK Day
|
62
|
-
- Presidents Day
|
63
|
-
- Memorial Day
|
64
|
-
- Juneteenth
|
65
|
-
- US Independence Day
|
66
|
-
- US Labor Day
|
67
|
-
- US Thanksgiving Day
|
68
|
-
"""
|
69
|
-
|
70
|
-
@property
|
71
|
-
@abstractmethod
|
72
|
-
def name(self):
|
73
|
-
"""
|
74
|
-
Name of the market
|
75
|
-
|
76
|
-
:return: string name
|
77
|
-
"""
|
78
|
-
raise NotImplementedError()
|
79
|
-
|
80
|
-
@property
|
81
|
-
def tz(self):
|
82
|
-
return timezone("America/Chicago")
|
83
|
-
|
84
|
-
@property
|
85
|
-
def regular_holidays(self):
|
86
|
-
return AbstractHolidayCalendar(
|
87
|
-
rules=[
|
88
|
-
USNewYearsDay,
|
89
|
-
GoodFriday,
|
90
|
-
Christmas,
|
91
|
-
]
|
92
|
-
)
|
93
|
-
|
94
|
-
# I can't find any reference to these special closings onther than NYSE
|
95
|
-
# @property
|
96
|
-
# def adhoc_holidays(self):
|
97
|
-
# return USNationalDaysofMourning
|
98
|
-
|
99
|
-
@property
|
100
|
-
def special_closes(self):
|
101
|
-
return [
|
102
|
-
(
|
103
|
-
self.special_close_time,
|
104
|
-
AbstractHolidayCalendar(
|
105
|
-
rules=[
|
106
|
-
USMartinLutherKingJrAfter1998,
|
107
|
-
USPresidentsDay,
|
108
|
-
USMemorialDay,
|
109
|
-
USJuneteenthAfter2022,
|
110
|
-
USLaborDay,
|
111
|
-
USIndependenceDay,
|
112
|
-
USThanksgivingDay,
|
113
|
-
USBlackFridayInOrAfter1993,
|
114
|
-
ChristmasEveBefore1993,
|
115
|
-
ChristmasEveInOrAfter1993,
|
116
|
-
]
|
117
|
-
),
|
118
|
-
)
|
119
|
-
]
|
1
|
+
#
|
2
|
+
# Copyright 2016 Quantopian, Inc.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
from abc import ABC, abstractmethod
|
17
|
+
|
18
|
+
from pandas.tseries.holiday import (
|
19
|
+
AbstractHolidayCalendar,
|
20
|
+
GoodFriday,
|
21
|
+
USLaborDay,
|
22
|
+
USPresidentsDay,
|
23
|
+
USThanksgivingDay,
|
24
|
+
)
|
25
|
+
from pytz import timezone
|
26
|
+
|
27
|
+
from pandas_market_calendars.holidays.us import (
|
28
|
+
Christmas,
|
29
|
+
ChristmasEveBefore1993,
|
30
|
+
ChristmasEveInOrAfter1993,
|
31
|
+
USBlackFridayInOrAfter1993,
|
32
|
+
USIndependenceDay,
|
33
|
+
USMartinLutherKingJrAfter1998,
|
34
|
+
USMemorialDay,
|
35
|
+
USJuneteenthAfter2022,
|
36
|
+
USNewYearsDay,
|
37
|
+
)
|
38
|
+
from pandas_market_calendars.market_calendar import MarketCalendar
|
39
|
+
|
40
|
+
|
41
|
+
class CMEGlobexBaseExchangeCalendar(MarketCalendar, ABC):
|
42
|
+
"""
|
43
|
+
Base Exchange Calendar for CME.
|
44
|
+
|
45
|
+
CME Markets: https://www.cmegroup.com/markets/agriculture.html#overview
|
46
|
+
- Agriculture
|
47
|
+
- Crypto
|
48
|
+
- Energy
|
49
|
+
- Equity Index
|
50
|
+
- FX
|
51
|
+
- Interest Rates
|
52
|
+
- Metals
|
53
|
+
- Options
|
54
|
+
|
55
|
+
Holiays for which entire GLOBEX is closed:
|
56
|
+
- New Years Day
|
57
|
+
- Good Friday
|
58
|
+
- Christmas
|
59
|
+
|
60
|
+
Product Specific Closures:
|
61
|
+
- MLK Day
|
62
|
+
- Presidents Day
|
63
|
+
- Memorial Day
|
64
|
+
- Juneteenth
|
65
|
+
- US Independence Day
|
66
|
+
- US Labor Day
|
67
|
+
- US Thanksgiving Day
|
68
|
+
"""
|
69
|
+
|
70
|
+
@property
|
71
|
+
@abstractmethod
|
72
|
+
def name(self):
|
73
|
+
"""
|
74
|
+
Name of the market
|
75
|
+
|
76
|
+
:return: string name
|
77
|
+
"""
|
78
|
+
raise NotImplementedError()
|
79
|
+
|
80
|
+
@property
|
81
|
+
def tz(self):
|
82
|
+
return timezone("America/Chicago")
|
83
|
+
|
84
|
+
@property
|
85
|
+
def regular_holidays(self):
|
86
|
+
return AbstractHolidayCalendar(
|
87
|
+
rules=[
|
88
|
+
USNewYearsDay,
|
89
|
+
GoodFriday,
|
90
|
+
Christmas,
|
91
|
+
]
|
92
|
+
)
|
93
|
+
|
94
|
+
# I can't find any reference to these special closings onther than NYSE
|
95
|
+
# @property
|
96
|
+
# def adhoc_holidays(self):
|
97
|
+
# return USNationalDaysofMourning
|
98
|
+
|
99
|
+
@property
|
100
|
+
def special_closes(self):
|
101
|
+
return [
|
102
|
+
(
|
103
|
+
self.special_close_time,
|
104
|
+
AbstractHolidayCalendar(
|
105
|
+
rules=[
|
106
|
+
USMartinLutherKingJrAfter1998,
|
107
|
+
USPresidentsDay,
|
108
|
+
USMemorialDay,
|
109
|
+
USJuneteenthAfter2022,
|
110
|
+
USLaborDay,
|
111
|
+
USIndependenceDay,
|
112
|
+
USThanksgivingDay,
|
113
|
+
USBlackFridayInOrAfter1993,
|
114
|
+
ChristmasEveBefore1993,
|
115
|
+
ChristmasEveInOrAfter1993,
|
116
|
+
]
|
117
|
+
),
|
118
|
+
)
|
119
|
+
]
|