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.
- pandas_market_calendars/__init__.py +38 -38
- pandas_market_calendars/calendar_registry.py +57 -57
- pandas_market_calendars/calendar_utils.py +262 -262
- pandas_market_calendars/calendars/asx.py +66 -66
- pandas_market_calendars/calendars/bmf.py +223 -223
- pandas_market_calendars/calendars/bse.py +421 -421
- pandas_market_calendars/calendars/cboe.py +145 -145
- pandas_market_calendars/calendars/cme.py +405 -405
- pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
- pandas_market_calendars/calendars/cme_globex_base.py +119 -119
- pandas_market_calendars/calendars/cme_globex_crypto.py +160 -160
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
- pandas_market_calendars/calendars/cme_globex_equities.py +123 -123
- pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -136
- pandas_market_calendars/calendars/cme_globex_fx.py +101 -101
- pandas_market_calendars/calendars/eurex.py +131 -131
- pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
- pandas_market_calendars/calendars/hkex.py +429 -429
- pandas_market_calendars/calendars/ice.py +81 -81
- pandas_market_calendars/calendars/iex.py +112 -112
- pandas_market_calendars/calendars/jpx.py +113 -113
- pandas_market_calendars/calendars/lse.py +114 -114
- pandas_market_calendars/calendars/mirror.py +149 -149
- pandas_market_calendars/calendars/nyse.py +1327 -1324
- pandas_market_calendars/calendars/ose.py +116 -116
- pandas_market_calendars/calendars/sifma.py +354 -354
- pandas_market_calendars/calendars/six.py +132 -132
- pandas_market_calendars/calendars/sse.py +311 -311
- pandas_market_calendars/calendars/tase.py +197 -197
- pandas_market_calendars/calendars/tsx.py +181 -181
- pandas_market_calendars/holidays/cme.py +385 -385
- pandas_market_calendars/holidays/cme_globex.py +214 -214
- pandas_market_calendars/holidays/cn.py +1456 -1456
- pandas_market_calendars/holidays/jp.py +401 -401
- pandas_market_calendars/holidays/jpx_equinox.py +506 -506
- pandas_market_calendars/holidays/nyse.py +1536 -1531
- pandas_market_calendars/holidays/oz.py +63 -63
- pandas_market_calendars/holidays/sifma.py +350 -350
- pandas_market_calendars/holidays/us.py +376 -376
- pandas_market_calendars/market_calendar.py +941 -922
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/METADATA +1 -1
- pandas_market_calendars-4.5.0.dist-info/RECORD +50 -0
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/WHEEL +1 -1
- pandas_market_calendars-4.4.2.dist-info/RECORD +0 -50
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/LICENSE +0 -0
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/NOTICE +0 -0
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.0.dist-info}/top_level.txt +0 -0
@@ -1,160 +1,160 @@
|
|
1
|
-
import datetime as dt
|
2
|
-
|
3
|
-
import pytz
|
4
|
-
from pandas.tseries.holiday import AbstractHolidayCalendar
|
5
|
-
|
6
|
-
from pandas_market_calendars.holidays.cme import (
|
7
|
-
GoodFriday2021,
|
8
|
-
GoodFriday2022,
|
9
|
-
GoodFridayAfter2022,
|
10
|
-
GoodFridayBefore2021,
|
11
|
-
USIndependenceDayBefore2022PreviousDay,
|
12
|
-
)
|
13
|
-
from pandas_market_calendars.holidays.cme_globex import (
|
14
|
-
ChristmasCME,
|
15
|
-
USMartinLutherKingJrFrom2022,
|
16
|
-
USMartinLutherKingJrPre2022,
|
17
|
-
USPresidentsDayFrom2022,
|
18
|
-
USPresidentsDayPre2022,
|
19
|
-
USMemorialDayFrom2022,
|
20
|
-
USMemorialDayPre2022,
|
21
|
-
USJuneteenthFrom2022,
|
22
|
-
USIndependenceDayFrom2022,
|
23
|
-
USIndependenceDayPre2022,
|
24
|
-
USLaborDayFrom2022,
|
25
|
-
USLaborDayPre2022,
|
26
|
-
USThanksgivingDayFrom2022,
|
27
|
-
USThanksgivingDayPre2022,
|
28
|
-
USThanksgivingFridayFrom2021,
|
29
|
-
USThanksgivingFridayPre2021,
|
30
|
-
)
|
31
|
-
from pandas_market_calendars.holidays.us import (
|
32
|
-
ChristmasEveInOrAfter1993,
|
33
|
-
USNewYearsDay,
|
34
|
-
)
|
35
|
-
from .cme_globex_base import CMEGlobexBaseExchangeCalendar
|
36
|
-
|
37
|
-
|
38
|
-
# https://github.com/rsheftel/pandas_market_calendars/blob/master/docs/new_market.rst
|
39
|
-
class CMEGlobexCryptoExchangeCalendar(CMEGlobexBaseExchangeCalendar):
|
40
|
-
# The label you fetch the exchange with in mcal.get_calendar('CME Globex ...')
|
41
|
-
aliases = ["CME Globex Cryptocurrencies", "CME Globex Crypto"]
|
42
|
-
|
43
|
-
# https://www.cmegroup.com/markets/cryptocurrencies/bitcoin/bitcoin.contractSpecs.html
|
44
|
-
regular_market_times = {
|
45
|
-
# Tuple[Tuple[first date used, time, offset], ...]
|
46
|
-
# -1 offset indicates that the open is on the previous day
|
47
|
-
# None for first date used marks the start, subsequent market times must have an actual timestamp
|
48
|
-
"market_open": (
|
49
|
-
(None, dt.time(17, tzinfo=pytz.timezone("America/Chicago")), -1),
|
50
|
-
),
|
51
|
-
"market_close": (
|
52
|
-
(
|
53
|
-
None,
|
54
|
-
dt.time(16, tzinfo=pytz.timezone("America/Chicago")),
|
55
|
-
),
|
56
|
-
),
|
57
|
-
"break_start": (
|
58
|
-
(
|
59
|
-
None,
|
60
|
-
dt.time(16, tzinfo=pytz.timezone("America/Chicago")),
|
61
|
-
),
|
62
|
-
),
|
63
|
-
"break_end": (
|
64
|
-
(
|
65
|
-
None,
|
66
|
-
dt.time(17, tzinfo=pytz.timezone("America/Chicago")),
|
67
|
-
),
|
68
|
-
),
|
69
|
-
}
|
70
|
-
|
71
|
-
@property
|
72
|
-
def tz(self):
|
73
|
-
# Central Time
|
74
|
-
return pytz.timezone("America/Chicago")
|
75
|
-
|
76
|
-
@property
|
77
|
-
def name(self):
|
78
|
-
return "CME Globex Crypto"
|
79
|
-
|
80
|
-
# Check the .zip files at the bottom of this page
|
81
|
-
# https://www.cmegroup.com/tools-information/holiday-calendar.html?redirect=/tools-information/holiday-calendar/#cmeGlobex
|
82
|
-
# Note: many of the holiday objects (ie. GoodFridayBefore2021) were originally made for equities and other markets
|
83
|
-
# and hence have a start_date starting before crypto is actually available
|
84
|
-
|
85
|
-
@property
|
86
|
-
def regular_holidays(self):
|
87
|
-
# Days where the market is fully closed
|
88
|
-
return AbstractHolidayCalendar(
|
89
|
-
rules=[
|
90
|
-
GoodFridayBefore2021,
|
91
|
-
GoodFriday2022,
|
92
|
-
ChristmasCME,
|
93
|
-
USNewYearsDay,
|
94
|
-
]
|
95
|
-
)
|
96
|
-
|
97
|
-
@property
|
98
|
-
def special_closes(self):
|
99
|
-
# Days where the market closes early
|
100
|
-
# list[Tuple[time, AbstractHolidayCalendar]]
|
101
|
-
return [
|
102
|
-
(
|
103
|
-
dt.time(8, 15, tzinfo=pytz.timezone("America/Chicago")),
|
104
|
-
AbstractHolidayCalendar(
|
105
|
-
rules=[
|
106
|
-
GoodFriday2021,
|
107
|
-
]
|
108
|
-
),
|
109
|
-
),
|
110
|
-
(
|
111
|
-
dt.time(10, 15, tzinfo=pytz.timezone("America/Chicago")),
|
112
|
-
AbstractHolidayCalendar(
|
113
|
-
rules=[
|
114
|
-
GoodFridayAfter2022,
|
115
|
-
]
|
116
|
-
),
|
117
|
-
),
|
118
|
-
(
|
119
|
-
dt.time(12, tzinfo=pytz.timezone("America/Chicago")),
|
120
|
-
AbstractHolidayCalendar(
|
121
|
-
rules=[
|
122
|
-
USMartinLutherKingJrPre2022,
|
123
|
-
USPresidentsDayPre2022,
|
124
|
-
USMemorialDayPre2022,
|
125
|
-
USIndependenceDayPre2022,
|
126
|
-
USLaborDayPre2022,
|
127
|
-
USThanksgivingDayPre2022,
|
128
|
-
]
|
129
|
-
),
|
130
|
-
),
|
131
|
-
(
|
132
|
-
dt.time(12, 15, tzinfo=pytz.timezone("America/Chicago")),
|
133
|
-
AbstractHolidayCalendar(
|
134
|
-
rules=[
|
135
|
-
ChristmasEveInOrAfter1993,
|
136
|
-
USIndependenceDayBefore2022PreviousDay,
|
137
|
-
USThanksgivingFridayPre2021,
|
138
|
-
]
|
139
|
-
),
|
140
|
-
),
|
141
|
-
(
|
142
|
-
dt.time(12, 45, tzinfo=pytz.timezone("America/Chicago")),
|
143
|
-
AbstractHolidayCalendar(rules=[USThanksgivingFridayFrom2021]),
|
144
|
-
),
|
145
|
-
# TODO: this market already closes at 1600 normally, do we need these holidays?
|
146
|
-
(
|
147
|
-
dt.time(16, tzinfo=pytz.timezone("America/Chicago")),
|
148
|
-
AbstractHolidayCalendar(
|
149
|
-
rules=[
|
150
|
-
USMartinLutherKingJrFrom2022,
|
151
|
-
USPresidentsDayFrom2022,
|
152
|
-
USMemorialDayFrom2022,
|
153
|
-
USJuneteenthFrom2022,
|
154
|
-
USIndependenceDayFrom2022,
|
155
|
-
USLaborDayFrom2022,
|
156
|
-
USThanksgivingDayFrom2022,
|
157
|
-
]
|
158
|
-
),
|
159
|
-
),
|
160
|
-
]
|
1
|
+
import datetime as dt
|
2
|
+
|
3
|
+
import pytz
|
4
|
+
from pandas.tseries.holiday import AbstractHolidayCalendar
|
5
|
+
|
6
|
+
from pandas_market_calendars.holidays.cme import (
|
7
|
+
GoodFriday2021,
|
8
|
+
GoodFriday2022,
|
9
|
+
GoodFridayAfter2022,
|
10
|
+
GoodFridayBefore2021,
|
11
|
+
USIndependenceDayBefore2022PreviousDay,
|
12
|
+
)
|
13
|
+
from pandas_market_calendars.holidays.cme_globex import (
|
14
|
+
ChristmasCME,
|
15
|
+
USMartinLutherKingJrFrom2022,
|
16
|
+
USMartinLutherKingJrPre2022,
|
17
|
+
USPresidentsDayFrom2022,
|
18
|
+
USPresidentsDayPre2022,
|
19
|
+
USMemorialDayFrom2022,
|
20
|
+
USMemorialDayPre2022,
|
21
|
+
USJuneteenthFrom2022,
|
22
|
+
USIndependenceDayFrom2022,
|
23
|
+
USIndependenceDayPre2022,
|
24
|
+
USLaborDayFrom2022,
|
25
|
+
USLaborDayPre2022,
|
26
|
+
USThanksgivingDayFrom2022,
|
27
|
+
USThanksgivingDayPre2022,
|
28
|
+
USThanksgivingFridayFrom2021,
|
29
|
+
USThanksgivingFridayPre2021,
|
30
|
+
)
|
31
|
+
from pandas_market_calendars.holidays.us import (
|
32
|
+
ChristmasEveInOrAfter1993,
|
33
|
+
USNewYearsDay,
|
34
|
+
)
|
35
|
+
from .cme_globex_base import CMEGlobexBaseExchangeCalendar
|
36
|
+
|
37
|
+
|
38
|
+
# https://github.com/rsheftel/pandas_market_calendars/blob/master/docs/new_market.rst
|
39
|
+
class CMEGlobexCryptoExchangeCalendar(CMEGlobexBaseExchangeCalendar):
|
40
|
+
# The label you fetch the exchange with in mcal.get_calendar('CME Globex ...')
|
41
|
+
aliases = ["CME Globex Cryptocurrencies", "CME Globex Crypto"]
|
42
|
+
|
43
|
+
# https://www.cmegroup.com/markets/cryptocurrencies/bitcoin/bitcoin.contractSpecs.html
|
44
|
+
regular_market_times = {
|
45
|
+
# Tuple[Tuple[first date used, time, offset], ...]
|
46
|
+
# -1 offset indicates that the open is on the previous day
|
47
|
+
# None for first date used marks the start, subsequent market times must have an actual timestamp
|
48
|
+
"market_open": (
|
49
|
+
(None, dt.time(17, tzinfo=pytz.timezone("America/Chicago")), -1),
|
50
|
+
),
|
51
|
+
"market_close": (
|
52
|
+
(
|
53
|
+
None,
|
54
|
+
dt.time(16, tzinfo=pytz.timezone("America/Chicago")),
|
55
|
+
),
|
56
|
+
),
|
57
|
+
"break_start": (
|
58
|
+
(
|
59
|
+
None,
|
60
|
+
dt.time(16, tzinfo=pytz.timezone("America/Chicago")),
|
61
|
+
),
|
62
|
+
),
|
63
|
+
"break_end": (
|
64
|
+
(
|
65
|
+
None,
|
66
|
+
dt.time(17, tzinfo=pytz.timezone("America/Chicago")),
|
67
|
+
),
|
68
|
+
),
|
69
|
+
}
|
70
|
+
|
71
|
+
@property
|
72
|
+
def tz(self):
|
73
|
+
# Central Time
|
74
|
+
return pytz.timezone("America/Chicago")
|
75
|
+
|
76
|
+
@property
|
77
|
+
def name(self):
|
78
|
+
return "CME Globex Crypto"
|
79
|
+
|
80
|
+
# Check the .zip files at the bottom of this page
|
81
|
+
# https://www.cmegroup.com/tools-information/holiday-calendar.html?redirect=/tools-information/holiday-calendar/#cmeGlobex
|
82
|
+
# Note: many of the holiday objects (ie. GoodFridayBefore2021) were originally made for equities and other markets
|
83
|
+
# and hence have a start_date starting before crypto is actually available
|
84
|
+
|
85
|
+
@property
|
86
|
+
def regular_holidays(self):
|
87
|
+
# Days where the market is fully closed
|
88
|
+
return AbstractHolidayCalendar(
|
89
|
+
rules=[
|
90
|
+
GoodFridayBefore2021,
|
91
|
+
GoodFriday2022,
|
92
|
+
ChristmasCME,
|
93
|
+
USNewYearsDay,
|
94
|
+
]
|
95
|
+
)
|
96
|
+
|
97
|
+
@property
|
98
|
+
def special_closes(self):
|
99
|
+
# Days where the market closes early
|
100
|
+
# list[Tuple[time, AbstractHolidayCalendar]]
|
101
|
+
return [
|
102
|
+
(
|
103
|
+
dt.time(8, 15, tzinfo=pytz.timezone("America/Chicago")),
|
104
|
+
AbstractHolidayCalendar(
|
105
|
+
rules=[
|
106
|
+
GoodFriday2021,
|
107
|
+
]
|
108
|
+
),
|
109
|
+
),
|
110
|
+
(
|
111
|
+
dt.time(10, 15, tzinfo=pytz.timezone("America/Chicago")),
|
112
|
+
AbstractHolidayCalendar(
|
113
|
+
rules=[
|
114
|
+
GoodFridayAfter2022,
|
115
|
+
]
|
116
|
+
),
|
117
|
+
),
|
118
|
+
(
|
119
|
+
dt.time(12, tzinfo=pytz.timezone("America/Chicago")),
|
120
|
+
AbstractHolidayCalendar(
|
121
|
+
rules=[
|
122
|
+
USMartinLutherKingJrPre2022,
|
123
|
+
USPresidentsDayPre2022,
|
124
|
+
USMemorialDayPre2022,
|
125
|
+
USIndependenceDayPre2022,
|
126
|
+
USLaborDayPre2022,
|
127
|
+
USThanksgivingDayPre2022,
|
128
|
+
]
|
129
|
+
),
|
130
|
+
),
|
131
|
+
(
|
132
|
+
dt.time(12, 15, tzinfo=pytz.timezone("America/Chicago")),
|
133
|
+
AbstractHolidayCalendar(
|
134
|
+
rules=[
|
135
|
+
ChristmasEveInOrAfter1993,
|
136
|
+
USIndependenceDayBefore2022PreviousDay,
|
137
|
+
USThanksgivingFridayPre2021,
|
138
|
+
]
|
139
|
+
),
|
140
|
+
),
|
141
|
+
(
|
142
|
+
dt.time(12, 45, tzinfo=pytz.timezone("America/Chicago")),
|
143
|
+
AbstractHolidayCalendar(rules=[USThanksgivingFridayFrom2021]),
|
144
|
+
),
|
145
|
+
# TODO: this market already closes at 1600 normally, do we need these holidays?
|
146
|
+
(
|
147
|
+
dt.time(16, tzinfo=pytz.timezone("America/Chicago")),
|
148
|
+
AbstractHolidayCalendar(
|
149
|
+
rules=[
|
150
|
+
USMartinLutherKingJrFrom2022,
|
151
|
+
USPresidentsDayFrom2022,
|
152
|
+
USMemorialDayFrom2022,
|
153
|
+
USJuneteenthFrom2022,
|
154
|
+
USIndependenceDayFrom2022,
|
155
|
+
USLaborDayFrom2022,
|
156
|
+
USThanksgivingDayFrom2022,
|
157
|
+
]
|
158
|
+
),
|
159
|
+
),
|
160
|
+
]
|