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,223 +1,214 @@
1
- from dateutil.relativedelta import MO, TU, WE, TH, FR, SA, SU
2
- from pandas import DateOffset, Timestamp, date_range
3
- from datetime import timedelta
4
- from pandas.tseries.holiday import Holiday, nearest_workday, sunday_to_monday, Easter
5
- from pandas.tseries.offsets import Day, CustomBusinessDay
6
-
7
- from pandas_market_calendars.market_calendar import (
8
- MONDAY,
9
- TUESDAY,
10
- WEDNESDAY,
11
- THURSDAY,
12
- FRIDAY,
13
- SATURDAY,
14
- SUNDAY,
15
- )
16
-
17
-
18
- ####################################################
19
- # US New Years Day Jan 1
20
- #####################################################
21
- USNewYearsDay = Holiday(
22
- "New Years Day",
23
- month=1,
24
- day=1,
25
- start_date=Timestamp("1952-09-29"),
26
- # observance=sunday_to_monday,
27
- days_of_week=(
28
- MONDAY,
29
- TUESDAY,
30
- WEDNESDAY,
31
- THURSDAY,
32
- FRIDAY,
33
- ),
34
- )
35
-
36
-
37
- #########################################################################
38
- # Martin Luther King Jr.
39
- # Starting 1998
40
- ##########################################################################
41
- USMartinLutherKingJrFrom2022 = Holiday(
42
- "Dr. Martin Luther King Jr. Day",
43
- month=1,
44
- day=1,
45
- start_date=Timestamp("2022-01-01"),
46
- days_of_week=(
47
- MONDAY,
48
- TUESDAY,
49
- WEDNESDAY,
50
- THURSDAY,
51
- FRIDAY,
52
- ),
53
- offset=DateOffset(weekday=MO(3)),
54
- )
55
-
56
- USMartinLutherKingJrPre2022 = Holiday(
57
- "Dr. Martin Luther King Jr. Day",
58
- month=1,
59
- day=1,
60
- start_date=Timestamp("1998-01-01"),
61
- end_date=Timestamp("2021-12-31"),
62
- offset=DateOffset(weekday=MO(3)),
63
- )
64
-
65
-
66
- #########################################################################
67
- # US Presidents Day Feb
68
- ##########################################################################
69
- USPresidentsDayFrom2022 = Holiday(
70
- "President" "s Day",
71
- start_date=Timestamp("2022-01-01"),
72
- month=2,
73
- day=1,
74
- offset=DateOffset(weekday=MO(3)),
75
- )
76
-
77
- USPresidentsDayPre2022 = Holiday(
78
- "President" "s Day",
79
- end_date=Timestamp("2021-12-31"),
80
- month=2,
81
- day=1,
82
- offset=DateOffset(weekday=MO(3)),
83
- )
84
-
85
-
86
- ############################################################
87
- # Good Friday
88
- ############################################################
89
- GoodFriday = Holiday(
90
- "Good Friday 1908+",
91
- start_date=Timestamp("1908-01-01"),
92
- month=1,
93
- day=1,
94
- offset=[Easter(), Day(-2)],
95
- )
96
-
97
- ##################################################
98
- # US Memorial Day (Decoration Day) May 30
99
- ##################################################
100
- USMemorialDayFrom2022 = Holiday(
101
- "Memorial Day",
102
- month=5,
103
- day=25,
104
- start_date=Timestamp("2022-01-01"),
105
- offset=DateOffset(weekday=MO(1)),
106
- )
107
-
108
- USMemorialDayPre2022 = Holiday(
109
- "Memorial Day",
110
- month=5,
111
- day=25,
112
- end_date=Timestamp("2021-12-31"),
113
- offset=DateOffset(weekday=MO(1)),
114
- )
115
-
116
- #######################################
117
- # US Juneteenth (June 19th)
118
- #######################################
119
- USJuneteenthFrom2022 = Holiday(
120
- "Juneteenth Starting at 2022",
121
- start_date=Timestamp("2022-06-19"),
122
- month=6,
123
- day=19,
124
- observance=nearest_workday,
125
- )
126
-
127
- #######################################
128
- # US Independence Day July 4
129
- #######################################
130
- USIndependenceDayFrom2022 = Holiday(
131
- "July 4th",
132
- month=7,
133
- day=4,
134
- start_date=Timestamp("2022-01-01"),
135
- observance=nearest_workday,
136
- )
137
- USIndependenceDayPre2022 = Holiday(
138
- "July 4th",
139
- month=7,
140
- day=4,
141
- end_date=Timestamp("2021-12-31"),
142
- observance=nearest_workday,
143
- )
144
-
145
-
146
- #################################################
147
- # US Labor Day Starting 1887
148
- #################################################
149
- USLaborDayFrom2022 = Holiday(
150
- "Labor Day",
151
- month=9,
152
- day=1,
153
- start_date=Timestamp("2022-01-01"),
154
- offset=DateOffset(weekday=MO(1)),
155
- )
156
- USLaborDayPre2022 = Holiday(
157
- "Labor Day",
158
- month=9,
159
- day=1,
160
- end_date=Timestamp("2021-12-31"),
161
- offset=DateOffset(weekday=MO(1)),
162
- )
163
- USLaborDay = Holiday(
164
- "Labor Day",
165
- month=9,
166
- day=1,
167
- start_date=Timestamp("1887-01-01"),
168
- offset=DateOffset(weekday=MO(1)),
169
- )
170
-
171
-
172
- ################################################
173
- # US Thanksgiving Nov 30
174
- ################################################
175
- USThanksgivingDayFrom2022 = Holiday(
176
- "Thanksgiving",
177
- start_date=Timestamp("2022-01-01"),
178
- month=11,
179
- day=1,
180
- offset=DateOffset(weekday=TH(4)),
181
- )
182
-
183
- USThanksgivingDayPre2022 = Holiday(
184
- "Thanksgiving",
185
- end_date=Timestamp("2021-12-31"),
186
- month=11,
187
- day=1,
188
- offset=DateOffset(weekday=TH(4)),
189
- )
190
-
191
- FridayAfterThanksgiving = Holiday(
192
- "Friday after Thanksgiving",
193
- month=11,
194
- day=1,
195
- offset=[DateOffset(weekday=TH(4)), Day(1)],
196
- )
197
-
198
- USThanksgivingFridayFrom2021 = Holiday(
199
- "Thanksgiving Friday",
200
- month=11,
201
- day=1,
202
- offset=[DateOffset(weekday=TH(4)), Day(1)],
203
- start_date=Timestamp("2021-01-01"),
204
- )
205
-
206
- USThanksgivingFridayPre2021 = Holiday(
207
- "Thanksgiving Friday",
208
- month=11,
209
- day=1,
210
- offset=[DateOffset(weekday=TH(4)), Day(1)],
211
- end_date=Timestamp("2020-12-31"),
212
- )
213
-
214
- ################################
215
- # Christmas Dec 25
216
- ################################
217
- ChristmasCME = Holiday(
218
- "Christmas",
219
- month=12,
220
- day=25,
221
- start_date=Timestamp("1999-01-01"),
222
- observance=nearest_workday,
223
- )
1
+ from dateutil.relativedelta import MO, TH
2
+ from pandas import DateOffset, Timestamp
3
+ from pandas.tseries.holiday import Holiday, nearest_workday, Easter
4
+ from pandas.tseries.offsets import Day
5
+
6
+ from pandas_market_calendars.market_calendar import (
7
+ MONDAY,
8
+ TUESDAY,
9
+ WEDNESDAY,
10
+ THURSDAY,
11
+ FRIDAY,
12
+ )
13
+
14
+ ####################################################
15
+ # US New Years Day Jan 1
16
+ #####################################################
17
+ USNewYearsDay = Holiday(
18
+ "New Years Day",
19
+ month=1,
20
+ day=1,
21
+ start_date=Timestamp("1952-09-29"),
22
+ # observance=sunday_to_monday,
23
+ days_of_week=(
24
+ MONDAY,
25
+ TUESDAY,
26
+ WEDNESDAY,
27
+ THURSDAY,
28
+ FRIDAY,
29
+ ),
30
+ )
31
+
32
+ #########################################################################
33
+ # Martin Luther King Jr.
34
+ # Starting 1998
35
+ ##########################################################################
36
+ USMartinLutherKingJrFrom2022 = Holiday(
37
+ "Dr. Martin Luther King Jr. Day",
38
+ month=1,
39
+ day=1,
40
+ start_date=Timestamp("2022-01-01"),
41
+ days_of_week=(
42
+ MONDAY,
43
+ TUESDAY,
44
+ WEDNESDAY,
45
+ THURSDAY,
46
+ FRIDAY,
47
+ ),
48
+ offset=DateOffset(weekday=MO(3)),
49
+ )
50
+
51
+ USMartinLutherKingJrPre2022 = Holiday(
52
+ "Dr. Martin Luther King Jr. Day",
53
+ month=1,
54
+ day=1,
55
+ start_date=Timestamp("1998-01-01"),
56
+ end_date=Timestamp("2021-12-31"),
57
+ offset=DateOffset(weekday=MO(3)),
58
+ )
59
+
60
+ #########################################################################
61
+ # US Presidents Day Feb
62
+ ##########################################################################
63
+ USPresidentsDayFrom2022 = Holiday(
64
+ "President" "s Day",
65
+ start_date=Timestamp("2022-01-01"),
66
+ month=2,
67
+ day=1,
68
+ offset=DateOffset(weekday=MO(3)),
69
+ )
70
+
71
+ USPresidentsDayPre2022 = Holiday(
72
+ "President" "s Day",
73
+ end_date=Timestamp("2021-12-31"),
74
+ month=2,
75
+ day=1,
76
+ offset=DateOffset(weekday=MO(3)),
77
+ )
78
+
79
+ ############################################################
80
+ # Good Friday
81
+ ############################################################
82
+ GoodFriday = Holiday(
83
+ "Good Friday 1908+",
84
+ start_date=Timestamp("1908-01-01"),
85
+ month=1,
86
+ day=1,
87
+ offset=[Easter(), Day(-2)],
88
+ )
89
+
90
+ ##################################################
91
+ # US Memorial Day (Decoration Day) May 30
92
+ ##################################################
93
+ USMemorialDayFrom2022 = Holiday(
94
+ "Memorial Day",
95
+ month=5,
96
+ day=25,
97
+ start_date=Timestamp("2022-01-01"),
98
+ offset=DateOffset(weekday=MO(1)),
99
+ )
100
+
101
+ USMemorialDayPre2022 = Holiday(
102
+ "Memorial Day",
103
+ month=5,
104
+ day=25,
105
+ end_date=Timestamp("2021-12-31"),
106
+ offset=DateOffset(weekday=MO(1)),
107
+ )
108
+
109
+ #######################################
110
+ # US Juneteenth (June 19th)
111
+ #######################################
112
+ USJuneteenthFrom2022 = Holiday(
113
+ "Juneteenth Starting at 2022",
114
+ start_date=Timestamp("2022-06-19"),
115
+ month=6,
116
+ day=19,
117
+ observance=nearest_workday,
118
+ )
119
+
120
+ #######################################
121
+ # US Independence Day July 4
122
+ #######################################
123
+ USIndependenceDayFrom2022 = Holiday(
124
+ "July 4th",
125
+ month=7,
126
+ day=4,
127
+ start_date=Timestamp("2022-01-01"),
128
+ observance=nearest_workday,
129
+ )
130
+ USIndependenceDayPre2022 = Holiday(
131
+ "July 4th",
132
+ month=7,
133
+ day=4,
134
+ end_date=Timestamp("2021-12-31"),
135
+ observance=nearest_workday,
136
+ )
137
+
138
+ #################################################
139
+ # US Labor Day Starting 1887
140
+ #################################################
141
+ USLaborDayFrom2022 = Holiday(
142
+ "Labor Day",
143
+ month=9,
144
+ day=1,
145
+ start_date=Timestamp("2022-01-01"),
146
+ offset=DateOffset(weekday=MO(1)),
147
+ )
148
+ USLaborDayPre2022 = Holiday(
149
+ "Labor Day",
150
+ month=9,
151
+ day=1,
152
+ end_date=Timestamp("2021-12-31"),
153
+ offset=DateOffset(weekday=MO(1)),
154
+ )
155
+ USLaborDay = Holiday(
156
+ "Labor Day",
157
+ month=9,
158
+ day=1,
159
+ start_date=Timestamp("1887-01-01"),
160
+ offset=DateOffset(weekday=MO(1)),
161
+ )
162
+
163
+ ################################################
164
+ # US Thanksgiving Nov 30
165
+ ################################################
166
+ USThanksgivingDayFrom2022 = Holiday(
167
+ "Thanksgiving",
168
+ start_date=Timestamp("2022-01-01"),
169
+ month=11,
170
+ day=1,
171
+ offset=DateOffset(weekday=TH(4)),
172
+ )
173
+
174
+ USThanksgivingDayPre2022 = Holiday(
175
+ "Thanksgiving",
176
+ end_date=Timestamp("2021-12-31"),
177
+ month=11,
178
+ day=1,
179
+ offset=DateOffset(weekday=TH(4)),
180
+ )
181
+
182
+ FridayAfterThanksgiving = Holiday(
183
+ "Friday after Thanksgiving",
184
+ month=11,
185
+ day=1,
186
+ offset=[DateOffset(weekday=TH(4)), Day(1)],
187
+ )
188
+
189
+ USThanksgivingFridayFrom2021 = Holiday(
190
+ "Thanksgiving Friday",
191
+ month=11,
192
+ day=1,
193
+ offset=[DateOffset(weekday=TH(4)), Day(1)],
194
+ start_date=Timestamp("2021-01-01"),
195
+ )
196
+
197
+ USThanksgivingFridayPre2021 = Holiday(
198
+ "Thanksgiving Friday",
199
+ month=11,
200
+ day=1,
201
+ offset=[DateOffset(weekday=TH(4)), Day(1)],
202
+ end_date=Timestamp("2020-12-31"),
203
+ )
204
+
205
+ ################################
206
+ # Christmas Dec 25
207
+ ################################
208
+ ChristmasCME = Holiday(
209
+ "Christmas",
210
+ month=12,
211
+ day=25,
212
+ start_date=Timestamp("1999-01-01"),
213
+ observance=nearest_workday,
214
+ )