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,181 +1,181 @@
|
|
1
|
-
from datetime import time
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
from
|
14
|
-
|
15
|
-
from pandas_market_calendars.holidays.uk import (
|
16
|
-
BoxingDay,
|
17
|
-
WeekendBoxingDay,
|
18
|
-
WeekendChristmas,
|
19
|
-
)
|
20
|
-
from pandas_market_calendars.market_calendar import (
|
21
|
-
MarketCalendar,
|
22
|
-
MONDAY,
|
23
|
-
TUESDAY,
|
24
|
-
WEDNESDAY,
|
25
|
-
THURSDAY,
|
26
|
-
FRIDAY,
|
27
|
-
)
|
28
|
-
|
29
|
-
# New Year's Day
|
30
|
-
TSXNewYearsDay = Holiday(
|
31
|
-
"New Year's Day",
|
32
|
-
month=1,
|
33
|
-
day=1,
|
34
|
-
observance=weekend_to_monday,
|
35
|
-
)
|
36
|
-
# Ontario Family Day
|
37
|
-
FamilyDay = Holiday(
|
38
|
-
"Family Day",
|
39
|
-
month=2,
|
40
|
-
day=1,
|
41
|
-
offset=DateOffset(weekday=MO(3)),
|
42
|
-
start_date="2008-01-01",
|
43
|
-
)
|
44
|
-
# Victoria Day
|
45
|
-
# https://www.timeanddate.com/holidays/canada/victoria-day
|
46
|
-
VictoriaDay = Holiday(
|
47
|
-
"Victoria Day",
|
48
|
-
month=5,
|
49
|
-
day=24,
|
50
|
-
offset=DateOffset(weekday=MO(-1)),
|
51
|
-
)
|
52
|
-
# Canada Day
|
53
|
-
CanadaDay = Holiday(
|
54
|
-
"Canada Day",
|
55
|
-
month=7,
|
56
|
-
day=1,
|
57
|
-
observance=weekend_to_monday,
|
58
|
-
)
|
59
|
-
# Civic Holiday
|
60
|
-
CivicHoliday = Holiday(
|
61
|
-
"Civic Holiday",
|
62
|
-
month=8,
|
63
|
-
day=1,
|
64
|
-
offset=DateOffset(weekday=MO(1)),
|
65
|
-
)
|
66
|
-
# Labor Day
|
67
|
-
LaborDay = Holiday(
|
68
|
-
"Labor Day",
|
69
|
-
month=9,
|
70
|
-
day=1,
|
71
|
-
offset=DateOffset(weekday=MO(1)),
|
72
|
-
)
|
73
|
-
# Thanksgiving
|
74
|
-
Thanksgiving = Holiday(
|
75
|
-
"Thanksgiving",
|
76
|
-
month=10,
|
77
|
-
day=1,
|
78
|
-
offset=DateOffset(weekday=MO(2)),
|
79
|
-
)
|
80
|
-
|
81
|
-
Christmas = Holiday(
|
82
|
-
"Christmas",
|
83
|
-
month=12,
|
84
|
-
day=25,
|
85
|
-
)
|
86
|
-
|
87
|
-
ChristmasEveEarlyClose2010Onwards = Holiday(
|
88
|
-
"Christmas Eve Early Close",
|
89
|
-
month=12,
|
90
|
-
day=24,
|
91
|
-
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
92
|
-
start_date=pd.Timestamp("2010-01-01"),
|
93
|
-
)
|
94
|
-
|
95
|
-
September11Closings2001 = [
|
96
|
-
pd.Timestamp("2001-09-11", tz="UTC"),
|
97
|
-
pd.Timestamp("2001-09-12", tz="UTC"),
|
98
|
-
]
|
99
|
-
|
100
|
-
|
101
|
-
class TSXExchangeCalendar(MarketCalendar):
|
102
|
-
"""
|
103
|
-
Exchange calendar for the Toronto Stock Exchange
|
104
|
-
|
105
|
-
Open Time: 9:30 AM, EST
|
106
|
-
Close Time: 4:00 PM, EST
|
107
|
-
|
108
|
-
Regularly-Observed Holidays:
|
109
|
-
- New Years Day (observed on first business day on/after)
|
110
|
-
- Family Day (Third Monday in February, starting in 2008)
|
111
|
-
- Good Friday
|
112
|
-
- Victoria Day (Monday before May 25th)
|
113
|
-
- Canada Day (July 1st, observed first business day after)
|
114
|
-
- Civic Holiday (First Monday in August)
|
115
|
-
- Labor Day (First Monday in September)
|
116
|
-
- Thanksgiving (Second Monday in October)
|
117
|
-
- Christmas Day
|
118
|
-
- Dec. 26th if Christmas is on a Sunday
|
119
|
-
- Dec. 27th if Christmas is on a weekend
|
120
|
-
- Boxing Day
|
121
|
-
- Dec. 27th if Christmas is on a Sunday
|
122
|
-
- Dec. 28th if Boxing Day is on a weekend
|
123
|
-
|
124
|
-
Early closes:
|
125
|
-
- Starting in 2010, if Christmas Eve falls on a weekday, the market
|
126
|
-
closes at 1:00 pm that day. If it falls on a weekend, there is no
|
127
|
-
early close.
|
128
|
-
"""
|
129
|
-
|
130
|
-
aliases = ["TSX", "TSXV"]
|
131
|
-
|
132
|
-
regular_market_times = {
|
133
|
-
"market_open": ((None, time(9, 30)),),
|
134
|
-
"market_close": ((None, time(16)),),
|
135
|
-
}
|
136
|
-
|
137
|
-
@property
|
138
|
-
def name(self):
|
139
|
-
return "TSX"
|
140
|
-
|
141
|
-
@property
|
142
|
-
def tz(self):
|
143
|
-
return timezone("Canada/Eastern")
|
144
|
-
|
145
|
-
regular_early_close = time(13)
|
146
|
-
|
147
|
-
@property
|
148
|
-
def regular_holidays(self):
|
149
|
-
return AbstractHolidayCalendar(
|
150
|
-
rules=[
|
151
|
-
TSXNewYearsDay,
|
152
|
-
FamilyDay,
|
153
|
-
GoodFriday,
|
154
|
-
VictoriaDay,
|
155
|
-
CanadaDay,
|
156
|
-
CivicHoliday,
|
157
|
-
LaborDay,
|
158
|
-
Thanksgiving,
|
159
|
-
Christmas,
|
160
|
-
WeekendChristmas,
|
161
|
-
BoxingDay,
|
162
|
-
WeekendBoxingDay,
|
163
|
-
]
|
164
|
-
)
|
165
|
-
|
166
|
-
@property
|
167
|
-
def adhoc_holidays(self):
|
168
|
-
return list(
|
169
|
-
chain(
|
170
|
-
September11Closings2001,
|
171
|
-
)
|
172
|
-
)
|
173
|
-
|
174
|
-
@property
|
175
|
-
def special_closes(self):
|
176
|
-
return [
|
177
|
-
(
|
178
|
-
self.regular_early_close,
|
179
|
-
AbstractHolidayCalendar([ChristmasEveEarlyClose2010Onwards]),
|
180
|
-
)
|
181
|
-
]
|
1
|
+
from datetime import time
|
2
|
+
from itertools import chain
|
3
|
+
|
4
|
+
import pandas as pd
|
5
|
+
from pandas.tseries.holiday import (
|
6
|
+
AbstractHolidayCalendar,
|
7
|
+
DateOffset,
|
8
|
+
GoodFriday,
|
9
|
+
Holiday,
|
10
|
+
MO,
|
11
|
+
weekend_to_monday,
|
12
|
+
)
|
13
|
+
from pytz import timezone
|
14
|
+
|
15
|
+
from pandas_market_calendars.holidays.uk import (
|
16
|
+
BoxingDay,
|
17
|
+
WeekendBoxingDay,
|
18
|
+
WeekendChristmas,
|
19
|
+
)
|
20
|
+
from pandas_market_calendars.market_calendar import (
|
21
|
+
MarketCalendar,
|
22
|
+
MONDAY,
|
23
|
+
TUESDAY,
|
24
|
+
WEDNESDAY,
|
25
|
+
THURSDAY,
|
26
|
+
FRIDAY,
|
27
|
+
)
|
28
|
+
|
29
|
+
# New Year's Day
|
30
|
+
TSXNewYearsDay = Holiday(
|
31
|
+
"New Year's Day",
|
32
|
+
month=1,
|
33
|
+
day=1,
|
34
|
+
observance=weekend_to_monday,
|
35
|
+
)
|
36
|
+
# Ontario Family Day
|
37
|
+
FamilyDay = Holiday(
|
38
|
+
"Family Day",
|
39
|
+
month=2,
|
40
|
+
day=1,
|
41
|
+
offset=DateOffset(weekday=MO(3)),
|
42
|
+
start_date="2008-01-01",
|
43
|
+
)
|
44
|
+
# Victoria Day
|
45
|
+
# https://www.timeanddate.com/holidays/canada/victoria-day
|
46
|
+
VictoriaDay = Holiday(
|
47
|
+
"Victoria Day",
|
48
|
+
month=5,
|
49
|
+
day=24,
|
50
|
+
offset=DateOffset(weekday=MO(-1)),
|
51
|
+
)
|
52
|
+
# Canada Day
|
53
|
+
CanadaDay = Holiday(
|
54
|
+
"Canada Day",
|
55
|
+
month=7,
|
56
|
+
day=1,
|
57
|
+
observance=weekend_to_monday,
|
58
|
+
)
|
59
|
+
# Civic Holiday
|
60
|
+
CivicHoliday = Holiday(
|
61
|
+
"Civic Holiday",
|
62
|
+
month=8,
|
63
|
+
day=1,
|
64
|
+
offset=DateOffset(weekday=MO(1)),
|
65
|
+
)
|
66
|
+
# Labor Day
|
67
|
+
LaborDay = Holiday(
|
68
|
+
"Labor Day",
|
69
|
+
month=9,
|
70
|
+
day=1,
|
71
|
+
offset=DateOffset(weekday=MO(1)),
|
72
|
+
)
|
73
|
+
# Thanksgiving
|
74
|
+
Thanksgiving = Holiday(
|
75
|
+
"Thanksgiving",
|
76
|
+
month=10,
|
77
|
+
day=1,
|
78
|
+
offset=DateOffset(weekday=MO(2)),
|
79
|
+
)
|
80
|
+
|
81
|
+
Christmas = Holiday(
|
82
|
+
"Christmas",
|
83
|
+
month=12,
|
84
|
+
day=25,
|
85
|
+
)
|
86
|
+
|
87
|
+
ChristmasEveEarlyClose2010Onwards = Holiday(
|
88
|
+
"Christmas Eve Early Close",
|
89
|
+
month=12,
|
90
|
+
day=24,
|
91
|
+
days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
|
92
|
+
start_date=pd.Timestamp("2010-01-01"),
|
93
|
+
)
|
94
|
+
|
95
|
+
September11Closings2001 = [
|
96
|
+
pd.Timestamp("2001-09-11", tz="UTC"),
|
97
|
+
pd.Timestamp("2001-09-12", tz="UTC"),
|
98
|
+
]
|
99
|
+
|
100
|
+
|
101
|
+
class TSXExchangeCalendar(MarketCalendar):
|
102
|
+
"""
|
103
|
+
Exchange calendar for the Toronto Stock Exchange
|
104
|
+
|
105
|
+
Open Time: 9:30 AM, EST
|
106
|
+
Close Time: 4:00 PM, EST
|
107
|
+
|
108
|
+
Regularly-Observed Holidays:
|
109
|
+
- New Years Day (observed on first business day on/after)
|
110
|
+
- Family Day (Third Monday in February, starting in 2008)
|
111
|
+
- Good Friday
|
112
|
+
- Victoria Day (Monday before May 25th)
|
113
|
+
- Canada Day (July 1st, observed first business day after)
|
114
|
+
- Civic Holiday (First Monday in August)
|
115
|
+
- Labor Day (First Monday in September)
|
116
|
+
- Thanksgiving (Second Monday in October)
|
117
|
+
- Christmas Day
|
118
|
+
- Dec. 26th if Christmas is on a Sunday
|
119
|
+
- Dec. 27th if Christmas is on a weekend
|
120
|
+
- Boxing Day
|
121
|
+
- Dec. 27th if Christmas is on a Sunday
|
122
|
+
- Dec. 28th if Boxing Day is on a weekend
|
123
|
+
|
124
|
+
Early closes:
|
125
|
+
- Starting in 2010, if Christmas Eve falls on a weekday, the market
|
126
|
+
closes at 1:00 pm that day. If it falls on a weekend, there is no
|
127
|
+
early close.
|
128
|
+
"""
|
129
|
+
|
130
|
+
aliases = ["TSX", "TSXV"]
|
131
|
+
|
132
|
+
regular_market_times = {
|
133
|
+
"market_open": ((None, time(9, 30)),),
|
134
|
+
"market_close": ((None, time(16)),),
|
135
|
+
}
|
136
|
+
|
137
|
+
@property
|
138
|
+
def name(self):
|
139
|
+
return "TSX"
|
140
|
+
|
141
|
+
@property
|
142
|
+
def tz(self):
|
143
|
+
return timezone("Canada/Eastern")
|
144
|
+
|
145
|
+
regular_early_close = time(13)
|
146
|
+
|
147
|
+
@property
|
148
|
+
def regular_holidays(self):
|
149
|
+
return AbstractHolidayCalendar(
|
150
|
+
rules=[
|
151
|
+
TSXNewYearsDay,
|
152
|
+
FamilyDay,
|
153
|
+
GoodFriday,
|
154
|
+
VictoriaDay,
|
155
|
+
CanadaDay,
|
156
|
+
CivicHoliday,
|
157
|
+
LaborDay,
|
158
|
+
Thanksgiving,
|
159
|
+
Christmas,
|
160
|
+
WeekendChristmas,
|
161
|
+
BoxingDay,
|
162
|
+
WeekendBoxingDay,
|
163
|
+
]
|
164
|
+
)
|
165
|
+
|
166
|
+
@property
|
167
|
+
def adhoc_holidays(self):
|
168
|
+
return list(
|
169
|
+
chain(
|
170
|
+
September11Closings2001,
|
171
|
+
)
|
172
|
+
)
|
173
|
+
|
174
|
+
@property
|
175
|
+
def special_closes(self):
|
176
|
+
return [
|
177
|
+
(
|
178
|
+
self.regular_early_close,
|
179
|
+
AbstractHolidayCalendar([ChristmasEveEarlyClose2010Onwards]),
|
180
|
+
)
|
181
|
+
]
|