pandas-market-calendars 5.1.0__py3-none-any.whl → 5.1.3__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 (49) hide show
  1. pandas_market_calendars/__init__.py +39 -39
  2. pandas_market_calendars/calendar_registry.py +58 -57
  3. pandas_market_calendars/calendar_utils.py +1151 -1151
  4. pandas_market_calendars/calendars/asx.py +100 -70
  5. pandas_market_calendars/calendars/bmf.py +225 -219
  6. pandas_market_calendars/calendars/bse.py +433 -425
  7. pandas_market_calendars/calendars/cboe.py +153 -149
  8. pandas_market_calendars/calendars/cme.py +417 -405
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
  10. pandas_market_calendars/calendars/cme_globex_base.py +127 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +166 -158
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +224 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +131 -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 +139 -131
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +106 -98
  18. pandas_market_calendars/calendars/hkex.py +437 -431
  19. pandas_market_calendars/calendars/ice.py +89 -81
  20. pandas_market_calendars/calendars/iex.py +163 -155
  21. pandas_market_calendars/calendars/jpx.py +125 -117
  22. pandas_market_calendars/calendars/lse.py +126 -118
  23. pandas_market_calendars/calendars/mirror.py +144 -144
  24. pandas_market_calendars/calendars/nyse.py +1462 -1466
  25. pandas_market_calendars/calendars/ose.py +124 -118
  26. pandas_market_calendars/calendars/sifma.py +391 -383
  27. pandas_market_calendars/calendars/six.py +144 -136
  28. pandas_market_calendars/calendars/sse.py +305 -315
  29. pandas_market_calendars/calendars/tase.py +232 -224
  30. pandas_market_calendars/calendars/tsx.py +193 -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 +82 -63
  39. pandas_market_calendars/holidays/sifma.py +350 -350
  40. pandas_market_calendars/holidays/uk.py +186 -186
  41. pandas_market_calendars/holidays/us.py +376 -376
  42. pandas_market_calendars/market_calendar.py +1006 -1008
  43. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/METADATA +5 -4
  44. pandas_market_calendars-5.1.3.dist-info/RECORD +50 -0
  45. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/WHEEL +1 -1
  46. pandas_market_calendars-5.1.0.dist-info/RECORD +0 -50
  47. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/licenses/LICENSE +0 -0
  48. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/licenses/NOTICE +0 -0
  49. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/top_level.txt +0 -0
