pandas-market-calendars 5.1.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.
Files changed (48) hide show
  1. pandas_market_calendars/__init__.py +39 -39
  2. pandas_market_calendars/calendar_registry.py +57 -57
  3. pandas_market_calendars/calendar_utils.py +1151 -1151
  4. pandas_market_calendars/calendars/asx.py +77 -70
  5. pandas_market_calendars/calendars/bmf.py +226 -219
  6. pandas_market_calendars/calendars/bse.py +432 -425
  7. pandas_market_calendars/calendars/cboe.py +156 -149
  8. pandas_market_calendars/calendars/cme.py +412 -405
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
  10. pandas_market_calendars/calendars/cme_globex_base.py +126 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +165 -158
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +223 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +130 -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 +138 -131
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +105 -98
  18. pandas_market_calendars/calendars/hkex.py +438 -431
  19. pandas_market_calendars/calendars/ice.py +88 -81
  20. pandas_market_calendars/calendars/iex.py +162 -155
  21. pandas_market_calendars/calendars/jpx.py +124 -117
  22. pandas_market_calendars/calendars/lse.py +125 -118
  23. pandas_market_calendars/calendars/mirror.py +144 -144
  24. pandas_market_calendars/calendars/nyse.py +1472 -1466
  25. pandas_market_calendars/calendars/ose.py +125 -118
  26. pandas_market_calendars/calendars/sifma.py +390 -383
  27. pandas_market_calendars/calendars/six.py +143 -136
  28. pandas_market_calendars/calendars/sse.py +322 -315
  29. pandas_market_calendars/calendars/tase.py +231 -224
  30. pandas_market_calendars/calendars/tsx.py +192 -185
  31. pandas_market_calendars/class_registry.py +115 -115
  32. pandas_market_calendars/holidays/cme.py +385 -385
  33. pandas_market_calendars/holidays/cme_globex.py +214 -214
  34. pandas_market_calendars/holidays/cn.py +1476 -1476
  35. pandas_market_calendars/holidays/jp.py +401 -401
  36. pandas_market_calendars/holidays/jpx_equinox.py +506 -506
  37. pandas_market_calendars/holidays/nyse.py +1536 -1536
  38. pandas_market_calendars/holidays/oz.py +63 -63
  39. pandas_market_calendars/holidays/sifma.py +350 -350
  40. pandas_market_calendars/holidays/us.py +376 -376
  41. pandas_market_calendars/market_calendar.py +1008 -1008
  42. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/METADATA +3 -1
  43. pandas_market_calendars-5.1.1.dist-info/RECORD +50 -0
  44. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/WHEEL +1 -1
  45. pandas_market_calendars-5.1.0.dist-info/RECORD +0 -50
  46. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/LICENSE +0 -0
  47. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/NOTICE +0 -0
  48. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/top_level.txt +0 -0
