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