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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. pandas_market_calendars/__init__.py +39 -38
  2. pandas_market_calendars/calendar_registry.py +57 -53
  3. pandas_market_calendars/calendar_utils.py +1200 -261
  4. pandas_market_calendars/calendars/asx.py +66 -66
  5. pandas_market_calendars/calendars/bmf.py +223 -206
  6. pandas_market_calendars/calendars/bse.py +421 -407
  7. pandas_market_calendars/calendars/cboe.py +145 -145
  8. pandas_market_calendars/calendars/cme.py +405 -402
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -126
  10. pandas_market_calendars/calendars/cme_globex_base.py +119 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +160 -160
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +123 -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 +131 -139
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
  18. pandas_market_calendars/calendars/hkex.py +429 -426
  19. pandas_market_calendars/calendars/ice.py +81 -81
  20. pandas_market_calendars/calendars/iex.py +151 -112
  21. pandas_market_calendars/calendars/jpx.py +113 -109
  22. pandas_market_calendars/calendars/lse.py +114 -114
  23. pandas_market_calendars/calendars/mirror.py +149 -130
  24. pandas_market_calendars/calendars/nyse.py +1466 -1324
  25. pandas_market_calendars/calendars/ose.py +116 -116
  26. pandas_market_calendars/calendars/sifma.py +354 -350
  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 +220 -197
  30. pandas_market_calendars/calendars/tsx.py +181 -181
  31. pandas_market_calendars/holidays/cme.py +385 -385
  32. pandas_market_calendars/holidays/cme_globex.py +214 -214
  33. pandas_market_calendars/holidays/cn.py +1476 -1455
  34. pandas_market_calendars/holidays/jp.py +401 -398
  35. pandas_market_calendars/holidays/jpx_equinox.py +1 -0
  36. pandas_market_calendars/holidays/nyse.py +1536 -1531
  37. pandas_market_calendars/holidays/oz.py +63 -63
  38. pandas_market_calendars/holidays/sifma.py +350 -338
  39. pandas_market_calendars/holidays/us.py +376 -376
  40. pandas_market_calendars/market_calendar.py +1057 -895
  41. {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/METADATA +13 -9
  42. pandas_market_calendars-4.6.0.dist-info/RECORD +50 -0
  43. {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/WHEEL +1 -1
  44. pandas_market_calendars-4.3.3.dist-info/RECORD +0 -50
  45. {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/LICENSE +0 -0
  46. {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/NOTICE +0 -0
  47. {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/top_level.txt +0 -0
@@ -1,214 +1,214 @@
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
- )
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
+ )