pandas-market-calendars 4.3.2__py3-none-any.whl → 4.3.3__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. pandas_market_calendars/__init__.py +38 -38
  2. pandas_market_calendars/calendar_registry.py +53 -52
  3. pandas_market_calendars/calendar_utils.py +261 -261
  4. pandas_market_calendars/calendars/asx.py +66 -66
  5. pandas_market_calendars/calendars/bmf.py +206 -206
  6. pandas_market_calendars/calendars/bse.py +407 -407
  7. pandas_market_calendars/calendars/cboe.py +145 -145
  8. pandas_market_calendars/calendars/cme.py +402 -402
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +126 -127
  10. pandas_market_calendars/calendars/cme_globex_base.py +119 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +160 -147
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +123 -121
  14. pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -134
  15. pandas_market_calendars/calendars/cme_globex_fx.py +101 -92
  16. pandas_market_calendars/calendars/eurex.py +139 -139
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +98 -0
  18. pandas_market_calendars/calendars/hkex.py +426 -426
  19. pandas_market_calendars/calendars/ice.py +81 -81
  20. pandas_market_calendars/calendars/iex.py +112 -111
  21. pandas_market_calendars/calendars/jpx.py +109 -109
  22. pandas_market_calendars/calendars/lse.py +114 -114
  23. pandas_market_calendars/calendars/mirror.py +130 -129
  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 +350 -335
  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 -195
  30. pandas_market_calendars/calendars/tsx.py +181 -181
  31. pandas_market_calendars/holidays/cme.py +385 -372
  32. pandas_market_calendars/holidays/cme_globex.py +214 -223
  33. pandas_market_calendars/holidays/cn.py +1455 -1455
  34. pandas_market_calendars/holidays/jp.py +398 -394
  35. pandas_market_calendars/holidays/nyse.py +1531 -1539
  36. pandas_market_calendars/holidays/oz.py +63 -65
  37. pandas_market_calendars/holidays/sifma.py +338 -350
  38. pandas_market_calendars/holidays/us.py +376 -377
  39. pandas_market_calendars/market_calendar.py +895 -895
  40. {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/METADATA +3 -3
  41. pandas_market_calendars-4.3.3.dist-info/RECORD +50 -0
  42. pandas_market_calendars-4.3.2.dist-info/RECORD +0 -49
  43. {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/LICENSE +0 -0
  44. {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/NOTICE +0 -0
  45. {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/WHEEL +0 -0
  46. {pandas_market_calendars-4.3.2.dist-info → pandas_market_calendars-4.3.3.dist-info}/top_level.txt +0 -0
@@ -1,92 +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
- GoodFridayAfter2021,
14
- USMemorialDay2021AndPrior,
15
- USIndependenceDayBefore2022,
16
- USLaborDayStarting1887Before2022,
17
- USThanksgivingBefore2022,
18
- USThanksgivingFriday,
19
- )
20
- from pandas_market_calendars.holidays.us import (
21
- USNewYearsDay,
22
- ChristmasEveInOrAfter1993,
23
- Christmas,
24
- )
25
-
26
- _1015 = time(10, 15)
27
- _1200 = time(12, 0)
28
- _1215 = time(12, 15)
29
-
30
-
31
- class CMEGlobexFXExchangeCalendar(CMEGlobexBaseExchangeCalendar):
32
- aliases = ["CME_Currency"]
33
-
34
- # Using CME Globex trading times eg AUD/USD, EUR/GBP, and BRL/USD
35
- # https://www.cmegroup.com/markets/fx/g10/australian-dollar.contractSpecs.html
36
- # https://www.cmegroup.com/markets/fx/cross-rates/euro-fx-british-pound.contractSpecs.html
37
- # https://www.cmegroup.com/markets/fx/emerging-market/brazilian-real.contractSpecs.html
38
- # CME "NZD spot" has its own holiday schedule; this is a niche product (via "FX Link") and is not handled in this
39
- # class; however, its regular hours follow the same schedule (see
40
- # https://www.cmegroup.com/trading/fx/files/fx-product-guide-2021-us.pdf)
41
- regular_market_times = {
42
- "market_open": ((None, time(17), -1),), # offset by -1 day
43
- "market_close": ((None, time(16, 00)),),
44
- }
45
-
46
- aliases = ["CMEGlobex_FX", "CME_FX", "CME_Currency"]
47
-
48
- @property
49
- def name(self):
50
- return "CMEGlobex_FX"
51
-
52
- @property
53
- def regular_holidays(self):
54
- return AbstractHolidayCalendar(
55
- rules=[
56
- USNewYearsDay,
57
- GoodFridayBefore2021,
58
- GoodFridayAfter2021,
59
- Christmas,
60
- ]
61
- )
62
-
63
- @property
64
- def special_closes(self):
65
- """
66
- Accurate 2020-2022 inclusive
67
- TODO - enhance/verify prior to 2020
68
- TODO - Add 2023+ once known
69
- """
70
- # Source https://www.cmegroup.com/tools-information/holiday-calendar.html
71
- return [
72
- (_1015, AbstractHolidayCalendar(rules=[GoodFriday2021])),
73
- (
74
- _1200,
75
- AbstractHolidayCalendar(
76
- rules=[
77
- USMartinLutherKingJrAfter1998Before2022,
78
- USPresidentsDayBefore2022,
79
- USMemorialDay2021AndPrior,
80
- USIndependenceDayBefore2022,
81
- USLaborDayStarting1887Before2022,
82
- USThanksgivingBefore2022,
83
- ]
84
- ),
85
- ),
86
- (
87
- _1215,
88
- AbstractHolidayCalendar(
89
- rules=[USThanksgivingFriday, ChristmasEveInOrAfter1993]
90
- ),
91
- ),
92
- ]
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,139 +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 pytz import timezone
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
- # German National Holiday (Tag der Deutschen Einheit)
47
- GermanNationalDay = Holiday(
48
- "Tag der Deutschen Einheit",
49
- month=10,
50
- day=3,
51
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
52
- )
53
- # Christmas Eve
54
- ChristmasEve = Holiday(
55
- "Christmas Eve",
56
- month=12,
57
- day=24,
58
- observance=previous_friday,
59
- )
60
- # Christmas
61
- Christmas = Holiday(
62
- "Christmas",
63
- month=12,
64
- day=25,
65
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
66
- )
67
- # If christmas day is Saturday Monday 27th is a holiday
68
- # If christmas day is sunday the Tuesday 27th is a holiday
69
- WeekendChristmas = Holiday(
70
- "Weekend Christmas",
71
- month=12,
72
- day=27,
73
- days_of_week=(MONDAY, TUESDAY),
74
- )
75
- # Boxing day
76
- BoxingDay = Holiday(
77
- "Boxing Day",
78
- month=12,
79
- day=26,
80
- )
81
- # If boxing day is saturday then Monday 28th is a holiday
82
- # If boxing day is sunday then Tuesday 28th is a holiday
83
- WeekendBoxingDay = Holiday(
84
- "Weekend Boxing Day",
85
- month=12,
86
- day=28,
87
- days_of_week=(MONDAY, TUESDAY),
88
- )
89
-
90
-
91
- class EUREXExchangeCalendar(MarketCalendar):
92
- """
93
- Exchange calendar for EUREX
94
-
95
- """
96
-
97
- aliases = ["EUREX"]
98
- regular_market_times = {
99
- "market_open": ((None, time(9)),),
100
- "market_close": ((None, time(17, 30)),),
101
- }
102
-
103
- @property
104
- def name(self):
105
- return "EUREX"
106
-
107
- @property
108
- def tz(self):
109
- return timezone("Europe/Berlin")
110
-
111
- @property
112
- def regular_holidays(self):
113
- return AbstractHolidayCalendar(
114
- rules=[
115
- EUREXNewYearsDay,
116
- GoodFriday,
117
- EasterMonday,
118
- MayBank,
119
- GermanNationalDay,
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
- ]
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 pytz import timezone
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
+ # German National Holiday (Tag der Deutschen Einheit)
47
+ GermanNationalDay = Holiday(
48
+ "Tag der Deutschen Einheit",
49
+ month=10,
50
+ day=3,
51
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
52
+ )
53
+ # Christmas Eve
54
+ ChristmasEve = Holiday(
55
+ "Christmas Eve",
56
+ month=12,
57
+ day=24,
58
+ observance=previous_friday,
59
+ )
60
+ # Christmas
61
+ Christmas = Holiday(
62
+ "Christmas",
63
+ month=12,
64
+ day=25,
65
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
66
+ )
67
+ # If christmas day is Saturday Monday 27th is a holiday
68
+ # If christmas day is sunday the Tuesday 27th is a holiday
69
+ WeekendChristmas = Holiday(
70
+ "Weekend Christmas",
71
+ month=12,
72
+ day=27,
73
+ days_of_week=(MONDAY, TUESDAY),
74
+ )
75
+ # Boxing day
76
+ BoxingDay = Holiday(
77
+ "Boxing Day",
78
+ month=12,
79
+ day=26,
80
+ )
81
+ # If boxing day is saturday then Monday 28th is a holiday
82
+ # If boxing day is sunday then Tuesday 28th is a holiday
83
+ WeekendBoxingDay = Holiday(
84
+ "Weekend Boxing Day",
85
+ month=12,
86
+ day=28,
87
+ days_of_week=(MONDAY, TUESDAY),
88
+ )
89
+
90
+
91
+ class EUREXExchangeCalendar(MarketCalendar):
92
+ """
93
+ Exchange calendar for EUREX
94
+
95
+ """
96
+
97
+ aliases = ["EUREX"]
98
+ regular_market_times = {
99
+ "market_open": ((None, time(9)),),
100
+ "market_close": ((None, time(17, 30)),),
101
+ }
102
+
103
+ @property
104
+ def name(self):
105
+ return "EUREX"
106
+
107
+ @property
108
+ def tz(self):
109
+ return timezone("Europe/Berlin")
110
+
111
+ @property
112
+ def regular_holidays(self):
113
+ return AbstractHolidayCalendar(
114
+ rules=[
115
+ EUREXNewYearsDay,
116
+ GoodFriday,
117
+ EasterMonday,
118
+ MayBank,
119
+ GermanNationalDay,
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
+ ]
@@ -0,0 +1,98 @@
1
+ from datetime import time
2
+
3
+ from pandas.tseries.holiday import (
4
+ AbstractHolidayCalendar,
5
+ EasterMonday,
6
+ GoodFriday,
7
+ Holiday,
8
+ )
9
+ from pytz import timezone
10
+
11
+ from pandas_market_calendars.market_calendar import (
12
+ FRIDAY,
13
+ MONDAY,
14
+ MarketCalendar,
15
+ THURSDAY,
16
+ TUESDAY,
17
+ WEDNESDAY,
18
+ )
19
+
20
+ # New Year's Day
21
+ EUREXNewYearsDay = Holiday(
22
+ "New Year's Day",
23
+ month=1,
24
+ day=1,
25
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
26
+ )
27
+ # Early May bank holiday
28
+ MayBank = Holiday(
29
+ "Early May Bank Holiday",
30
+ month=5,
31
+ day=1,
32
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
33
+ )
34
+ # Christmas Eve
35
+ ChristmasEve = Holiday(
36
+ "Christmas Eve",
37
+ month=12,
38
+ day=24,
39
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
40
+ )
41
+ # Christmas
42
+ Christmas = Holiday(
43
+ "Christmas",
44
+ month=12,
45
+ day=25,
46
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
47
+ )
48
+ # Boxing day
49
+ BoxingDay = Holiday(
50
+ "Boxing Day",
51
+ month=12,
52
+ day=26,
53
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
54
+ )
55
+ # New Year's Eve
56
+ NewYearsEve = Holiday(
57
+ "New Year's Eve",
58
+ month=12,
59
+ day=31,
60
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
61
+ )
62
+
63
+
64
+ class EUREXFixedIncomeCalendar(MarketCalendar):
65
+ """
66
+ Trading calendar available here:
67
+ https://www.eurex.com/resource/blob/3378814/910cf372738890f691bc1bfbccfd3aef/data/tradingcalendar_2023_en.pdf
68
+ """
69
+
70
+ aliases = ["EUREX_Bond"]
71
+
72
+ regular_market_times = {
73
+ "market_open": ((None, time(1, 10)), ("2018-12-10", time(8, 0))),
74
+ "market_close": ((None, time(22)),),
75
+ }
76
+
77
+ @property
78
+ def name(self):
79
+ return "EUREX_Bond"
80
+
81
+ @property
82
+ def tz(self):
83
+ return timezone("Europe/Berlin")
84
+
85
+ @property
86
+ def regular_holidays(self):
87
+ return AbstractHolidayCalendar(
88
+ rules=[
89
+ EUREXNewYearsDay,
90
+ GoodFriday,
91
+ EasterMonday,
92
+ MayBank,
93
+ ChristmasEve,
94
+ Christmas,
95
+ BoxingDay,
96
+ NewYearsEve,
97
+ ]
98
+ )