pandas-market-calendars 4.3.1__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 (49) hide show
  1. pandas_market_calendars/__init__.py +38 -37
  2. pandas_market_calendars/calendar_registry.py +53 -48
  3. pandas_market_calendars/calendar_utils.py +261 -225
  4. pandas_market_calendars/calendars/asx.py +66 -63
  5. pandas_market_calendars/calendars/bmf.py +206 -227
  6. pandas_market_calendars/calendars/bse.py +407 -409
  7. pandas_market_calendars/calendars/cboe.py +145 -115
  8. pandas_market_calendars/calendars/cme.py +402 -240
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +126 -103
  10. pandas_market_calendars/calendars/cme_globex_base.py +119 -103
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +160 -147
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -138
  13. pandas_market_calendars/calendars/cme_globex_equities.py +123 -104
  14. pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -113
  15. pandas_market_calendars/calendars/cme_globex_fx.py +101 -78
  16. pandas_market_calendars/calendars/eurex.py +139 -119
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +98 -0
  18. pandas_market_calendars/calendars/hkex.py +426 -408
  19. pandas_market_calendars/calendars/ice.py +81 -65
  20. pandas_market_calendars/calendars/iex.py +112 -98
  21. pandas_market_calendars/calendars/jpx.py +109 -103
  22. pandas_market_calendars/calendars/lse.py +114 -91
  23. pandas_market_calendars/calendars/mirror.py +130 -114
  24. pandas_market_calendars/calendars/nyse.py +1324 -1127
  25. pandas_market_calendars/calendars/ose.py +116 -150
  26. pandas_market_calendars/calendars/sifma.py +350 -297
  27. pandas_market_calendars/calendars/six.py +132 -114
  28. pandas_market_calendars/calendars/sse.py +311 -290
  29. pandas_market_calendars/calendars/tase.py +197 -195
  30. pandas_market_calendars/calendars/tsx.py +181 -159
  31. pandas_market_calendars/class_registry.py +22 -16
  32. pandas_market_calendars/holidays/cme.py +385 -340
  33. pandas_market_calendars/holidays/cme_globex.py +214 -198
  34. pandas_market_calendars/holidays/cn.py +1455 -1436
  35. pandas_market_calendars/holidays/jp.py +398 -396
  36. pandas_market_calendars/holidays/jpx_equinox.py +453 -95
  37. pandas_market_calendars/holidays/nyse.py +1531 -1472
  38. pandas_market_calendars/holidays/oz.py +63 -65
  39. pandas_market_calendars/holidays/sifma.py +338 -321
  40. pandas_market_calendars/holidays/uk.py +32 -26
  41. pandas_market_calendars/holidays/us.py +376 -360
  42. pandas_market_calendars/market_calendar.py +895 -789
  43. {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/METADATA +7 -5
  44. pandas_market_calendars-4.3.3.dist-info/RECORD +50 -0
  45. {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/WHEEL +1 -1
  46. pandas_market_calendars-4.3.1.dist-info/RECORD +0 -49
  47. {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/LICENSE +0 -0
  48. {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/NOTICE +0 -0
  49. {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/top_level.txt +0 -0
@@ -1,119 +1,139 @@
1
- #
2
- # kewlfft
3
- #
4
-
5
- from datetime import time
6
-
7
- from pandas.tseries.holiday import AbstractHolidayCalendar, EasterMonday, GoodFriday, Holiday, previous_friday
8
- from pytz import timezone
9
-
10
- from pandas_market_calendars.market_calendar import (FRIDAY, MONDAY, MarketCalendar, THURSDAY, TUESDAY, WEDNESDAY)
11
-
12
- # New Year's Eve
13
- EUREXNewYearsEve = Holiday(
14
- "New Year's Eve",
15
- month=12,
16
- day=31,
17
- observance=previous_friday,
18
- )
19
- # New Year's Day
20
- EUREXNewYearsDay = Holiday(
21
- "New Year's Day",
22
- month=1,
23
- day=1,
24
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
25
- )
26
- # Early May bank holiday
27
- MayBank = Holiday(
28
- "Early May Bank Holiday",
29
- month=5,
30
- day=1,
31
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
32
- )
33
- # German National Holiday (Tag der Deutschen Einheit)
34
- GermanNationalDay = Holiday(
35
- 'Tag der Deutschen Einheit',
36
- month=10,
37
- day=3,
38
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
39
- )
40
- # Christmas Eve
41
- ChristmasEve = Holiday(
42
- 'Christmas Eve',
43
- month=12,
44
- day=24,
45
- observance=previous_friday,
46
- )
47
- # Christmas
48
- Christmas = Holiday(
49
- "Christmas",
50
- month=12,
51
- day=25,
52
- days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
53
- )
54
- # If christmas day is Saturday Monday 27th is a holiday
55
- # If christmas day is sunday the Tuesday 27th is a holiday
56
- WeekendChristmas = Holiday(
57
- "Weekend Christmas",
58
- month=12,
59
- day=27,
60
- days_of_week=(MONDAY, TUESDAY),
61
- )
62
- # Boxing day
63
- BoxingDay = Holiday(
64
- "Boxing Day",
65
- month=12,
66
- day=26,
67
- )
68
- # If boxing day is saturday then Monday 28th is a holiday
69
- # If boxing day is sunday then Tuesday 28th is a holiday
70
- WeekendBoxingDay = Holiday(
71
- "Weekend Boxing Day",
72
- month=12,
73
- day=28,
74
- days_of_week=(MONDAY, TUESDAY),
75
- )
76
-
77
-
78
- class EUREXExchangeCalendar(MarketCalendar):
79
- """
80
- Exchange calendar for EUREX
81
-
82
- """
83
- aliases = ['EUREX']
84
- regular_market_times = {
85
- "market_open": ((None, time(9)),),
86
- "market_close": ((None, time(17,30)),)
87
- }
88
-
89
- @property
90
- def name(self):
91
- return "EUREX"
92
-
93
- @property
94
- def tz(self):
95
- return timezone('Europe/Berlin')
96
-
97
- @property
98
- def regular_holidays(self):
99
- return AbstractHolidayCalendar(rules=[
100
- EUREXNewYearsDay,
101
- GoodFriday,
102
- EasterMonday,
103
- MayBank,
104
- GermanNationalDay,
105
- Christmas,
106
- WeekendChristmas,
107
- BoxingDay,
108
- WeekendBoxingDay
109
- ])
110
-
111
- @property
112
- def special_closes(self):
113
- return [(
114
- time(12, 30),
115
- AbstractHolidayCalendar(rules=[
116
- ChristmasEve,
117
- EUREXNewYearsEve,
118
- ])
119
- )]
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
+ )