@@ -1,101 +1,101 @@
1
- from datetime import time
2
-
3
- from pandas.tseries.holiday import AbstractHolidayCalendar
4
-
5
- from pandas_market_calendars.calendars.cme_globex_base import (
6
- CMEGlobexBaseExchangeCalendar,
7
- )
8
- from pandas_market_calendars.holidays.cme import (
9
- USMartinLutherKingJrAfter1998Before2022,
10
- USPresidentsDayBefore2022,
11
- GoodFridayBefore2021,
12
- GoodFriday2021,
13
- GoodFriday2022,
14
- GoodFridayAfter2022,
15
- USMemorialDay2021AndPrior,
16
- USIndependenceDayBefore2022,
17
- USLaborDayStarting1887Before2022,
18
- USThanksgivingBefore2022,
19
- USThanksgivingFriday,
20
- )
21
- from pandas_market_calendars.holidays.us import (
22
- USNewYearsDay,
23
- ChristmasEveInOrAfter1993,
24
- Christmas,
25
- )
26
-
27
- _1015 = time(10, 15)
28
- _1200 = time(12, 0)
29
- _1215 = time(12, 15)
30
-
31
-
32
- class CMEGlobexFXExchangeCalendar(CMEGlobexBaseExchangeCalendar):
33
- aliases = ["CME_Currency"]
34
-
35
- # Using CME Globex trading times eg AUD/USD, EUR/GBP, and BRL/USD
36
- # https://www.cmegroup.com/markets/fx/g10/australian-dollar.contractSpecs.html
37
- # https://www.cmegroup.com/markets/fx/cross-rates/euro-fx-british-pound.contractSpecs.html
38
- # https://www.cmegroup.com/markets/fx/emerging-market/brazilian-real.contractSpecs.html
39
- # CME "NZD spot" has its own holiday schedule; this is a niche product (via "FX Link") and is not handled in this
40
- # class; however, its regular hours follow the same schedule (see
41
- # https://www.cmegroup.com/trading/fx/files/fx-product-guide-2021-us.pdf)
42
- regular_market_times = {
43
- "market_open": ((None, time(17), -1),), # offset by -1 day
44
- "market_close": ((None, time(16, 00)),),
45
- }
46
-
47
- aliases = ["CMEGlobex_FX", "CME_FX", "CME_Currency"]
48
-
49
- @property
50
- def name(self):
51
- return "CMEGlobex_FX"
52
-
53
- @property
54
- def regular_holidays(self):
55
- return AbstractHolidayCalendar(
56
- rules=[
57
- USNewYearsDay,
58
- GoodFridayBefore2021,
59
- GoodFriday2022,
60
- Christmas,
61
- ]
62
- )
63
-
64
- @property
65
- def special_closes(self):
66
- """
67
- Accurate 2020-2022 inclusive
68
- TODO - enhance/verify prior to 2020
69
- TODO - Add 2023+ once known
70
- """
71
- # Source https://www.cmegroup.com/tools-information/holiday-calendar.html
72
- return [
73
- (
74
- _1015,
75
- AbstractHolidayCalendar(
76
- rules=[
77
- GoodFriday2021,
78
- GoodFridayAfter2022,
79
- ]
80
- ),
81
- ),
82
- (
83
- _1200,
84
- AbstractHolidayCalendar(
85
- rules=[
86
- USMartinLutherKingJrAfter1998Before2022,
87
- USPresidentsDayBefore2022,
88
- USMemorialDay2021AndPrior,
89
- USIndependenceDayBefore2022,
90
- USLaborDayStarting1887Before2022,
91
- USThanksgivingBefore2022,
92
- ]
93
- ),
94
- ),
95
- (
96
- _1215,
97
- AbstractHolidayCalendar(
98
- rules=[USThanksgivingFriday, ChristmasEveInOrAfter1993]
99
- ),
100
- ),
101
- ]
1
+ from datetime import time
2
+
3
+ from pandas.tseries.holiday import AbstractHolidayCalendar
4
+
5
+ from pandas_market_calendars.calendars.cme_globex_base import (
6
+ CMEGlobexBaseExchangeCalendar,
7
+ )
8
+ from pandas_market_calendars.holidays.cme import (
9
+ USMartinLutherKingJrAfter1998Before2022,
10
+ USPresidentsDayBefore2022,
11
+ GoodFridayBefore2021,
12
+ GoodFriday2021,
13
+ GoodFriday2022,
14
+ GoodFridayAfter2022,
15
+ USMemorialDay2021AndPrior,
16
+ USIndependenceDayBefore2022,
17
+ USLaborDayStarting1887Before2022,
18
+ USThanksgivingBefore2022,
19
+ USThanksgivingFriday,
20
+ )
21
+ from pandas_market_calendars.holidays.us import (
22
+ USNewYearsDay,
23
+ ChristmasEveInOrAfter1993,
24
+ Christmas,
25
+ )
26
+
27
+ _1015 = time(10, 15)
28
+ _1200 = time(12, 0)
29
+ _1215 = time(12, 15)
30
+
31
+
32
+ class CMEGlobexFXExchangeCalendar(CMEGlobexBaseExchangeCalendar):
33
+ aliases = ["CME_Currency"]
34
+
35
+ # Using CME Globex trading times eg AUD/USD, EUR/GBP, and BRL/USD
36
+ # https://www.cmegroup.com/markets/fx/g10/australian-dollar.contractSpecs.html
37
+ # https://www.cmegroup.com/markets/fx/cross-rates/euro-fx-british-pound.contractSpecs.html
38
+ # https://www.cmegroup.com/markets/fx/emerging-market/brazilian-real.contractSpecs.html
39
+ # CME "NZD spot" has its own holiday schedule; this is a niche product (via "FX Link") and is not handled in this
40
+ # class; however, its regular hours follow the same schedule (see
41
+ # https://www.cmegroup.com/trading/fx/files/fx-product-guide-2021-us.pdf)
42
+ regular_market_times = {
43
+ "market_open": ((None, time(17), -1),), # offset by -1 day
44
+ "market_close": ((None, time(16, 00)),),
45
+ }
46
+
47
+ aliases = ["CMEGlobex_FX", "CME_FX", "CME_Currency"]
48
+
49
+ @property
50
+ def name(self):
51
+ return "CMEGlobex_FX"
52
+
53
+ @property
54
+ def regular_holidays(self):
55
+ return AbstractHolidayCalendar(
56
+ rules=[
57
+ USNewYearsDay,
58
+ GoodFridayBefore2021,
59
+ GoodFriday2022,
60
+ Christmas,
61
+ ]
62
+ )
63
+
64
+ @property
65
+ def special_closes(self):
66
+ """
67
+ Accurate 2020-2022 inclusive
68
+ TODO - enhance/verify prior to 2020
69
+ TODO - Add 2023+ once known
70
+ """
71
+ # Source https://www.cmegroup.com/tools-information/holiday-calendar.html
72
+ return [
73
+ (
74
+ _1015,
75
+ AbstractHolidayCalendar(
76
+ rules=[
77
+ GoodFriday2021,
78
+ GoodFridayAfter2022,
79
+ ]
80
+ ),
81
+ ),
82
+ (
83
+ _1200,
84
+ AbstractHolidayCalendar(
85
+ rules=[
86
+ USMartinLutherKingJrAfter1998Before2022,
87
+ USPresidentsDayBefore2022,
88
+ USMemorialDay2021AndPrior,
89
+ USIndependenceDayBefore2022,
90
+ USLaborDayStarting1887Before2022,
91
+ USThanksgivingBefore2022,
92
+ ]
93
+ ),
94
+ ),
95
+ (
96
+ _1215,
97
+ AbstractHolidayCalendar(
98
+ rules=[USThanksgivingFriday, ChristmasEveInOrAfter1993]
99
+ ),
100
+ ),
101
+ ]
@@ -1,131 +1,139 @@
1
- #
2
- # kewlfft
3
- #
4
-
5
- from datetime import time
6
-
7
- from pandas.tseries.holiday import (
8
- AbstractHolidayCalendar,
9
- EasterMonday,
10
- GoodFriday,
11
- Holiday,
12
- previous_friday,
13
- )
14
- from zoneinfo import ZoneInfo
15
-
16
- from pandas_market_calendars.market_calendar import (
17
- FRIDAY,
18
- MONDAY,
19
- MarketCalendar,
20
- THURSDAY,
21
- TUESDAY,
22
- WEDNESDAY,
23
- )
24
-
25
- # New Year's Eve
26
- EUREXNewYearsEve = Holiday(
27
- "New Year's Eve",
28
- month=12,
29
- day=31,
30
- observance=previous_friday,
31
- )
32
- # New Year's Day
33
- EUREXNewYearsDay = Holiday(
34
- "New Year's Day",
35
- month=1,
36
- day=1,
37
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
38
- )
39
- # Early May bank holiday
40
- MayBank = Holiday(
41
- "Early May Bank Holiday",
42
- month=5,
43
- day=1,
44
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
45
- )
46
- # Christmas Eve
47
- ChristmasEve = Holiday(
48
- "Christmas Eve",
49
- month=12,
50
- day=24,
51
- observance=previous_friday,
52
- )
53
- # Christmas
54
- Christmas = Holiday(
55
- "Christmas",
56
- month=12,
57
- day=25,
58
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
59
- )
60
- # If christmas day is Saturday Monday 27th is a holiday
61
- # If christmas day is sunday the Tuesday 27th is a holiday
62
- WeekendChristmas = Holiday(
63
- "Weekend Christmas",
64
- month=12,
65
- day=27,
66
- days_of_week=(MONDAY, TUESDAY),
67
- )
68
- # Boxing day
69
- BoxingDay = Holiday(
70
- "Boxing Day",
71
- month=12,
72
- day=26,
73
- )
74
- # If boxing day is saturday then Monday 28th is a holiday
75
- # If boxing day is sunday then Tuesday 28th is a holiday
76
- WeekendBoxingDay = Holiday(
77
- "Weekend Boxing Day",
78
- month=12,
79
- day=28,
80
- days_of_week=(MONDAY, TUESDAY),
81
- )
82
-
83
-
84
- class EUREXExchangeCalendar(MarketCalendar):
85
- """
86
- Exchange calendar for EUREX
87
-
88
- """
89
-
90
- aliases = ["EUREX"]
91
- regular_market_times = {
92
- "market_open": ((None, time(9)),),
93
- "market_close": ((None, time(17, 30)),),
94
- }
95
-
96
- @property
97
- def name(self):
98
- return "EUREX"
99
-
100
- @property
101
- def tz(self):
102
- return ZoneInfo("Europe/Berlin")
103
-
104
- @property
105
- def regular_holidays(self):
106
- return AbstractHolidayCalendar(
107
- rules=[
108
- EUREXNewYearsDay,
109
- GoodFriday,
110
- EasterMonday,
111
- MayBank,
112
- Christmas,
113
- WeekendChristmas,
114
- BoxingDay,
115
- WeekendBoxingDay,
116
- ]
117
- )
118
-
119
- @property
120
- def special_closes(self):
121
- return [
122
- (
123
- time(12, 30),
124
- AbstractHolidayCalendar(
125
- rules=[
126
- ChristmasEve,
127
- EUREXNewYearsEve,
128
- ]
129
- ),
130
- )
131
- ]
1
+ #
2
+ # kewlfft
3
+ #
4
+
5
+ from datetime import time
6
+
7
+ from pandas.tseries.holiday import (
8
+ AbstractHolidayCalendar,
9
+ EasterMonday,
10
+ GoodFriday,
11
+ Holiday,
12
+ previous_friday,
13
+ )
14
+ import sys
15
+
16
+ # check python versiOn aNd import accordingly
17
+ if sys.version_info >= (3, 9):
18
+ # For Python 3.9 and later, import directly
19
+ from zoneinfo import ZoneInfo
20
+ else:
21
+ # For Python 3.8 and earlier, import from backports
22
+ from backports.zoneinfo import ZoneInfo
23
+
24
+ from pandas_market_calendars.market_calendar import (
25
+ FRIDAY,
26
+ MONDAY,
27
+ MarketCalendar,
28
+ THURSDAY,
29
+ TUESDAY,
30
+ WEDNESDAY,
31
+ )
32
+
33
+ # New Year's Eve
34
+ EUREXNewYearsEve = Holiday(
35
+ "New Year's Eve",
36
+ month=12,
37
+ day=31,
38
+ observance=previous_friday,
39
+ )
40
+ # New Year's Day
41
+ EUREXNewYearsDay = Holiday(
42
+ "New Year's Day",
43
+ month=1,
44
+ day=1,
45
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
46
+ )
47
+ # Early May bank holiday
48
+ MayBank = Holiday(
49
+ "Early May Bank Holiday",
50
+ month=5,
51
+ day=1,
52
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
53
+ )
54
+ # Christmas Eve
55
+ ChristmasEve = Holiday(
56
+ "Christmas Eve",
57
+ month=12,
58
+ day=24,
59
+ observance=previous_friday,
60
+ )
61
+ # Christmas
62
+ Christmas = Holiday(
63
+ "Christmas",
64
+ month=12,
65
+ day=25,
66
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
67
+ )
68
+ # If christmas day is Saturday Monday 27th is a holiday
69
+ # If christmas day is sunday the Tuesday 27th is a holiday
70
+ WeekendChristmas = Holiday(
71
+ "Weekend Christmas",
72
+ month=12,
73
+ day=27,
74
+ days_of_week=(MONDAY, TUESDAY),
75
+ )
76
+ # Boxing day
77
+ BoxingDay = Holiday(
78
+ "Boxing Day",
79
+ month=12,
80
+ day=26,
81
+ )
82
+ # If boxing day is saturday then Monday 28th is a holiday
83
+ # If boxing day is sunday then Tuesday 28th is a holiday
84
+ WeekendBoxingDay = Holiday(
85
+ "Weekend Boxing Day",
86
+ month=12,
87
+ day=28,
88
+ days_of_week=(MONDAY, TUESDAY),
89
+ )
90
+
91
+
92
+ class EUREXExchangeCalendar(MarketCalendar):
93
+ """
94
+ Exchange calendar for EUREX
95
+
96
+ """
97
+
98
+ aliases = ["EUREX"]
99
+ regular_market_times = {
100
+ "market_open": ((None, time(9)),),
101
+ "market_close": ((None, time(17, 30)),),
102
+ }
103
+
104
+ @property
105
+ def name(self):
106
+ return "EUREX"
107
+
108
+ @property
109
+ def tz(self):
110
+ return ZoneInfo("Europe/Berlin")
111
+
112
+ @property
113
+ def regular_holidays(self):
114
+ return AbstractHolidayCalendar(
115
+ rules=[
116
+ EUREXNewYearsDay,
117
+ GoodFriday,
118
+ EasterMonday,
119
+ MayBank,
120
+ Christmas,
121
+ WeekendChristmas,
122
+ BoxingDay,
123
+ WeekendBoxingDay,
124
+ ]
125
+ )
126
+
127
+ @property
128
+ def special_closes(self):
129
+ return [
130
+ (
131
+ time(12, 30),
132
+ AbstractHolidayCalendar(
133
+ rules=[
134
+ ChristmasEve,
135
+ EUREXNewYearsEve,
136
+ ]
137
+ ),
138
+ )
139
+ ]