@@ -1,123 +1,130 @@
1
- from datetime import time
2
-
3
- from pandas.tseries.holiday import AbstractHolidayCalendar
4
- from zoneinfo import ZoneInfo
5
-
6
- from pandas_market_calendars.holidays.cme import (
7
- USMartinLutherKingJrAfter1998Before2015,
8
- USMartinLutherKingJrAfter2015,
9
- USPresidentsDayBefore2015,
10
- USPresidentsDayAfter2015,
11
- GoodFridayBefore2021NotEarlyClose,
12
- GoodFriday2010,
13
- GoodFriday2012,
14
- GoodFriday2015,
15
- GoodFriday2021,
16
- GoodFriday2022,
17
- GoodFridayAfter2022,
18
- USMemorialDay2013AndPrior,
19
- USMemorialDayAfter2013,
20
- USIndependenceDayBefore2022PreviousDay,
21
- USIndependenceDayBefore2014,
22
- USIndependenceDayAfter2014,
23
- USLaborDayStarting1887Before2014,
24
- USLaborDayStarting1887After2014,
25
- USThanksgivingBefore2014,
26
- USThanksgivingAfter2014,
27
- USThanksgivingFriday,
28
- )
29
- from pandas_market_calendars.holidays.us import (
30
- USNewYearsDay,
31
- ChristmasEveInOrAfter1993,
32
- Christmas,
33
- USJuneteenthAfter2022,
34
- )
35
- from .cme_globex_base import CMEGlobexBaseExchangeCalendar
36
-
37
-
38
- class CMEGlobexEquitiesExchangeCalendar(CMEGlobexBaseExchangeCalendar):
39
- aliases = ["CME Globex Equity"]
40
-
41
- regular_market_times = {
42
- "market_open": ((None, time(17), -1),), # offset by -1 day
43
- "market_close": ((None, time(16)),),
44
- }
45
-
46
- @property
47
- def tz(self):
48
- return ZoneInfo("America/Chicago")
49
-
50
- @property
51
- def name(self):
52
- """
53
- Name of the market
54
-
55
- :return: string name
56
- """
57
- return "CME Globex Equities"
58
-
59
- @property
60
- def regular_holidays(self):
61
- return AbstractHolidayCalendar(
62
- rules=[
63
- USNewYearsDay,
64
- GoodFridayBefore2021NotEarlyClose,
65
- GoodFriday2022,
66
- Christmas,
67
- ]
68
- )
69
-
70
- @property
71
- def special_closes(self):
72
- # Source https://www.cmegroup.com/tools-information/holiday-calendar.html
73
- return [
74
- (
75
- time(10, 30),
76
- AbstractHolidayCalendar(
77
- rules=[
78
- USMartinLutherKingJrAfter1998Before2015,
79
- USPresidentsDayBefore2015,
80
- USMemorialDay2013AndPrior,
81
- USIndependenceDayBefore2014,
82
- USLaborDayStarting1887Before2014,
83
- USThanksgivingBefore2014,
84
- ]
85
- ),
86
- ),
87
- (
88
- time(12, 15),
89
- AbstractHolidayCalendar(
90
- rules=[
91
- USIndependenceDayBefore2022PreviousDay,
92
- USThanksgivingFriday,
93
- ChristmasEveInOrAfter1993,
94
- ]
95
- ),
96
- ),
97
- (
98
- time(12),
99
- AbstractHolidayCalendar(
100
- rules=[
101
- USMartinLutherKingJrAfter2015,
102
- USPresidentsDayAfter2015,
103
- USMemorialDayAfter2013,
104
- USIndependenceDayAfter2014,
105
- USLaborDayStarting1887After2014,
106
- USThanksgivingAfter2014,
107
- USJuneteenthAfter2022,
108
- ]
109
- ),
110
- ),
111
- (
112
- time(8, 15),
113
- AbstractHolidayCalendar(
114
- rules=[
115
- GoodFriday2010,
116
- GoodFriday2012,
117
- GoodFriday2015,
118
- GoodFriday2021,
119
- GoodFridayAfter2022,
120
- ]
121
- ),
122
- ),
123
- ]
1
+ from datetime import time
2
+
3
+ from pandas.tseries.holiday import AbstractHolidayCalendar
4
+ import sys
5
+ # check python versiOn aNd import accordingly
6
+ if sys.version_info >= (3, 9):
7
+ # For Python 3.9 and later, import directly
8
+ from zoneinfo import ZoneInfo
9
+ else:
10
+ # For Python 3.8 and earlier, import from backports
11
+ from backports.zoneinfo import ZoneInfo
12
+
13
+ from pandas_market_calendars.holidays.cme import (
14
+ USMartinLutherKingJrAfter1998Before2015,
15
+ USMartinLutherKingJrAfter2015,
16
+ USPresidentsDayBefore2015,
17
+ USPresidentsDayAfter2015,
18
+ GoodFridayBefore2021NotEarlyClose,
19
+ GoodFriday2010,
20
+ GoodFriday2012,
21
+ GoodFriday2015,
22
+ GoodFriday2021,
23
+ GoodFriday2022,
24
+ GoodFridayAfter2022,
25
+ USMemorialDay2013AndPrior,
26
+ USMemorialDayAfter2013,
27
+ USIndependenceDayBefore2022PreviousDay,
28
+ USIndependenceDayBefore2014,
29
+ USIndependenceDayAfter2014,
30
+ USLaborDayStarting1887Before2014,
31
+ USLaborDayStarting1887After2014,
32
+ USThanksgivingBefore2014,
33
+ USThanksgivingAfter2014,
34
+ USThanksgivingFriday,
35
+ )
36
+ from pandas_market_calendars.holidays.us import (
37
+ USNewYearsDay,
38
+ ChristmasEveInOrAfter1993,
39
+ Christmas,
40
+ USJuneteenthAfter2022,
41
+ )
42
+ from .cme_globex_base import CMEGlobexBaseExchangeCalendar
43
+
44
+
45
+ class CMEGlobexEquitiesExchangeCalendar(CMEGlobexBaseExchangeCalendar):
46
+ aliases = ["CME Globex Equity"]
47
+
48
+ regular_market_times = {
49
+ "market_open": ((None, time(17), -1),), # offset by -1 day
50
+ "market_close": ((None, time(16)),),
51
+ }
52
+
53
+ @property
54
+ def tz(self):
55
+ return ZoneInfo("America/Chicago")
56
+
57
+ @property
58
+ def name(self):
59
+ """
60
+ Name of the market
61
+
62
+ :return: string name
63
+ """
64
+ return "CME Globex Equities"
65
+
66
+ @property
67
+ def regular_holidays(self):
68
+ return AbstractHolidayCalendar(
69
+ rules=[
70
+ USNewYearsDay,
71
+ GoodFridayBefore2021NotEarlyClose,
72
+ GoodFriday2022,
73
+ Christmas,
74
+ ]
75
+ )
76
+
77
+ @property
78
+ def special_closes(self):
79
+ # Source https://www.cmegroup.com/tools-information/holiday-calendar.html
80
+ return [
81
+ (
82
+ time(10, 30),
83
+ AbstractHolidayCalendar(
84
+ rules=[
85
+ USMartinLutherKingJrAfter1998Before2015,
86
+ USPresidentsDayBefore2015,
87
+ USMemorialDay2013AndPrior,
88
+ USIndependenceDayBefore2014,
89
+ USLaborDayStarting1887Before2014,
90
+ USThanksgivingBefore2014,
91
+ ]
92
+ ),
93
+ ),
94
+ (
95
+ time(12, 15),
96
+ AbstractHolidayCalendar(
97
+ rules=[
98
+ USIndependenceDayBefore2022PreviousDay,
99
+ USThanksgivingFriday,
100
+ ChristmasEveInOrAfter1993,
101
+ ]
102
+ ),
103
+ ),
104
+ (
105
+ time(12),
106
+ AbstractHolidayCalendar(
107
+ rules=[
108
+ USMartinLutherKingJrAfter2015,
109
+ USPresidentsDayAfter2015,
110
+ USMemorialDayAfter2013,
111
+ USIndependenceDayAfter2014,
112
+ USLaborDayStarting1887After2014,
113
+ USThanksgivingAfter2014,
114
+ USJuneteenthAfter2022,
115
+ ]
116
+ ),
117
+ ),
118
+ (
119
+ time(8, 15),
120
+ AbstractHolidayCalendar(
121
+ rules=[
122
+ GoodFriday2010,
123
+ GoodFriday2012,
124
+ GoodFriday2015,
125
+ GoodFriday2021,
126
+ GoodFridayAfter2022,
127
+ ]
128
+ ),
129
+ ),
130
+ ]
@@ -1,136 +1,136 @@
1
- from datetime import time
2
-
3
- from pandas.tseries.holiday import AbstractHolidayCalendar
4
-
5
- from pandas_market_calendars.holidays.cme import (
6
- USMartinLutherKingJrAfter1998Before2015,
7
- USMartinLutherKingJrAfter1998Before2016FridayBefore,
8
- USMartinLutherKingJrAfter2015,
9
- USPresidentsDayBefore2016FridayBefore,
10
- USPresidentsDayBefore2015,
11
- USPresidentsDayAfter2015,
12
- GoodFridayBefore2021NotEarlyClose,
13
- GoodFriday2009,
14
- GoodFriday2010,
15
- GoodFriday2012,
16
- GoodFriday2015,
17
- GoodFriday2021,
18
- GoodFriday2022,
19
- GoodFridayAfter2022,
20
- USMemorialDay2013AndPrior,
21
- USMemorialDayAfter2013,
22
- USMemorialDay2015AndPriorFridayBefore,
23
- USIndependenceDayBefore2014,
24
- USIndependenceDayAfter2014,
25
- USLaborDayStarting1887Before2014,
26
- USLaborDayStarting1887Before2015FridayBefore,
27
- USLaborDayStarting1887After2014,
28
- USThanksgivingBefore2014,
29
- USThanksgivingAfter2014,
30
- USThanksgivingFriday,
31
- )
32
- from pandas_market_calendars.holidays.us import (
33
- USNewYearsDay,
34
- ChristmasEveInOrAfter1993,
35
- Christmas,
36
- USJuneteenthAfter2022,
37
- )
38
- from .cme_globex_base import CMEGlobexBaseExchangeCalendar
39
-
40
-
41
- class CMEGlobexFixedIncomeCalendar(CMEGlobexBaseExchangeCalendar):
42
- aliases = ["CME Globex Fixed Income", "CME Globex Interest Rate Products"]
43
-
44
- regular_market_times = {
45
- "market_open": ((None, time(18), -1),),
46
- "market_close": ((None, time(17)),),
47
- }
48
-
49
- """
50
- Not yet implemented:
51
- Christmas/New_Years
52
- 5am special open for a couple years (see tests)
53
-
54
- regular market_open/market_close changed from 17/16 to 18/17?
55
- """
56
-
57
- @property
58
- def name(self):
59
- return "CME Globex Fixed Income"
60
-
61
- @property
62
- def regular_holidays(self):
63
- return AbstractHolidayCalendar(
64
- rules=[
65
- USNewYearsDay,
66
- GoodFridayBefore2021NotEarlyClose,
67
- GoodFriday2022,
68
- Christmas,
69
- ]
70
- )
71
-
72
- @property
73
- def special_closes_adhoc(self):
74
- return [
75
- (time(15, 15), ["2010-07-02", "2011-07-01"]),
76
- (time(12, 15), ["2010-12-31"]),
77
- ]
78
-
79
- @property
80
- def special_closes(self):
81
- # Source https://www.cmegroup.com/tools-information/holiday-calendar.html
82
- return [
83
- (
84
- time(12),
85
- AbstractHolidayCalendar(
86
- rules=[
87
- USMartinLutherKingJrAfter1998Before2015,
88
- USMartinLutherKingJrAfter2015,
89
- USPresidentsDayBefore2015,
90
- USPresidentsDayAfter2015,
91
- USMemorialDay2013AndPrior,
92
- USMemorialDayAfter2013,
93
- USIndependenceDayBefore2014,
94
- USIndependenceDayAfter2014,
95
- USLaborDayStarting1887Before2014,
96
- USLaborDayStarting1887After2014,
97
- USThanksgivingBefore2014,
98
- USThanksgivingAfter2014,
99
- USJuneteenthAfter2022,
100
- ]
101
- ),
102
- ),
103
- (
104
- time(15, 15),
105
- AbstractHolidayCalendar(
106
- rules=[
107
- USMartinLutherKingJrAfter1998Before2016FridayBefore,
108
- USPresidentsDayBefore2016FridayBefore,
109
- GoodFriday2009,
110
- USMemorialDay2015AndPriorFridayBefore,
111
- USLaborDayStarting1887Before2015FridayBefore,
112
- ]
113
- ),
114
- ),
115
- (
116
- time(12, 15),
117
- AbstractHolidayCalendar(
118
- rules=[
119
- USThanksgivingFriday,
120
- ChristmasEveInOrAfter1993,
121
- ]
122
- ),
123
- ),
124
- (
125
- time(10, 15),
126
- AbstractHolidayCalendar(
127
- rules=[
128
- GoodFriday2010,
129
- GoodFriday2012,
130
- GoodFriday2015,
131
- GoodFriday2021,
132
- GoodFridayAfter2022,
133
- ]
134
- ),
135
- ),
136
- ]
1
+ from datetime import time
2
+
3
+ from pandas.tseries.holiday import AbstractHolidayCalendar
4
+
5
+ from pandas_market_calendars.holidays.cme import (
6
+ USMartinLutherKingJrAfter1998Before2015,
7
+ USMartinLutherKingJrAfter1998Before2016FridayBefore,
8
+ USMartinLutherKingJrAfter2015,
9
+ USPresidentsDayBefore2016FridayBefore,
10
+ USPresidentsDayBefore2015,
11
+ USPresidentsDayAfter2015,
12
+ GoodFridayBefore2021NotEarlyClose,
13
+ GoodFriday2009,
14
+ GoodFriday2010,
15
+ GoodFriday2012,
16
+ GoodFriday2015,
17
+ GoodFriday2021,
18
+ GoodFriday2022,
19
+ GoodFridayAfter2022,
20
+ USMemorialDay2013AndPrior,
21
+ USMemorialDayAfter2013,
22
+ USMemorialDay2015AndPriorFridayBefore,
23
+ USIndependenceDayBefore2014,
24
+ USIndependenceDayAfter2014,
25
+ USLaborDayStarting1887Before2014,
26
+ USLaborDayStarting1887Before2015FridayBefore,
27
+ USLaborDayStarting1887After2014,
28
+ USThanksgivingBefore2014,
29
+ USThanksgivingAfter2014,
30
+ USThanksgivingFriday,
31
+ )
32
+ from pandas_market_calendars.holidays.us import (
33
+ USNewYearsDay,
34
+ ChristmasEveInOrAfter1993,
35
+ Christmas,
36
+ USJuneteenthAfter2022,
37
+ )
38
+ from .cme_globex_base import CMEGlobexBaseExchangeCalendar
39
+
40
+
41
+ class CMEGlobexFixedIncomeCalendar(CMEGlobexBaseExchangeCalendar):
42
+ aliases = ["CME Globex Fixed Income", "CME Globex Interest Rate Products"]
43
+
44
+ regular_market_times = {
45
+ "market_open": ((None, time(18), -1),),
46
+ "market_close": ((None, time(17)),),
47
+ }
48
+
49
+ """
50
+ Not yet implemented:
51
+ Christmas/New_Years
52
+ 5am special open for a couple years (see tests)
53
+
54
+ regular market_open/market_close changed from 17/16 to 18/17?
55
+ """
56
+
57
+ @property
58
+ def name(self):
59
+ return "CME Globex Fixed Income"
60
+
61
+ @property
62
+ def regular_holidays(self):
63
+ return AbstractHolidayCalendar(
64
+ rules=[
65
+ USNewYearsDay,
66
+ GoodFridayBefore2021NotEarlyClose,
67
+ GoodFriday2022,
68
+ Christmas,
69
+ ]
70
+ )
71
+
72
+ @property
73
+ def special_closes_adhoc(self):
74
+ return [
75
+ (time(15, 15), ["2010-07-02", "2011-07-01"]),
76
+ (time(12, 15), ["2010-12-31"]),
77
+ ]
78
+
79
+ @property
80
+ def special_closes(self):
81
+ # Source https://www.cmegroup.com/tools-information/holiday-calendar.html
82
+ return [
83
+ (
84
+ time(12),
85
+ AbstractHolidayCalendar(
86
+ rules=[
87
+ USMartinLutherKingJrAfter1998Before2015,
88
+ USMartinLutherKingJrAfter2015,
89
+ USPresidentsDayBefore2015,
90
+ USPresidentsDayAfter2015,
91
+ USMemorialDay2013AndPrior,
92
+ USMemorialDayAfter2013,
93
+ USIndependenceDayBefore2014,
94
+ USIndependenceDayAfter2014,
95
+ USLaborDayStarting1887Before2014,
96
+ USLaborDayStarting1887After2014,
97
+ USThanksgivingBefore2014,
98
+ USThanksgivingAfter2014,
99
+ USJuneteenthAfter2022,
100
+ ]
101
+ ),
102
+ ),
103
+ (
104
+ time(15, 15),
105
+ AbstractHolidayCalendar(
106
+ rules=[
107
+ USMartinLutherKingJrAfter1998Before2016FridayBefore,
108
+ USPresidentsDayBefore2016FridayBefore,
109
+ GoodFriday2009,
110
+ USMemorialDay2015AndPriorFridayBefore,
111
+ USLaborDayStarting1887Before2015FridayBefore,
112
+ ]
113
+ ),
114
+ ),
115
+ (
116
+ time(12, 15),
117
+ AbstractHolidayCalendar(
118
+ rules=[
119
+ USThanksgivingFriday,
120
+ ChristmasEveInOrAfter1993,
121
+ ]
122
+ ),
123
+ ),
124
+ (
125
+ time(10, 15),
126
+ AbstractHolidayCalendar(
127
+ rules=[
128
+ GoodFriday2010,
129
+ GoodFriday2012,
130
+ GoodFriday2015,
131
+ GoodFriday2021,
132
+ GoodFridayAfter2022,
133
+ ]
134
+ ),
135
+ ),
136
+ ]