pandas-market-calendars 4.1.3__py3-none-any.whl → 4.2.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. {pandas_market_calendars-4.1.3.dist-info → pandas_market_calendars-4.2.0.dist-info}/METADATA +200 -187
  2. pandas_market_calendars-4.2.0.dist-info/NOTICE +206 -0
  3. pandas_market_calendars-4.2.0.dist-info/RECORD +6 -0
  4. {pandas_market_calendars-4.1.3.dist-info → pandas_market_calendars-4.2.0.dist-info}/WHEEL +1 -1
  5. pandas_market_calendars/__init__.py +0 -37
  6. pandas_market_calendars/calendar_registry.py +0 -47
  7. pandas_market_calendars/calendar_utils.py +0 -225
  8. pandas_market_calendars/class_registry.py +0 -111
  9. pandas_market_calendars/exchange_calendar_asx.py +0 -63
  10. pandas_market_calendars/exchange_calendar_bmf.py +0 -227
  11. pandas_market_calendars/exchange_calendar_bse.py +0 -409
  12. pandas_market_calendars/exchange_calendar_cboe.py +0 -115
  13. pandas_market_calendars/exchange_calendar_cme.py +0 -240
  14. pandas_market_calendars/exchange_calendar_cme_globex_agriculture.py +0 -109
  15. pandas_market_calendars/exchange_calendar_cme_globex_base.py +0 -106
  16. pandas_market_calendars/exchange_calendar_cme_globex_energy_and_metals.py +0 -146
  17. pandas_market_calendars/exchange_calendar_cme_globex_equities.py +0 -104
  18. pandas_market_calendars/exchange_calendar_cme_globex_fixed_income.py +0 -114
  19. pandas_market_calendars/exchange_calendar_cme_globex_fx.py +0 -78
  20. pandas_market_calendars/exchange_calendar_eurex.py +0 -119
  21. pandas_market_calendars/exchange_calendar_hkex.py +0 -408
  22. pandas_market_calendars/exchange_calendar_ice.py +0 -65
  23. pandas_market_calendars/exchange_calendar_iex.py +0 -98
  24. pandas_market_calendars/exchange_calendar_jpx.py +0 -98
  25. pandas_market_calendars/exchange_calendar_lse.py +0 -91
  26. pandas_market_calendars/exchange_calendar_nyse.py +0 -1127
  27. pandas_market_calendars/exchange_calendar_ose.py +0 -150
  28. pandas_market_calendars/exchange_calendar_sifma.py +0 -300
  29. pandas_market_calendars/exchange_calendar_six.py +0 -114
  30. pandas_market_calendars/exchange_calendar_sse.py +0 -290
  31. pandas_market_calendars/exchange_calendar_tase.py +0 -119
  32. pandas_market_calendars/exchange_calendar_tsx.py +0 -159
  33. pandas_market_calendars/exchange_calendars_mirror.py +0 -114
  34. pandas_market_calendars/holidays_cme.py +0 -341
  35. pandas_market_calendars/holidays_cme_globex.py +0 -169
  36. pandas_market_calendars/holidays_cn.py +0 -1436
  37. pandas_market_calendars/holidays_jp.py +0 -362
  38. pandas_market_calendars/holidays_nyse.py +0 -1474
  39. pandas_market_calendars/holidays_oz.py +0 -65
  40. pandas_market_calendars/holidays_sifma.py +0 -321
  41. pandas_market_calendars/holidays_uk.py +0 -177
  42. pandas_market_calendars/holidays_us.py +0 -364
  43. pandas_market_calendars/jpx_equinox.py +0 -147
  44. pandas_market_calendars/market_calendar.py +0 -770
  45. pandas_market_calendars-4.1.3.dist-info/RECORD +0 -45
  46. {pandas_market_calendars-4.1.3.dist-info → pandas_market_calendars-4.2.0.dist-info}/LICENSE +0 -0
  47. {pandas_market_calendars-4.1.3.dist-info → pandas_market_calendars-4.2.0.dist-info}/top_level.txt +0 -0
