pandas-market-calendars 5.0.0__py3-none-any.whl → 5.1.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/__init__.py +39 -39
- pandas_market_calendars/calendar_registry.py +57 -57
- pandas_market_calendars/calendar_utils.py +1151 -1147
- pandas_market_calendars/calendars/asx.py +77 -70
- pandas_market_calendars/calendars/bmf.py +226 -219
- pandas_market_calendars/calendars/bse.py +432 -425
- pandas_market_calendars/calendars/cboe.py +156 -149
- pandas_market_calendars/calendars/cme.py +412 -405
- pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
- pandas_market_calendars/calendars/cme_globex_base.py +126 -119
- pandas_market_calendars/calendars/cme_globex_crypto.py +165 -158
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +223 -216
- pandas_market_calendars/calendars/cme_globex_equities.py +130 -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 +138 -131
- pandas_market_calendars/calendars/eurex_fixed_income.py +105 -98
- pandas_market_calendars/calendars/hkex.py +438 -431
- pandas_market_calendars/calendars/ice.py +88 -81
- pandas_market_calendars/calendars/iex.py +162 -155
- pandas_market_calendars/calendars/jpx.py +124 -117
- pandas_market_calendars/calendars/lse.py +125 -118
- pandas_market_calendars/calendars/mirror.py +144 -144
- pandas_market_calendars/calendars/nyse.py +1472 -1466
- pandas_market_calendars/calendars/ose.py +125 -118
- pandas_market_calendars/calendars/sifma.py +390 -356
- pandas_market_calendars/calendars/six.py +143 -136
- pandas_market_calendars/calendars/sse.py +322 -315
- pandas_market_calendars/calendars/tase.py +231 -224
- pandas_market_calendars/calendars/tsx.py +192 -185
- pandas_market_calendars/class_registry.py +115 -115
- pandas_market_calendars/holidays/cme.py +385 -385
- pandas_market_calendars/holidays/cme_globex.py +214 -214
- pandas_market_calendars/holidays/cn.py +1476 -1476
- pandas_market_calendars/holidays/jp.py +401 -401
- pandas_market_calendars/holidays/jpx_equinox.py +506 -506
- pandas_market_calendars/holidays/nyse.py +1536 -1536
- 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 +1008 -1008
- {pandas_market_calendars-5.0.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/METADATA +3 -1
- pandas_market_calendars-5.1.1.dist-info/RECORD +50 -0
- {pandas_market_calendars-5.0.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/WHEEL +1 -1
- pandas_market_calendars-5.0.0.dist-info/RECORD +0 -50
- {pandas_market_calendars-5.0.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/LICENSE +0 -0
- {pandas_market_calendars-5.0.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/NOTICE +0 -0
- {pandas_market_calendars-5.0.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/top_level.txt +0 -0
@@ -1,117 +1,124 @@
|
|
1
|
-
from datetime import time
|
2
|
-
from itertools import chain
|
3
|
-
|
4
|
-
from pandas.tseries.holiday import AbstractHolidayCalendar
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
from
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
1
|
+
from datetime import time
|
2
|
+
from itertools import chain
|
3
|
+
|
4
|
+
from pandas.tseries.holiday import AbstractHolidayCalendar
|
5
|
+
import sys
|
6
|
+
# check python versiOn aNd import accordingly
|
7
|
+
if sys.version_info >= (3, 9):
|
8
|
+
# For Python 3.9 and later, import directly
|
9
|
+
from zoneinfo import ZoneInfo
|
10
|
+
else:
|
11
|
+
# For Python 3.8 and earlier, import from backports
|
12
|
+
from backports.zoneinfo import ZoneInfo
|
13
|
+
|
14
|
+
from pandas_market_calendars.holidays.jp import *
|
15
|
+
from pandas_market_calendars.holidays.us import USNewYearsDay
|
16
|
+
from pandas_market_calendars.market_calendar import MarketCalendar
|
17
|
+
|
18
|
+
|
19
|
+
# TODO:
|
20
|
+
# From 1949 to 1972 the TSE was open on all non-holiday Saturdays for a half day
|
21
|
+
# From 1973 to 1984 the TSE was open on all non-holiday Saturdays except the third Saturday of the month
|
22
|
+
# need to add support for weekmask to make this work properly
|
23
|
+
|
24
|
+
|
25
|
+
class JPXExchangeCalendar(MarketCalendar):
|
26
|
+
"""
|
27
|
+
Exchange calendar for JPX
|
28
|
+
|
29
|
+
Open Time: 9:31 AM, Asia/Tokyo
|
30
|
+
LUNCH BREAK :facepalm: : 11:30 AM - 12:30 PM Asia/Tokyo
|
31
|
+
Close Time: 3:30 PM, Asia/Tokyo
|
32
|
+
|
33
|
+
Market close of Japan changed from 3:00 PM to 3:30 PM on November 5, 2024
|
34
|
+
Reference:
|
35
|
+
https://www.jpx.co.jp/english/equities/trading/domestic/tvdivq0000006blj-att/tradinghours_eg.pdf
|
36
|
+
"""
|
37
|
+
|
38
|
+
aliases = ["JPX", "XJPX"]
|
39
|
+
regular_market_times = {
|
40
|
+
"market_open": ((None, time(9)),),
|
41
|
+
"market_close": ((None, time(15)), ("2024-11-05", time(15, 30))),
|
42
|
+
"break_start": ((None, time(11, 30)),),
|
43
|
+
"break_end": ((None, time(12, 30)),),
|
44
|
+
}
|
45
|
+
regular_early_close = time(13)
|
46
|
+
|
47
|
+
@property
|
48
|
+
def name(self):
|
49
|
+
return "JPX"
|
50
|
+
|
51
|
+
@property
|
52
|
+
def full_name(self):
|
53
|
+
return "Japan Exchange Group"
|
54
|
+
|
55
|
+
@property
|
56
|
+
def tz(self):
|
57
|
+
return ZoneInfo("Asia/Tokyo")
|
58
|
+
|
59
|
+
@property
|
60
|
+
def adhoc_holidays(self):
|
61
|
+
return list(
|
62
|
+
chain(
|
63
|
+
AscensionDays,
|
64
|
+
MarriageDays,
|
65
|
+
FuneralShowa,
|
66
|
+
EnthronementDays,
|
67
|
+
AutumnalCitizenDates,
|
68
|
+
NoN225IndexPrices,
|
69
|
+
EquityTradingSystemFailure,
|
70
|
+
)
|
71
|
+
)
|
72
|
+
|
73
|
+
@property
|
74
|
+
def regular_holidays(self):
|
75
|
+
return AbstractHolidayCalendar(
|
76
|
+
rules=[
|
77
|
+
USNewYearsDay,
|
78
|
+
JapanNewYearsDay2,
|
79
|
+
JapanNewYearsDay3,
|
80
|
+
JapanComingOfAgeDay1951To1973,
|
81
|
+
JapanComingOfAgeDay1974To1999,
|
82
|
+
JapanComingOfAgeDay,
|
83
|
+
JapanNationalFoundationDay1969To1973,
|
84
|
+
JapanNationalFoundationDay,
|
85
|
+
JapanEmperorsBirthday,
|
86
|
+
JapanVernalEquinox,
|
87
|
+
JapanShowaDayUntil1972,
|
88
|
+
JapanShowaDay,
|
89
|
+
JapanConstitutionMemorialDayUntil1972,
|
90
|
+
JapanConstitutionMemorialDay,
|
91
|
+
JapanGreeneryDay,
|
92
|
+
JapanChildrensDayUntil1972,
|
93
|
+
JapanChildrensDay,
|
94
|
+
JapanGoldenWeekBonusDay,
|
95
|
+
JapanMarineDay1996To2002,
|
96
|
+
JapanMarineDay2003To2019,
|
97
|
+
JapanMarineDay2020,
|
98
|
+
JapanMarineDay2021,
|
99
|
+
JapanMarineDay,
|
100
|
+
JapanMountainDay2016to2019,
|
101
|
+
JapanMountainDay2020,
|
102
|
+
JapanMountainDay2021,
|
103
|
+
JapanMountainDay2021NextDay,
|
104
|
+
JapanMountainDay,
|
105
|
+
JapanRespectForTheAgedDay1966To1972,
|
106
|
+
JapanRespectForTheAgedDay1973To2002,
|
107
|
+
JapanRespectForTheAgedDay,
|
108
|
+
JapanAutumnalEquinox,
|
109
|
+
JapanHealthAndSportsDay1966To1972,
|
110
|
+
JapanHealthAndSportsDay1973To1999,
|
111
|
+
JapanHealthAndSportsDay2000To2019,
|
112
|
+
JapanSportsDay2020,
|
113
|
+
JapanSportsDay2021,
|
114
|
+
JapanSportsDay,
|
115
|
+
JapanCultureDayUntil1972,
|
116
|
+
JapanCultureDay,
|
117
|
+
JapanLaborThanksgivingDayUntil1972,
|
118
|
+
JapanLaborThanksgivingDay,
|
119
|
+
JapanEmperorAkahitosBirthday,
|
120
|
+
JapanDecember29Until1988,
|
121
|
+
JapanDecember30Until1988,
|
122
|
+
JapanBeforeNewYearsDay,
|
123
|
+
]
|
124
|
+
)
|
@@ -1,118 +1,125 @@
|
|
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 datetime import time
|
17
|
-
|
18
|
-
from pandas.tseries.holiday import AbstractHolidayCalendar, EasterMonday, GoodFriday
|
19
|
-
|
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
|
-
|
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 datetime import time
|
17
|
+
|
18
|
+
from pandas.tseries.holiday import AbstractHolidayCalendar, EasterMonday, GoodFriday
|
19
|
+
import sys
|
20
|
+
# check python versiOn aNd import accordingly
|
21
|
+
if sys.version_info >= (3, 9):
|
22
|
+
# For Python 3.9 and later, import directly
|
23
|
+
from zoneinfo import ZoneInfo
|
24
|
+
else:
|
25
|
+
# For Python 3.8 and earlier, import from backports
|
26
|
+
from backports.zoneinfo import ZoneInfo
|
27
|
+
|
28
|
+
from pandas_market_calendars.holidays.uk import (
|
29
|
+
BoxingDay,
|
30
|
+
Christmas,
|
31
|
+
ChristmasEve,
|
32
|
+
LSENewYearsDay,
|
33
|
+
LSENewYearsEve,
|
34
|
+
MayBank_pre_1995,
|
35
|
+
MayBank_post_1995_pre_2020,
|
36
|
+
MayBank_post_2020,
|
37
|
+
SpringBank_pre_2002,
|
38
|
+
SpringBank_post_2002_pre_2012,
|
39
|
+
SpringBank_post_2012_pre_2022,
|
40
|
+
SpringBank_post_2022,
|
41
|
+
SummerBank,
|
42
|
+
WeekendBoxingDay,
|
43
|
+
WeekendChristmas,
|
44
|
+
UniqueCloses,
|
45
|
+
)
|
46
|
+
from pandas_market_calendars.market_calendar import MarketCalendar
|
47
|
+
|
48
|
+
|
49
|
+
class LSEExchangeCalendar(MarketCalendar):
|
50
|
+
"""
|
51
|
+
Exchange calendar for the London Stock Exchange
|
52
|
+
|
53
|
+
Open Time: 8:00 AM, GMT
|
54
|
+
Close Time: 4:30 PM, GMT
|
55
|
+
|
56
|
+
Regularly-Observed Holidays:
|
57
|
+
- New Years Day (observed on first business day on/after)
|
58
|
+
- Good Friday
|
59
|
+
- Easter Monday
|
60
|
+
- Early May Bank Holiday (first Monday in May)
|
61
|
+
- Spring Bank Holiday (last Monday in May)
|
62
|
+
- Summer Bank Holiday (last Monday in August)
|
63
|
+
- Christmas Day
|
64
|
+
- Dec. 27th (if Christmas is on a weekend)
|
65
|
+
- Boxing Day
|
66
|
+
- Dec. 28th (if Boxing Day is on a weekend)
|
67
|
+
"""
|
68
|
+
|
69
|
+
aliases = ["LSE"]
|
70
|
+
regular_market_times = {
|
71
|
+
"market_open": ((None, time(8)),),
|
72
|
+
"market_close": ((None, time(16, 30)),),
|
73
|
+
}
|
74
|
+
|
75
|
+
@property
|
76
|
+
def name(self):
|
77
|
+
return "LSE"
|
78
|
+
|
79
|
+
@property
|
80
|
+
def full_name(self):
|
81
|
+
return "London Stock Exchange"
|
82
|
+
|
83
|
+
@property
|
84
|
+
def tz(self):
|
85
|
+
return ZoneInfo("Europe/London")
|
86
|
+
|
87
|
+
@property
|
88
|
+
def regular_holidays(self):
|
89
|
+
return AbstractHolidayCalendar(
|
90
|
+
rules=[
|
91
|
+
LSENewYearsDay,
|
92
|
+
GoodFriday,
|
93
|
+
EasterMonday,
|
94
|
+
MayBank_pre_1995,
|
95
|
+
MayBank_post_1995_pre_2020,
|
96
|
+
MayBank_post_2020,
|
97
|
+
SpringBank_pre_2002,
|
98
|
+
SpringBank_post_2002_pre_2012,
|
99
|
+
SpringBank_post_2012_pre_2022,
|
100
|
+
SpringBank_post_2022,
|
101
|
+
SummerBank,
|
102
|
+
Christmas,
|
103
|
+
WeekendChristmas,
|
104
|
+
BoxingDay,
|
105
|
+
WeekendBoxingDay,
|
106
|
+
]
|
107
|
+
)
|
108
|
+
|
109
|
+
@property
|
110
|
+
def adhoc_holidays(self):
|
111
|
+
return UniqueCloses
|
112
|
+
|
113
|
+
@property
|
114
|
+
def special_closes(self):
|
115
|
+
return [
|
116
|
+
(
|
117
|
+
time(12, 30),
|
118
|
+
AbstractHolidayCalendar(
|
119
|
+
rules=[
|
120
|
+
ChristmasEve,
|
121
|
+
LSENewYearsEve,
|
122
|
+
]
|
123
|
+
),
|
124
|
+
)
|
125
|
+
]
|