pandas-market-calendars 4.4.2__py3-none-any.whl → 4.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pandas_market_calendars/__init__.py +38 -38
- pandas_market_calendars/calendar_registry.py +57 -57
- pandas_market_calendars/calendar_utils.py +262 -262
- pandas_market_calendars/calendars/asx.py +66 -66
- pandas_market_calendars/calendars/bmf.py +223 -223
- pandas_market_calendars/calendars/bse.py +421 -421
- pandas_market_calendars/calendars/cboe.py +145 -145
- pandas_market_calendars/calendars/cme.py +405 -405
- pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
- pandas_market_calendars/calendars/cme_globex_base.py +119 -119
- pandas_market_calendars/calendars/cme_globex_crypto.py +160 -160
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
- pandas_market_calendars/calendars/cme_globex_equities.py +123 -123
- pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -136
- pandas_market_calendars/calendars/cme_globex_fx.py +101 -101
- pandas_market_calendars/calendars/eurex.py +131 -131
- pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
- pandas_market_calendars/calendars/hkex.py +429 -429
- pandas_market_calendars/calendars/ice.py +81 -81
- pandas_market_calendars/calendars/iex.py +112 -112
- pandas_market_calendars/calendars/lse.py +114 -114
- pandas_market_calendars/calendars/mirror.py +149 -149
- pandas_market_calendars/calendars/nyse.py +3 -0
- pandas_market_calendars/calendars/ose.py +116 -116
- pandas_market_calendars/calendars/sifma.py +354 -354
- pandas_market_calendars/calendars/six.py +132 -132
- pandas_market_calendars/calendars/sse.py +1 -1
- pandas_market_calendars/calendars/tase.py +197 -197
- pandas_market_calendars/calendars/tsx.py +181 -181
- pandas_market_calendars/holidays/cme.py +385 -385
- pandas_market_calendars/holidays/cme_globex.py +214 -214
- pandas_market_calendars/holidays/cn.py +20 -0
- pandas_market_calendars/holidays/jp.py +401 -401
- pandas_market_calendars/holidays/jpx_equinox.py +506 -506
- pandas_market_calendars/holidays/nyse.py +5 -0
- pandas_market_calendars/holidays/oz.py +63 -63
- pandas_market_calendars/holidays/sifma.py +350 -350
- pandas_market_calendars/holidays/us.py +376 -376
- pandas_market_calendars/market_calendar.py +20 -1
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/METADATA +1 -1
- pandas_market_calendars-4.5.1.dist-info/RECORD +50 -0
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/WHEEL +1 -1
- pandas_market_calendars-4.4.2.dist-info/RECORD +0 -50
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/LICENSE +0 -0
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/NOTICE +0 -0
- {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.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
|
+
)
|
@@ -584,6 +584,26 @@ all_holidays = [
|
|
584
584
|
Timestamp("2024-10-03"),
|
585
585
|
Timestamp("2024-10-04"),
|
586
586
|
Timestamp("2024-10-07"),
|
587
|
+
# 2025 holidays
|
588
|
+
Timestamp("2025-01-01"), # New Year
|
589
|
+
Timestamp("2025-01-28"), # Spring Festival
|
590
|
+
Timestamp("2025-01-29"),
|
591
|
+
Timestamp("2025-01-30"),
|
592
|
+
Timestamp("2025-01-31"),
|
593
|
+
Timestamp("2025-02-03"),
|
594
|
+
Timestamp("2025-02-04"),
|
595
|
+
Timestamp("2025-04-04"), # Tomb-sweeping Day
|
596
|
+
Timestamp("2025-04-05"),
|
597
|
+
Timestamp("2025-05-01"), # Labor Day
|
598
|
+
Timestamp("2025-05-02"),
|
599
|
+
Timestamp("2025-05-05"),
|
600
|
+
Timestamp("2025-06-02"), # Dragon Boat Festival
|
601
|
+
Timestamp("2025-10-01"), # National Day & Mid-autumn Festival
|
602
|
+
Timestamp("2025-10-02"),
|
603
|
+
Timestamp("2025-10-03"),
|
604
|
+
Timestamp("2025-10-06"),
|
605
|
+
Timestamp("2025-10-07"),
|
606
|
+
Timestamp("2025-10-08"),
|
587
607
|
]
|
588
608
|
|
589
609
|
# The following holidays are based on Solar terms or Chinese lunisolar calendar,
|