@@ -1,150 +0,0 @@
1
- from datetime import time
2
-
3
- from pandas.tseries.holiday import AbstractHolidayCalendar, EasterMonday, GoodFriday, Holiday
4
- from pandas.tseries.offsets import Day, Easter
5
- from pytz import timezone
6
-
7
- from .market_calendar import MarketCalendar
8
-
9
- OSENewYearsDay = Holiday(
10
- "New Year's Day",
11
- month=1,
12
- day=1
13
- )
14
-
15
- OSEWednesdayBeforeEaster = Holiday(
16
- "Wednesday before Easter",
17
- month=1,
18
- day=1,
19
- offset=[Easter(), Day(-4)]
20
-
21
- )
22
-
23
- OSEMaundyThursday = Holiday(
24
- "Maundy Thursday",
25
- month=1,
26
- day=1,
27
- offset=[Easter(), Day(-3)]
28
- )
29
-
30
- OSEGoodFriday = GoodFriday
31
-
32
- OSEEasterMonday = EasterMonday
33
-
34
- OSELabourDay = Holiday(
35
- "Labour Day",
36
- month=5,
37
- day=1
38
- )
39
-
40
- OSEConstitutionDay = Holiday(
41
- "Constitution Day",
42
- month=5,
43
- day=17
44
- )
45
-
46
- OSEWhitMonday = Holiday(
47
- "Whit Monday",
48
- month=1,
49
- day=1,
50
- offset=[Easter(), Day(50)]
51
- )
52
-
53
- OSEAscensionDay = Holiday(
54
- "Ascension Day",
55
- month=1,
56
- day=1,
57
- offset=[Easter(), Day(39)]
58
- )
59
-
60
- OSEChristmasEve = Holiday(
61
- "Christmas Eve",
62
- month=12,
63
- day=24,
64
- )
65
-
66
- OSEChristmasDay = Holiday(
67
- "Christmas Day",
68
- month=12,
69
- day=25
70
- )
71
-
72
- OSEBoxingDay = Holiday(
73
- "Boxing Day",
74
- month=12,
75
- day=26
76
- )
77
-
78
- OSENewYearsEve = Holiday(
79
- "New Year's Eve",
80
- month=12,
81
- day=31
82
- )
83
-
84
-
85
- class OSEExchangeCalendar(MarketCalendar):
86
- """
87
- Exchange calendar for Oslo Stock Exchange
88
-
89
- Note these dates are only checked against 2017, 2018 and 2019
90
- https://www.oslobors.no/ob_eng/Oslo-Boers/About-Oslo-Boers/Opening-hours
91
-
92
- Opening times for the regular trading of equities (not including closing auction call)
93
- Open Time: 9:00 AM, CEST/EST
94
- Close Time: 4:20 PM, CEST/EST
95
-
96
- Regularly-Observed Holidays (not necessarily in order):
97
- - New Years Day
98
- - Wednesday before Easter (Half trading day)
99
- - Maundy Thursday
100
- - Good Friday
101
- - Easter Monday
102
- - Labour Day
103
- - Ascension Day
104
- - Constitution Day
105
- - Whit Monday
106
- - Christmas Eve
107
- - Christmas Day
108
- - Boxing Day
109
- - New Year's Eve
110
- """
111
-
112
- aliases = ['OSE']
113
- regular_market_times = {
114
- "market_open": ((None, time(9)),),
115
- "market_close": ((None, time(16,20)),)
116
- }
117
-
118
- @property
119
- def name(self):
120
- return "OSE"
121
-
122
- @property
123
- def tz(self):
124
- return timezone("Europe/Oslo")
125
-
126
- @property
127
- def regular_holidays(self):
128
- return AbstractHolidayCalendar(rules=[
129
- OSENewYearsDay,
130
- OSEMaundyThursday,
131
- OSEGoodFriday,
132
- OSEEasterMonday,
133
- OSELabourDay,
134
- OSEConstitutionDay,
135
- OSEWhitMonday,
136
- OSEAscensionDay,
137
- OSEChristmasEve,
138
- OSEChristmasDay,
139
- OSEBoxingDay,
140
- OSENewYearsEve
141
- ])
142
-
143
- @property
144
- def special_closes(self):
145
- return [(
146
- time(13, 0, tzinfo=self.tz),
147
- AbstractHolidayCalendar(rules=[
148
- OSEWednesdayBeforeEaster
149
- ])
150
- )]
@@ -1,300 +0,0 @@
1
- from datetime import time
2
-
3
- from pandas.tseries.holiday import AbstractHolidayCalendar
4
- from pytz import timezone
5
- from itertools import chain
6
- import pandas as pd
7
-
8
-
9
- ########################################################################################################################
10
- # SIFMA Financial Markets Calendar for US, UK, JP
11
- #
12
- # https://www.sifma.com/
13
- #
14
- # US: SIFMAUSExchangeCalendar() ['SIFMAUS', 'SIFMA_US', "Capital_Markets_US", "Financial_Markets_US", "Bond_Markets_US"]
15
- # UK: SIFMAUKExchangeCalendar() ['SIFMAUK', 'SIFMA_UK', "Capital_Markets_UK", "Financial_Markets_UK", "Bond_Markets_UK"]
16
- # JP: SIFMAJPExchangeCalendar() ['SIFMAJP', 'SIFMA_JP', "Capital_Markets_JP", "Financial_Markets_JP", "Bond_Markets_JP"]
17
- #
18
- # Trading Hours:
19
- # US: 7:00 to 17:30
20
- # UK: 8:00 to 17:00
21
- # JP: 8:30 to 18:30
22
- ########################################################################################################################
23
-
24
-
25
- from pandas_market_calendars.holidays_sifma import(
26
- # US Holidays
27
- UKWeekendBoxingDay,
28
- USNewYearsDay, # Not observed if a Saturday
29
- USNewYearsEve2pmEarlyClose,
30
-
31
- MartinLutherKingJr,
32
- USPresidentsDay,
33
-
34
- GoodFridayThru2020,
35
- DayBeforeGoodFriday2pmEarlyCloseThru2020,
36
- GoodFridayAdHoc,
37
- GoodFriday2pmEarlyCloseAdHoc,
38
- DayBeforeGoodFriday2pmEarlyCloseAdHoc,
39
-
40
- DayBeforeUSMemorialDay2pmEarlyClose,
41
- USMemorialDay,
42
- USJuneteenthAfter2022,
43
-
44
- USIndependenceDay,
45
- DayBeforeUSIndependenceDay2pmEarlyClose,
46
- ThursdayBeforeUSIndependenceDay2pmEarlyClose,
47
-
48
- USLaborDay,
49
- USColumbusDay,
50
- USVeteransDay,
51
- USThanksgivingDay,
52
- DayAfterThanksgiving2pmEarlyClose,
53
-
54
- Christmas,
55
- ChristmasEve2pmEarlyClose,
56
- ChristmasEveThursday2pmEarlyClose,
57
-
58
- # UK Specific Holidays
59
- UKNewYearsDay, # Saturdays observed on Monday
60
- UKGoodFriday,
61
- UKEasterMonday,
62
- UKMayDay,
63
- UKSpringBankAdHoc, # Usually follows US Memorial Day but not always
64
- UKSummerBank,
65
- UKChristmas,
66
- UKChristmaEve,
67
- UKWeekendChristmas, # Observed Tuesday when Boxing Day is on Monday
68
- UKBoxingDay,
69
- UKWeekendBoxingDay,
70
-
71
- UKPlatinumJubilee2022,
72
- )
73
-
74
- from .market_calendar import MarketCalendar
75
-
76
- #AbstractHolidayCalendar.start_date = '1998-01-01'
77
-
78
- ############################################################
79
- # US
80
- ############################################################
81
-
82
- class SIFMAUSExchangeCalendar(MarketCalendar):
83
- """
84
- Exchange calendar for SIFMA United States
85
-
86
- https://www.sifma.org/resources/general/holiday-schedule/#US
87
-
88
- """
89
-
90
- aliases = ['SIFMAUS', 'SIFMA_US', "Capital_Markets_US", "Financial_Markets_US", "Bond_Markets_US"]
91
-
92
- regular_market_times = {
93
- "market_open": ((None, time(7)),),
94
- "market_close": ((None, time(17, 30)),)
95
- }
96
-
97
-
98
- @property
99
- def name(self):
100
- return "SIFMA_US"
101
-
102
- @property
103
- def tz(self):
104
- return timezone("America/New_York")
105
-
106
- @property
107
- def regular_holidays(self):
108
- return AbstractHolidayCalendar(rules=[
109
- USNewYearsDay,
110
- MartinLutherKingJr,
111
- USPresidentsDay,
112
- GoodFridayThru2020,
113
- USMemorialDay,
114
- USJuneteenthAfter2022,
115
- USIndependenceDay,
116
- USLaborDay,
117
- USColumbusDay,
118
- USVeteransDay,
119
- USThanksgivingDay,
120
- Christmas,
121
- ])
122
-
123
- @property
124
- def adhoc_holidays(self):
125
- return list(chain(
126
- GoodFridayAdHoc,
127
- ))
128
-
129
-
130
-
131
- @property
132
- def special_closes(self):
133
- return [(
134
- time(14),
135
- AbstractHolidayCalendar(rules=[
136
- DayBeforeGoodFriday2pmEarlyCloseThru2020,
137
- DayBeforeUSMemorialDay2pmEarlyClose,
138
- DayBeforeUSIndependenceDay2pmEarlyClose,
139
- ThursdayBeforeUSIndependenceDay2pmEarlyClose,
140
- DayAfterThanksgiving2pmEarlyClose,
141
- ChristmasEve2pmEarlyClose,
142
- ChristmasEveThursday2pmEarlyClose,
143
- USNewYearsEve2pmEarlyClose,
144
- ])
145
- )]
146
-
147
- @property
148
- def special_closes_adhoc(self):
149
- return [
150
- (time(14, tzinfo=timezone('America/New_York')),
151
- GoodFriday2pmEarlyCloseAdHoc # list
152
- + DayBeforeGoodFriday2pmEarlyCloseAdHoc
153
- ),
154
- ]
155
-
156
- ############################################################
157
- # UK
158
- ############################################################
159
-
160
- class SIFMAUKExchangeCalendar(MarketCalendar):
161
- """
162
- Exchange calendar for SIFMA United Kingdom
163
-
164
- https://www.sifma.org/resources/general/holiday-schedule/#UK
165
-
166
- """
167
-
168
- aliases = ['SIFMAUK', 'SIFMA_UK', "Capital_Markets_UK", "Financial_Markets_UK", "Bond_Markets_UK"]
169
-
170
- regular_market_times = {
171
- "market_open": ((None, time(8)),),
172
- "market_close": ((None, time(17)),)
173
- }
174
-
175
- @property
176
- def name(self):
177
- return "SIFMA_UK"
178
-
179
- @property
180
- def tz(self):
181
- return timezone("Europe/London")
182
-
183
- @property
184
- def regular_holidays(self):
185
- return AbstractHolidayCalendar(rules=[
186
- UKNewYearsDay,
187
- MartinLutherKingJr,
188
- USPresidentsDay,
189
- UKGoodFriday,
190
- UKEasterMonday,
191
- UKMayDay,
192
- USMemorialDay,
193
- USJuneteenthAfter2022,
194
- USIndependenceDay,
195
- UKSummerBank,
196
- USLaborDay,
197
- USColumbusDay,
198
- USVeteransDay,
199
- USThanksgivingDay,
200
- UKChristmas,
201
- UKChristmaEve,
202
- UKWeekendChristmas,
203
- UKBoxingDay,
204
- UKWeekendBoxingDay
205
- ])
206
-
207
- @property
208
- def adhoc_holidays(self):
209
- return list(chain(
210
- UKSpringBankAdHoc,
211
- UKPlatinumJubilee2022,
212
- ))
213
-
214
- ############################################################
215
- # Japan
216
- ############################################################
217
- from .holidays_jp import (JapanComingOfAgeDay, JapanNationalFoundationDay,JapanEmperorsBirthday, JapanVernalEquinox,JapanShowaDay,
218
- JapanConstitutionMemorialDay, JapanGreeneryDay, JapanChildrensDay, JapanMarineDay, JapanMountainDay,
219
- JapanRespectForTheAgedDay, JapanAutumnalEquinox,
220
- JapanHealthAndSportsDay2000To2019, JapanSportsDay2020, JapanSportsDay,
221
- JapanCultureDay, JapanLaborThanksgivingDay)
222
-
223
- class SIFMAJPExchangeCalendar(MarketCalendar):
224
- """
225
- Exchange calendar for SIFMA Japan
226
-
227
- https://www.sifma.org/resources/general/holiday-schedule/#JP
228
-
229
- """
230
-
231
- aliases = ['SIFMAJP', 'SIFMA_JP', "Capital_Markets_JP", "Financial_Markets_JP", "Bond_Markets_JP"]
232
-
233
- regular_market_times = {
234
- "market_open": ((None, time(8, 30)),),
235
- "market_close": ((None, time(18, 30)),)
236
- }
237
-
238
- @property
239
- def name(self):
240
- return "SIFMA_JP"
241
-
242
- @property
243
- def tz(self):
244
- return timezone("Asia/Tokyo")
245
-
246
- @property
247
- def regular_holidays(self):
248
- return AbstractHolidayCalendar(rules=[
249
- UKNewYearsDay,
250
- JapanComingOfAgeDay,
251
- MartinLutherKingJr,
252
- JapanNationalFoundationDay,
253
- USPresidentsDay,
254
- JapanEmperorsBirthday,
255
- JapanVernalEquinox,
256
- UKGoodFriday,
257
- UKEasterMonday,
258
- JapanShowaDay,
259
- JapanConstitutionMemorialDay,
260
- JapanGreeneryDay,
261
- JapanChildrensDay,
262
- USMemorialDay,
263
- USJuneteenthAfter2022,
264
- USIndependenceDay,
265
- JapanMarineDay,
266
- JapanMountainDay,
267
- UKSummerBank,
268
- USLaborDay,
269
- JapanRespectForTheAgedDay,
270
- JapanAutumnalEquinox,
271
- JapanSportsDay,
272
- JapanSportsDay2020,
273
- JapanHealthAndSportsDay2000To2019,
274
- JapanCultureDay,
275
- USVeteransDay,
276
- JapanLaborThanksgivingDay,
277
- USThanksgivingDay,
278
- UKChristmas,
279
- UKChristmaEve,
280
- UKBoxingDay,
281
- UKWeekendBoxingDay
282
- ])
283
-
284
- @property
285
- def adhoc_holidays(self):
286
- return list(chain(
287
- UKSpringBankAdHoc,
288
- UKPlatinumJubilee2022,
289
- ))
290
-
291
- @property
292
- def special_closes(self):
293
- return [(
294
- time(15),
295
- AbstractHolidayCalendar(rules=[
296
- UKMayDay,
297
- UKWeekendChristmas
298
- ])
299
- )]
300
-
@@ -1,114 +0,0 @@
1
- from datetime import time
2
-
3
- from pandas.tseries.holiday import (AbstractHolidayCalendar, Day, Easter, EasterMonday, GoodFriday, Holiday,
4
- previous_friday)
5
- from pytz import timezone
6
-
7
- from .market_calendar import (FRIDAY, MONDAY, MarketCalendar, THURSDAY, TUESDAY, WEDNESDAY)
8
-
9
- # New Year's Eve
10
- NewYearsEve = Holiday(
11
- "New Year's Eve",
12
- month=12,
13
- day=31,
14
- observance=previous_friday,
15
- )
16
- # New Year's Day
17
- NewYearsDay = Holiday(
18
- "New Year's Day",
19
- month=1,
20
- day=1,
21
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
22
- )
23
- # Berthold's Day
24
- BertholdsDay = Holiday(
25
- "Berthold's Day",
26
- month=1,
27
- day=2,
28
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
29
- )
30
- # Early May bank holiday
31
- MayBank = Holiday(
32
- "Early May Bank Holiday",
33
- month=5,
34
- day=1,
35
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
36
- )
37
- # Ascension Day (Auffahrt)
38
- AscensionDay = Holiday(
39
- 'Ascension Day',
40
- month=1,
41
- day=1,
42
- offset=[Easter(), Day(39)],
43
- days_of_week=(THURSDAY,),
44
- )
45
- # Pentecost Day (Pfingstmontag)
46
- PentecostMonday = Holiday(
47
- 'Pentecost Monday',
48
- month=1,
49
- day=1,
50
- offset=[Easter(), Day(50)],
51
- days_of_week=(MONDAY,),
52
- )
53
- # Swiss National Day
54
- SwissNationalDay = Holiday(
55
- "Swiss National Day",
56
- month=8,
57
- day=1,
58
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
59
- )
60
- # Christmas Eve
61
- ChristmasEve = Holiday(
62
- 'Christmas Eve',
63
- month=12,
64
- day=24,
65
- )
66
- # Christmas
67
- Christmas = Holiday(
68
- "Christmas",
69
- month=12,
70
- day=25,
71
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
72
- )
73
- # Boxing day
74
- BoxingDay = Holiday(
75
- "Boxing Day",
76
- month=12,
77
- day=26,
78
- )
79
-
80
-
81
- class SIXExchangeCalendar(MarketCalendar):
82
- """
83
- Exchange calendar for SIX
84
-
85
- """
86
- aliases = ['SIX']
87
- regular_market_times = {
88
- "market_open": ((None, time(9)),),
89
- "market_close": ((None, time(17,30)),),
90
- }
91
- @property
92
- def name(self):
93
- return "SIX"
94
-
95
- @property
96
- def tz(self):
97
- return timezone('Europe/Zurich')
98
-
99
- @property
100
- def regular_holidays(self):
101
- return AbstractHolidayCalendar(rules=[
102
- NewYearsDay,
103
- BertholdsDay,
104
- GoodFriday,
105
- EasterMonday,
106
- MayBank,
107
- AscensionDay,
108
- PentecostMonday,
109
- SwissNationalDay,
110
- ChristmasEve,
111
- Christmas,
112
- BoxingDay,
113
- NewYearsEve,
114
- ])