pandas-market-calendars 4.3.0__tar.gz → 4.3.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/PKG-INFO +1 -1
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/__init__.py +0 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/asx.py +63 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/bmf.py +227 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/bse.py +409 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cboe.py +115 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cme.py +240 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cme_globex_agriculture.py +103 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cme_globex_base.py +103 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cme_globex_crypto.py +147 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +138 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cme_globex_equities.py +104 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cme_globex_fixed_income.py +113 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/cme_globex_fx.py +78 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/eurex.py +119 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/hkex.py +408 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/ice.py +65 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/iex.py +98 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/jpx.py +103 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/lse.py +91 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/mirror.py +114 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/nyse.py +1127 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/ose.py +150 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/sifma.py +297 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/six.py +114 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/sse.py +290 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/tase.py +195 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/calendars/tsx.py +159 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/__init__.py +0 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/cme.py +340 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/cme_globex.py +198 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/cn.py +1436 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/jp.py +396 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/jpx_equinox.py +147 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/nyse.py +1472 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/oz.py +65 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/sifma.py +321 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/uk.py +180 -0
- pandas_market_calendars-4.3.1/pandas_market_calendars/holidays/us.py +360 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars.egg-info/PKG-INFO +1 -1
- pandas_market_calendars-4.3.1/pandas_market_calendars.egg-info/SOURCES.txt +81 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pyproject.toml +2 -2
- pandas_market_calendars-4.3.0/pandas_market_calendars.egg-info/SOURCES.txt +0 -43
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/LICENSE +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/NOTICE +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/README.rst +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars/__init__.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars/calendar_registry.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars/calendar_utils.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars/class_registry.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars/market_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars.egg-info/dependency_links.txt +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars.egg-info/requires.txt +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/pandas_market_calendars.egg-info/top_level.txt +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/setup.cfg +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_XNYS_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_asx_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_bmf_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_bse_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_cboe_calendars.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_class_registry.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_cme_agriculture_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_cme_bond_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_cme_equity_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_eurex_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_exchange_calendar_cme_globex_crypto.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_exchange_calendar_cme_globex_energy_and_metals.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_exchange_calendar_cme_globex_equities.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_exchange_calendar_cme_globex_fixed_income.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_exchange_calendar_cme_globex_fx.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_hkex_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_ice_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_iex_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_jpx_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_lse_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_market_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_nyse_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_nyse_calendar_early_years.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_ose_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_sifma_calendars.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_six_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_sse_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_tsx_calendar.py +0 -0
- {pandas_market_calendars-4.3.0 → pandas_market_calendars-4.3.1}/tests/test_utils.py +0 -0
File without changes
|
@@ -0,0 +1,63 @@
|
|
1
|
+
from datetime import time
|
2
|
+
|
3
|
+
from pandas.tseries.holiday import AbstractHolidayCalendar, GoodFriday, EasterMonday
|
4
|
+
from pytz import timezone
|
5
|
+
|
6
|
+
from pandas_market_calendars.holidays.oz import *
|
7
|
+
from pandas_market_calendars.market_calendar import MarketCalendar
|
8
|
+
|
9
|
+
AbstractHolidayCalendar.start_date = '2011-01-01'
|
10
|
+
|
11
|
+
|
12
|
+
class ASXExchangeCalendar(MarketCalendar):
|
13
|
+
"""
|
14
|
+
Open Time: 10:00 AM, Australia/Sydney
|
15
|
+
Close Time: 4:10 PM, Australia/Sydney
|
16
|
+
|
17
|
+
|
18
|
+
Regularly-Observed Holidays:
|
19
|
+
- New Year's Day (observed on Monday when Jan 1 is a Saturday or Sunday)
|
20
|
+
- Australia Day (observed on Monday when Jan 26 is a Saturday or Sunday)
|
21
|
+
- Good Friday (two days before Easter Sunday)
|
22
|
+
- Easter Monday (the Monday after Easter Sunday)
|
23
|
+
- ANZAC Day (April 25)
|
24
|
+
- Queen's Birthday (second Monday in June)
|
25
|
+
- Christmas Day (December 25, Saturday/Sunday to Monday)
|
26
|
+
- Boxing Day (December 26, Saturday to Monday, Sunday to Tuesday)
|
27
|
+
|
28
|
+
|
29
|
+
Regularly-Observed Early Closes:
|
30
|
+
- Last Business Day before Christmas Day
|
31
|
+
- Last Business Day of the Year
|
32
|
+
|
33
|
+
"""
|
34
|
+
aliases = ['ASX']
|
35
|
+
regular_market_times = {
|
36
|
+
"market_open": ((None, time(10)),),
|
37
|
+
"market_close": ((None, time(16,10)),)
|
38
|
+
}
|
39
|
+
|
40
|
+
@property
|
41
|
+
def name(self):
|
42
|
+
return "ASX"
|
43
|
+
|
44
|
+
@property
|
45
|
+
def tz(self):
|
46
|
+
return timezone("Australia/Sydney")
|
47
|
+
|
48
|
+
@property
|
49
|
+
def regular_holidays(self):
|
50
|
+
return AbstractHolidayCalendar(rules=[
|
51
|
+
OZNewYearsDay,
|
52
|
+
AustraliaDay,
|
53
|
+
AnzacDay,
|
54
|
+
QueensBirthday,
|
55
|
+
Christmas,
|
56
|
+
BoxingDay,
|
57
|
+
GoodFriday,
|
58
|
+
EasterMonday,
|
59
|
+
])
|
60
|
+
|
61
|
+
@property
|
62
|
+
def adhoc_holidays(self):
|
63
|
+
return UniqueCloses
|
@@ -0,0 +1,227 @@
|
|
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 import Timestamp
|
19
|
+
from pandas.tseries.holiday import AbstractHolidayCalendar, Day, Easter, GoodFriday, Holiday
|
20
|
+
from pytz import timezone
|
21
|
+
|
22
|
+
from pandas_market_calendars.market_calendar import (FRIDAY, MarketCalendar)
|
23
|
+
|
24
|
+
# Universal Confraternization (new years day)
|
25
|
+
ConfUniversal = Holiday(
|
26
|
+
'Dia da Confraternizacao Universal',
|
27
|
+
month=1,
|
28
|
+
day=1,
|
29
|
+
)
|
30
|
+
# Sao Paulo city birthday
|
31
|
+
AniversarioSaoPaulo = Holiday(
|
32
|
+
'Aniversario de Sao Paulo',
|
33
|
+
month=1,
|
34
|
+
day=25,
|
35
|
+
end_date='2021-12-31'
|
36
|
+
)
|
37
|
+
# Carnival Monday
|
38
|
+
CarnavalSegunda = Holiday(
|
39
|
+
'Carnaval Segunda',
|
40
|
+
month=1,
|
41
|
+
day=1,
|
42
|
+
offset=[Easter(), Day(-48)]
|
43
|
+
)
|
44
|
+
# Carnival Tuesday
|
45
|
+
CarnavalTerca = Holiday(
|
46
|
+
'Carnaval Terca',
|
47
|
+
month=1,
|
48
|
+
day=1,
|
49
|
+
offset=[Easter(), Day(-47)]
|
50
|
+
)
|
51
|
+
# Ash Wednesday (short day)
|
52
|
+
QuartaCinzas = Holiday(
|
53
|
+
'Quarta Cinzas',
|
54
|
+
month=1,
|
55
|
+
day=1,
|
56
|
+
offset=[Easter(), Day(-46)]
|
57
|
+
)
|
58
|
+
# Good Friday
|
59
|
+
SextaPaixao = GoodFriday
|
60
|
+
# Feast of the Most Holy Body of Christ
|
61
|
+
CorpusChristi = Holiday(
|
62
|
+
'Corpus Christi',
|
63
|
+
month=1,
|
64
|
+
day=1,
|
65
|
+
offset=[Easter(), Day(60)]
|
66
|
+
)
|
67
|
+
# Tiradentes Memorial
|
68
|
+
Tiradentes = Holiday(
|
69
|
+
'Tiradentes',
|
70
|
+
month=4,
|
71
|
+
day=21,
|
72
|
+
)
|
73
|
+
# Labor Day
|
74
|
+
DiaTrabalho = Holiday(
|
75
|
+
'Dia Trabalho',
|
76
|
+
month=5,
|
77
|
+
day=1,
|
78
|
+
)
|
79
|
+
# Constitutionalist Revolution
|
80
|
+
Constitucionalista = Holiday(
|
81
|
+
'Constitucionalista',
|
82
|
+
month=7,
|
83
|
+
day=9,
|
84
|
+
start_date='1997-01-01',
|
85
|
+
end_date='2019-12-31'
|
86
|
+
)
|
87
|
+
# Independence Day
|
88
|
+
Independencia = Holiday(
|
89
|
+
'Independencia',
|
90
|
+
month=9,
|
91
|
+
day=7,
|
92
|
+
)
|
93
|
+
# Our Lady of Aparecida
|
94
|
+
Aparecida = Holiday(
|
95
|
+
'Nossa Senhora de Aparecida',
|
96
|
+
month=10,
|
97
|
+
day=12,
|
98
|
+
)
|
99
|
+
# All Souls' Day
|
100
|
+
Finados = Holiday(
|
101
|
+
'Dia dos Finados',
|
102
|
+
month=11,
|
103
|
+
day=2,
|
104
|
+
)
|
105
|
+
# Proclamation of the Republic
|
106
|
+
ProclamacaoRepublica = Holiday(
|
107
|
+
'Proclamacao da Republica',
|
108
|
+
month=11,
|
109
|
+
day=15,
|
110
|
+
)
|
111
|
+
# Day of Black Awareness
|
112
|
+
ConscienciaNegra = Holiday(
|
113
|
+
'Dia da Consciencia Negra',
|
114
|
+
month=11,
|
115
|
+
day=20,
|
116
|
+
start_date='2004-01-01',
|
117
|
+
end_date='2019-12-31'
|
118
|
+
)
|
119
|
+
# Christmas Eve
|
120
|
+
VesperaNatal = Holiday(
|
121
|
+
'Vespera Natal',
|
122
|
+
month=12,
|
123
|
+
day=24,
|
124
|
+
)
|
125
|
+
# Christmas
|
126
|
+
Natal = Holiday(
|
127
|
+
'Natal',
|
128
|
+
month=12,
|
129
|
+
day=25,
|
130
|
+
)
|
131
|
+
# New Year's Eve
|
132
|
+
AnoNovo = Holiday(
|
133
|
+
'Ano Novo',
|
134
|
+
month=12,
|
135
|
+
day=31,
|
136
|
+
)
|
137
|
+
# New Year's Eve falls on Saturday
|
138
|
+
AnoNovoSabado = Holiday(
|
139
|
+
'Ano Novo Sabado',
|
140
|
+
month=12,
|
141
|
+
day=30,
|
142
|
+
days_of_week=(FRIDAY,),
|
143
|
+
)
|
144
|
+
|
145
|
+
##########################
|
146
|
+
# Non-recurring holidays
|
147
|
+
##########################
|
148
|
+
|
149
|
+
Constitucionalista2021 = Timestamp('2021-07-09', tz='UTC')
|
150
|
+
ConscienciaNegra2021 = Timestamp('2021-11-20', tz='UTC')
|
151
|
+
|
152
|
+
|
153
|
+
class BMFExchangeCalendar(MarketCalendar):
|
154
|
+
"""
|
155
|
+
Exchange calendar for BM&F BOVESPA
|
156
|
+
|
157
|
+
Open Time: 10:00 AM, Brazil/Sao Paulo
|
158
|
+
Close Time: 4:00 PM, Brazil/Sao Paulo
|
159
|
+
|
160
|
+
Regularly-Observed Holidays:
|
161
|
+
- Universal Confraternization (New year's day, Jan 1)
|
162
|
+
- Sao Paulo City Anniversary (Jan 25 until 2021)
|
163
|
+
- Carnaval Monday (48 days before Easter)
|
164
|
+
- Carnaval Tuesday (47 days before Easter)
|
165
|
+
- Passion of the Christ (Good Friday, 2 days before Easter)
|
166
|
+
- Corpus Christi (60 days after Easter)
|
167
|
+
- Tiradentes (April 21)
|
168
|
+
- Labor day (May 1)
|
169
|
+
- Constitutionalist Revolution (July 9 after 1997 until 2021, skipping 2020)
|
170
|
+
- Independence Day (September 7)
|
171
|
+
- Our Lady of Aparecida Feast (October 12)
|
172
|
+
- All Souls' Day (November 2)
|
173
|
+
- Proclamation of the Republic (November 15)
|
174
|
+
- Day of Black Awareness (November 20 after 2004 until 2021, skipping 2020)
|
175
|
+
- Christmas (December 24 and 25)
|
176
|
+
- Day before New Year's Eve (December 30 if NYE falls on a Saturday)
|
177
|
+
- New Year's Eve (December 31)
|
178
|
+
"""
|
179
|
+
aliases = ['BMF', 'B3']
|
180
|
+
regular_market_times = {
|
181
|
+
"market_open": ((None, time(10,1)),),
|
182
|
+
"market_close": ((None, time(16)),)
|
183
|
+
}
|
184
|
+
|
185
|
+
@property
|
186
|
+
def name(self):
|
187
|
+
return "BMF"
|
188
|
+
|
189
|
+
@property
|
190
|
+
def tz(self):
|
191
|
+
return timezone("America/Sao_Paulo")
|
192
|
+
|
193
|
+
@property
|
194
|
+
def regular_holidays(self):
|
195
|
+
return AbstractHolidayCalendar(rules=[
|
196
|
+
ConfUniversal,
|
197
|
+
AniversarioSaoPaulo,
|
198
|
+
CarnavalSegunda,
|
199
|
+
CarnavalTerca,
|
200
|
+
SextaPaixao,
|
201
|
+
CorpusChristi,
|
202
|
+
Tiradentes,
|
203
|
+
DiaTrabalho,
|
204
|
+
Constitucionalista,
|
205
|
+
Independencia,
|
206
|
+
Aparecida,
|
207
|
+
Finados,
|
208
|
+
ProclamacaoRepublica,
|
209
|
+
ConscienciaNegra,
|
210
|
+
VesperaNatal,
|
211
|
+
Natal,
|
212
|
+
AnoNovo,
|
213
|
+
AnoNovoSabado,
|
214
|
+
])
|
215
|
+
|
216
|
+
@property
|
217
|
+
def adhoc_holidays(self):
|
218
|
+
return [
|
219
|
+
Constitucionalista2021,
|
220
|
+
ConscienciaNegra2021
|
221
|
+
]
|
222
|
+
|
223
|
+
@property
|
224
|
+
def special_opens(self):
|
225
|
+
return [
|
226
|
+
(time(13, 1), AbstractHolidayCalendar(rules=[QuartaCinzas]))
|
227
|
+
]
|