pandas-market-calendars 4.4.0__py3-none-any.whl → 4.4.2__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.
Files changed (47) hide show
  1. pandas_market_calendars/__init__.py +38 -38
  2. pandas_market_calendars/calendar_registry.py +57 -53
  3. pandas_market_calendars/calendar_utils.py +262 -261
  4. pandas_market_calendars/calendars/asx.py +66 -66
  5. pandas_market_calendars/calendars/bmf.py +223 -223
  6. pandas_market_calendars/calendars/bse.py +421 -421
  7. pandas_market_calendars/calendars/cboe.py +145 -145
  8. pandas_market_calendars/calendars/cme.py +405 -402
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -126
  10. pandas_market_calendars/calendars/cme_globex_base.py +119 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +160 -160
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +123 -123
  14. pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -136
  15. pandas_market_calendars/calendars/cme_globex_fx.py +101 -101
  16. pandas_market_calendars/calendars/eurex.py +131 -139
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
  18. pandas_market_calendars/calendars/hkex.py +429 -426
  19. pandas_market_calendars/calendars/ice.py +81 -81
  20. pandas_market_calendars/calendars/iex.py +112 -112
  21. pandas_market_calendars/calendars/jpx.py +113 -109
  22. pandas_market_calendars/calendars/lse.py +114 -114
  23. pandas_market_calendars/calendars/mirror.py +149 -130
  24. pandas_market_calendars/calendars/nyse.py +1324 -1324
  25. pandas_market_calendars/calendars/ose.py +116 -116
  26. pandas_market_calendars/calendars/sifma.py +354 -354
  27. pandas_market_calendars/calendars/six.py +132 -132
  28. pandas_market_calendars/calendars/sse.py +311 -311
  29. pandas_market_calendars/calendars/tase.py +197 -197
  30. pandas_market_calendars/calendars/tsx.py +181 -181
  31. pandas_market_calendars/holidays/cme.py +385 -385
  32. pandas_market_calendars/holidays/cme_globex.py +214 -214
  33. pandas_market_calendars/holidays/cn.py +1456 -1455
  34. pandas_market_calendars/holidays/jp.py +401 -401
  35. pandas_market_calendars/holidays/jpx_equinox.py +506 -505
  36. pandas_market_calendars/holidays/nyse.py +1531 -1531
  37. pandas_market_calendars/holidays/oz.py +63 -63
  38. pandas_market_calendars/holidays/sifma.py +350 -350
  39. pandas_market_calendars/holidays/us.py +376 -376
  40. pandas_market_calendars/market_calendar.py +922 -895
  41. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/METADATA +8 -7
  42. pandas_market_calendars-4.4.2.dist-info/RECORD +50 -0
  43. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/WHEEL +1 -1
  44. pandas_market_calendars-4.4.0.dist-info/RECORD +0 -50
  45. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/LICENSE +0 -0
  46. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/NOTICE +0 -0
  47. {pandas_market_calendars-4.4.0.dist-info → pandas_market_calendars-4.4.2.dist-info}/top_level.txt +0 -0
@@ -1,181 +1,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
- ]
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
+ ]