pandas-market-calendars 4.6.0__py3-none-any.whl → 5.0.0__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.
Files changed (34) hide show
  1. pandas_market_calendars/calendar_utils.py +27 -80
  2. pandas_market_calendars/calendars/asx.py +6 -2
  3. pandas_market_calendars/calendars/bmf.py +4 -8
  4. pandas_market_calendars/calendars/bse.py +6 -2
  5. pandas_market_calendars/calendars/cboe.py +6 -2
  6. pandas_market_calendars/calendars/cme.py +4 -4
  7. pandas_market_calendars/calendars/cme_globex_base.py +2 -2
  8. pandas_market_calendars/calendars/cme_globex_crypto.py +12 -14
  9. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +4 -4
  10. pandas_market_calendars/calendars/cme_globex_equities.py +2 -2
  11. pandas_market_calendars/calendars/eurex.py +2 -2
  12. pandas_market_calendars/calendars/eurex_fixed_income.py +2 -2
  13. pandas_market_calendars/calendars/hkex.py +7 -5
  14. pandas_market_calendars/calendars/ice.py +2 -2
  15. pandas_market_calendars/calendars/iex.py +7 -3
  16. pandas_market_calendars/calendars/jpx.py +6 -2
  17. pandas_market_calendars/calendars/lse.py +6 -2
  18. pandas_market_calendars/calendars/mirror.py +6 -11
  19. pandas_market_calendars/calendars/nyse.py +46 -46
  20. pandas_market_calendars/calendars/ose.py +7 -5
  21. pandas_market_calendars/calendars/sifma.py +12 -10
  22. pandas_market_calendars/calendars/six.py +6 -2
  23. pandas_market_calendars/calendars/sse.py +6 -2
  24. pandas_market_calendars/calendars/tase.py +6 -2
  25. pandas_market_calendars/calendars/tsx.py +6 -2
  26. pandas_market_calendars/class_registry.py +1 -3
  27. pandas_market_calendars/market_calendar.py +33 -82
  28. {pandas_market_calendars-4.6.0.dist-info → pandas_market_calendars-5.0.0.dist-info}/METADATA +6 -3
  29. pandas_market_calendars-5.0.0.dist-info/RECORD +50 -0
  30. {pandas_market_calendars-4.6.0.dist-info → pandas_market_calendars-5.0.0.dist-info}/WHEEL +1 -1
  31. pandas_market_calendars-4.6.0.dist-info/RECORD +0 -50
  32. {pandas_market_calendars-4.6.0.dist-info → pandas_market_calendars-5.0.0.dist-info/licenses}/LICENSE +0 -0
  33. {pandas_market_calendars-4.6.0.dist-info → pandas_market_calendars-5.0.0.dist-info/licenses}/NOTICE +0 -0
  34. {pandas_market_calendars-4.6.0.dist-info → pandas_market_calendars-5.0.0.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@ from itertools import chain
3
3
 
4
4
  from pandas import Timestamp, DatetimeIndex, Timedelta
5
5
  from pandas.tseries.holiday import AbstractHolidayCalendar
6
- from pytz import timezone
6
+ from zoneinfo import ZoneInfo
7
7
 
8
8
  from typing import Literal, Union
9
9
  from pandas_market_calendars import calendar_utils as u
@@ -54,6 +54,10 @@ class IEXExchangeCalendar(NYSEExchangeCalendar):
54
54
  def name(self):
55
55
  return "IEX"
56
56
 
57
+ @property
58
+ def full_name(self):
59
+ return "Investor's Exchange"
60
+
57
61
  @property
58
62
  def weekmask(self):
59
63
  return "Mon Tue Wed Thu Fri"
@@ -85,7 +89,7 @@ class IEXExchangeCalendar(NYSEExchangeCalendar):
85
89
  def special_closes(self):
86
90
  return [
87
91
  (
88
- time(hour=13, tzinfo=timezone("America/New_York")),
92
+ time(hour=13, tzinfo=ZoneInfo("America/New_York")),
89
93
  AbstractHolidayCalendar(
90
94
  rules=[
91
95
  DayAfterThanksgiving1pmEarlyCloseInOrAfter1993,
@@ -100,7 +104,7 @@ class IEXExchangeCalendar(NYSEExchangeCalendar):
100
104
  def special_closes_adhoc(self):
101
105
  return [
102
106
  (
103
- time(13, tzinfo=timezone("America/New_York")),
107
+ time(13, tzinfo=ZoneInfo("America/New_York")),
104
108
  DaysBeforeIndependenceDay1pmEarlyCloseAdhoc,
105
109
  )
106
110
  ]
@@ -2,7 +2,7 @@ from datetime import time
2
2
  from itertools import chain
3
3
 
4
4
  from pandas.tseries.holiday import AbstractHolidayCalendar
5
- from pytz import timezone
5
+ from zoneinfo import ZoneInfo
6
6
 
7
7
  from pandas_market_calendars.holidays.jp import *
8
8
  from pandas_market_calendars.holidays.us import USNewYearsDay
@@ -41,9 +41,13 @@ class JPXExchangeCalendar(MarketCalendar):
41
41
  def name(self):
42
42
  return "JPX"
43
43
 
44
+ @property
45
+ def full_name(self):
46
+ return "Japan Exchange Group"
47
+
44
48
  @property
45
49
  def tz(self):
46
- return timezone("Asia/Tokyo")
50
+ return ZoneInfo("Asia/Tokyo")
47
51
 
48
52
  @property
49
53
  def adhoc_holidays(self):
@@ -16,7 +16,7 @@
16
16
  from datetime import time
17
17
 
18
18
  from pandas.tseries.holiday import AbstractHolidayCalendar, EasterMonday, GoodFriday
19
- from pytz import timezone
19
+ from zoneinfo import ZoneInfo
20
20
 
21
21
  from pandas_market_calendars.holidays.uk import (
22
22
  BoxingDay,
@@ -69,9 +69,13 @@ class LSEExchangeCalendar(MarketCalendar):
69
69
  def name(self):
70
70
  return "LSE"
71
71
 
72
+ @property
73
+ def full_name(self):
74
+ return "London Stock Exchange"
75
+
72
76
  @property
73
77
  def tz(self):
74
- return timezone("Europe/London")
78
+ return ZoneInfo("Europe/London")
75
79
 
76
80
  @property
77
81
  def regular_holidays(self):
@@ -46,10 +46,7 @@ class TradingCalendar(MarketCalendar):
46
46
  if self._ec.close_offset:
47
47
  cls.regular_market_times._set(
48
48
  "market_close",
49
- tuple(
50
- (t[0], t[1], self._ec.close_offset)
51
- for t in cls.regular_market_times["market_close"]
52
- ),
49
+ tuple((t[0], t[1], self._ec.close_offset) for t in cls.regular_market_times["market_close"]),
53
50
  )
54
51
  cls._FINALIZE_TRADING_CALENDAR = False
55
52
 
@@ -71,6 +68,10 @@ class TradingCalendar(MarketCalendar):
71
68
  def name(self):
72
69
  return self._ec.name
73
70
 
71
+ @property
72
+ def full_name(self):
73
+ return self._ec.name
74
+
74
75
  @property
75
76
  def tz(self):
76
77
  return self._ec.tz
@@ -104,13 +105,7 @@ class TradingCalendar(MarketCalendar):
104
105
  if hasattr(self._ec, "weekmask"):
105
106
  if "1" in self._ec.weekmask or "0" in self._ec.weekmask:
106
107
  # Convert 1s & 0s to Day Abbreviations
107
- return " ".join(
108
- [
109
- DAYMASKS[i]
110
- for i, val in enumerate(self._ec.weekmask)
111
- if val == "1"
112
- ]
113
- )
108
+ return " ".join([DAYMASKS[i] for i, val in enumerate(self._ec.weekmask) if val == "1"])
114
109
  else:
115
110
  return self._ec.weekmask
116
111
  else:
@@ -15,15 +15,15 @@
15
15
 
16
16
  from datetime import time
17
17
  from itertools import chain
18
+ from typing import Literal, Union
19
+ from zoneinfo import ZoneInfo
18
20
 
19
21
  import pandas as pd
20
22
  from pandas.tseries.holiday import AbstractHolidayCalendar
21
23
  from pandas.tseries.offsets import CustomBusinessDay
22
- from pytz import timezone
24
+ from zoneinfo import ZoneInfo
23
25
 
24
- from typing import Literal, Union
25
26
  from pandas_market_calendars import calendar_utils as u
26
-
27
27
  from pandas_market_calendars.holidays.nyse import (
28
28
  # Always Celebrated Holidays
29
29
  USNewYearsDayNYSEpost1952,
@@ -828,9 +828,13 @@ class NYSEExchangeCalendar(MarketCalendar):
828
828
  def name(self):
829
829
  return "NYSE"
830
830
 
831
+ @property
832
+ def full_name(self):
833
+ return "New York Stock Exchange"
834
+
831
835
  @property
832
836
  def tz(self):
833
- return timezone("America/New_York")
837
+ return ZoneInfo("America/New_York")
834
838
 
835
839
  @property
836
840
  def weekmask(self):
@@ -996,7 +1000,7 @@ class NYSEExchangeCalendar(MarketCalendar):
996
1000
  def special_closes(self):
997
1001
  return [
998
1002
  (
999
- time(11, tzinfo=timezone("America/New_York")),
1003
+ time(11, tzinfo=ZoneInfo("America/New_York")),
1000
1004
  AbstractHolidayCalendar(
1001
1005
  rules=[
1002
1006
  KingEdwardDeath11amyClose1910,
@@ -1004,7 +1008,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1004
1008
  ),
1005
1009
  ),
1006
1010
  (
1007
- time(12, tzinfo=timezone("America/New_York")),
1011
+ time(12, tzinfo=ZoneInfo("America/New_York")),
1008
1012
  AbstractHolidayCalendar(
1009
1013
  rules=[
1010
1014
  ParadeOfNationalGuardEarlyClose1917,
@@ -1016,7 +1020,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1016
1020
  ),
1017
1021
  ),
1018
1022
  (
1019
- time(hour=12, minute=30, tzinfo=timezone("America/New_York")),
1023
+ time(hour=12, minute=30, tzinfo=ZoneInfo("America/New_York")),
1020
1024
  AbstractHolidayCalendar(
1021
1025
  rules=[
1022
1026
  RooseveltFuneral1230EarlyClose1919,
@@ -1027,7 +1031,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1027
1031
  ),
1028
1032
  ),
1029
1033
  (
1030
- time(13, tzinfo=timezone("America/New_York")),
1034
+ time(13, tzinfo=ZoneInfo("America/New_York")),
1031
1035
  AbstractHolidayCalendar(
1032
1036
  rules=[
1033
1037
  FridayAfterIndependenceDayNYSEpre2013,
@@ -1040,7 +1044,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1040
1044
  ),
1041
1045
  ),
1042
1046
  (
1043
- time(14, tzinfo=timezone("America/New_York")),
1047
+ time(14, tzinfo=ZoneInfo("America/New_York")),
1044
1048
  AbstractHolidayCalendar(
1045
1049
  rules=[
1046
1050
  DayAfterThanksgiving2pmEarlyCloseBefore1993,
@@ -1052,7 +1056,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1052
1056
  ),
1053
1057
  ),
1054
1058
  (
1055
- time(14, 7, tzinfo=timezone("America/New_York")),
1059
+ time(14, 7, tzinfo=ZoneInfo("America/New_York")),
1056
1060
  AbstractHolidayCalendar(
1057
1061
  rules=[
1058
1062
  KennedyAssassination1407EarlyClose,
@@ -1060,7 +1064,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1060
1064
  ),
1061
1065
  ),
1062
1066
  (
1063
- time(hour=14, minute=30, tzinfo=timezone("America/New_York")),
1067
+ time(hour=14, minute=30, tzinfo=ZoneInfo("America/New_York")),
1064
1068
  AbstractHolidayCalendar(
1065
1069
  rules=[
1066
1070
  FalseArmisticeReport1430EarlyClose1918,
@@ -1071,7 +1075,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1071
1075
  ),
1072
1076
  ),
1073
1077
  (
1074
- time(15, tzinfo=timezone("America/New_York")),
1078
+ time(15, tzinfo=ZoneInfo("America/New_York")),
1075
1079
  AbstractHolidayCalendar(
1076
1080
  rules=[
1077
1081
  HurricaneWatch3pmEarlyClose1976,
@@ -1079,7 +1083,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1079
1083
  ),
1080
1084
  ),
1081
1085
  (
1082
- time(15, 17, tzinfo=timezone("America/New_York")),
1086
+ time(15, 17, tzinfo=ZoneInfo("America/New_York")),
1083
1087
  AbstractHolidayCalendar(
1084
1088
  rules=[
1085
1089
  ReaganAssassAttempt317pmEarlyClose1981,
@@ -1087,7 +1091,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1087
1091
  ),
1088
1092
  ),
1089
1093
  (
1090
- time(15, 28, tzinfo=timezone("America/New_York")),
1094
+ time(15, 28, tzinfo=ZoneInfo("America/New_York")),
1091
1095
  AbstractHolidayCalendar(
1092
1096
  rules=[
1093
1097
  ConEdPowerFail328pmEarlyClose1981,
@@ -1095,7 +1099,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1095
1099
  ),
1096
1100
  ),
1097
1101
  (
1098
- time(15, 30, tzinfo=timezone("America/New_York")),
1102
+ time(15, 30, tzinfo=ZoneInfo("America/New_York")),
1099
1103
  AbstractHolidayCalendar(
1100
1104
  rules=[
1101
1105
  CircuitBreakerTriggered330pmEarlyClose1997,
@@ -1103,7 +1107,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1103
1107
  ),
1104
1108
  ),
1105
1109
  (
1106
- time(15, 56, tzinfo=timezone("America/New_York")),
1110
+ time(15, 56, tzinfo=ZoneInfo("America/New_York")),
1107
1111
  AbstractHolidayCalendar(
1108
1112
  rules=[
1109
1113
  SystemProb356pmEarlyClose2005,
@@ -1123,14 +1127,14 @@ class NYSEExchangeCalendar(MarketCalendar):
1123
1127
 
1124
1128
  return [
1125
1129
  (
1126
- time(13, tzinfo=timezone("America/New_York")),
1130
+ time(13, tzinfo=ZoneInfo("America/New_York")),
1127
1131
  # DaysBeforeIndependenceDay1pmEarlyCloseAdhoc # list
1128
1132
  ChristmasEve1pmEarlyCloseAdhoc
1129
1133
  + DayAfterChristmas1pmEarlyCloseAdhoc
1130
1134
  + BacklogRelief1pmEarlyClose1929,
1131
1135
  ),
1132
1136
  (
1133
- time(14, tzinfo=timezone("America/New_York")),
1137
+ time(14, tzinfo=ZoneInfo("America/New_York")),
1134
1138
  _union_many(
1135
1139
  [
1136
1140
  pd.DatetimeIndex(
@@ -1149,19 +1153,19 @@ class NYSEExchangeCalendar(MarketCalendar):
1149
1153
  ), # index
1150
1154
  ),
1151
1155
  (
1152
- time(14, 30, tzinfo=timezone("America/New_York")),
1156
+ time(14, 30, tzinfo=ZoneInfo("America/New_York")),
1153
1157
  _union_many(
1154
1158
  [PaperworkCrisis230pmEarlyCloses1969, Backlog230pmEarlyCloses1987]
1155
1159
  ), # index
1156
1160
  ),
1157
1161
  (
1158
- time(15, tzinfo=timezone("America/New_York")),
1162
+ time(15, tzinfo=ZoneInfo("America/New_York")),
1159
1163
  _union_many(
1160
1164
  [PaperworkCrisis3pmEarlyCloses1969to1970, Backlog3pmEarlyCloses1987]
1161
1165
  ), # index
1162
1166
  ),
1163
1167
  (
1164
- time(15, 30, tzinfo=timezone("America/New_York")),
1168
+ time(15, 30, tzinfo=ZoneInfo("America/New_York")),
1165
1169
  Backlog330pmEarlyCloses1987, # index
1166
1170
  ),
1167
1171
  ]
@@ -1170,7 +1174,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1170
1174
  def special_opens(self):
1171
1175
  return [
1172
1176
  (
1173
- time(hour=9, minute=31, tzinfo=timezone("America/New_York")),
1177
+ time(hour=9, minute=31, tzinfo=ZoneInfo("America/New_York")),
1174
1178
  AbstractHolidayCalendar(
1175
1179
  rules=[
1176
1180
  ConEdXformer931amLateOpen1990,
@@ -1179,7 +1183,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1179
1183
  ),
1180
1184
  ),
1181
1185
  (
1182
- time(hour=9, minute=32, tzinfo=timezone("America/New_York")),
1186
+ time(hour=9, minute=32, tzinfo=ZoneInfo("America/New_York")),
1183
1187
  AbstractHolidayCalendar(
1184
1188
  rules=[
1185
1189
  IraqiFreedom932amLateOpen2003,
@@ -1189,7 +1193,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1189
1193
  ),
1190
1194
  ),
1191
1195
  (
1192
- time(hour=9, minute=33, tzinfo=timezone("America/New_York")),
1196
+ time(hour=9, minute=33, tzinfo=ZoneInfo("America/New_York")),
1193
1197
  AbstractHolidayCalendar(
1194
1198
  rules=[
1195
1199
  Sept11MomentSilence933amLateOpen2001,
@@ -1197,7 +1201,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1197
1201
  ),
1198
1202
  ),
1199
1203
  (
1200
- time(hour=10, minute=15, tzinfo=timezone("America/New_York")),
1204
+ time(hour=10, minute=15, tzinfo=ZoneInfo("America/New_York")),
1201
1205
  AbstractHolidayCalendar(
1202
1206
  rules=[
1203
1207
  Snow1015LateOpen1967,
@@ -1208,7 +1212,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1208
1212
  ),
1209
1213
  ),
1210
1214
  (
1211
- time(hour=10, minute=30, tzinfo=timezone("America/New_York")),
1215
+ time(hour=10, minute=30, tzinfo=ZoneInfo("America/New_York")),
1212
1216
  AbstractHolidayCalendar(
1213
1217
  rules=[
1214
1218
  TrafficBlockLateOpen1919,
@@ -1218,7 +1222,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1218
1222
  ),
1219
1223
  ),
1220
1224
  (
1221
- time(hour=10, minute=45, tzinfo=timezone("America/New_York")),
1225
+ time(hour=10, minute=45, tzinfo=ZoneInfo("America/New_York")),
1222
1226
  AbstractHolidayCalendar(
1223
1227
  rules=[
1224
1228
  EclipseOfSunLateOpen1925,
@@ -1227,7 +1231,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1227
1231
  ),
1228
1232
  ),
1229
1233
  (
1230
- time(11, tzinfo=timezone("America/New_York")),
1234
+ time(11, tzinfo=ZoneInfo("America/New_York")),
1231
1235
  AbstractHolidayCalendar(
1232
1236
  rules=[
1233
1237
  Snow11amLateOpen1934,
@@ -1242,7 +1246,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1242
1246
  ),
1243
1247
  ),
1244
1248
  (
1245
- time(11, 5, tzinfo=timezone("America/New_York")),
1249
+ time(11, 5, tzinfo=ZoneInfo("America/New_York")),
1246
1250
  AbstractHolidayCalendar(
1247
1251
  rules=[
1248
1252
  PowerFail1105LateOpen,
@@ -1250,7 +1254,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1250
1254
  ),
1251
1255
  ),
1252
1256
  (
1253
- time(11, 15, tzinfo=timezone("America/New_York")),
1257
+ time(11, 15, tzinfo=ZoneInfo("America/New_York")),
1254
1258
  AbstractHolidayCalendar(
1255
1259
  rules=[
1256
1260
  Storm1115LateOpen1976,
@@ -1258,7 +1262,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1258
1262
  ),
1259
1263
  ),
1260
1264
  (
1261
- time(12, tzinfo=timezone("America/New_York")),
1265
+ time(12, tzinfo=ZoneInfo("America/New_York")),
1262
1266
  AbstractHolidayCalendar(
1263
1267
  rules=[
1264
1268
  KingEdwardFuneral12pmOpen1910,
@@ -1270,7 +1274,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1270
1274
  ),
1271
1275
  ),
1272
1276
  (
1273
- time(13, tzinfo=timezone("America/New_York")),
1277
+ time(13, tzinfo=ZoneInfo("America/New_York")),
1274
1278
  AbstractHolidayCalendar(
1275
1279
  rules=[
1276
1280
  AnnunciatorBoardFire1pmLateOpen1921,
@@ -1283,15 +1287,15 @@ class NYSEExchangeCalendar(MarketCalendar):
1283
1287
  def special_opens_adhoc(self):
1284
1288
  return [
1285
1289
  (
1286
- time(9, 31, tzinfo=timezone("America/New_York")),
1290
+ time(9, 31, tzinfo=ZoneInfo("America/New_York")),
1287
1291
  TroopsInGulf931LateOpens1991,
1288
1292
  ),
1289
1293
  (
1290
- time(11, tzinfo=timezone("America/New_York")),
1294
+ time(11, tzinfo=ZoneInfo("America/New_York")),
1291
1295
  HeavyVolume11amLateOpen1933,
1292
1296
  ),
1293
1297
  (
1294
- time(12, tzinfo=timezone("America/New_York")),
1298
+ time(12, tzinfo=ZoneInfo("America/New_York")),
1295
1299
  BacklogRelief12pmLateOpen1929 + HeavyVolume12pmLateOpen1933,
1296
1300
  ),
1297
1301
  ]
@@ -1306,8 +1310,10 @@ class NYSEExchangeCalendar(MarketCalendar):
1306
1310
  :param tz: time zone in either string or pytz.timezone
1307
1311
  :return: DatetimeIndex of valid business days
1308
1312
  """
1309
- start_date = pd.Timestamp(start_date, tz=tz)
1310
- end_date = pd.Timestamp(end_date, tz=tz)
1313
+ start_date = pd.Timestamp(start_date)
1314
+ end_date = pd.Timestamp(end_date)
1315
+ start_date = start_date.tz_convert(tz) if start_date.tz else start_date.tz_localize(tz)
1316
+ end_date = end_date.tz_convert(tz) if end_date.tz else end_date.tz_localize(tz)
1311
1317
 
1312
1318
  # Starting Monday Sept. 29, 1952, no more saturday trading days
1313
1319
  if tz is None:
@@ -1337,9 +1343,7 @@ class NYSEExchangeCalendar(MarketCalendar):
1337
1343
  normalize=True,
1338
1344
  tz=tz,
1339
1345
  )
1340
- days_post = pd.date_range(
1341
- saturday_end, end_date, freq=self.holidays(), normalize=True, tz=tz
1342
- )
1346
+ days_post = pd.date_range(saturday_end, end_date, freq=self.holidays(), normalize=True, tz=tz)
1343
1347
  return days_pre.union(days_post)
1344
1348
 
1345
1349
  def days_at_time(self, days, market_time, day_offset=0):
@@ -1442,14 +1446,10 @@ class NYSEExchangeCalendar(MarketCalendar):
1442
1446
  **(args | altered_args),
1443
1447
  )
1444
1448
 
1445
- return pd.DatetimeIndex(
1446
- pre[:-1].union(post)[-periods:], dtype="datetime64[ns]"
1447
- )
1449
+ return pd.DatetimeIndex(pre[:-1].union(post)[-periods:], dtype="datetime64[ns]")
1448
1450
  else:
1449
1451
  _, _ = u._standardize_htf_freq(frequency)
1450
- raise ValueError(
1451
- "This should never be raised, the above call should error first"
1452
- )
1452
+ raise ValueError("This should never be raised, the above call should error first")
1453
1453
 
1454
1454
  def early_closes(self, schedule):
1455
1455
  """
@@ -7,7 +7,7 @@ from pandas.tseries.holiday import (
7
7
  Holiday,
8
8
  )
9
9
  from pandas.tseries.offsets import Day, Easter
10
- from pytz import timezone
10
+ from zoneinfo import ZoneInfo
11
11
 
12
12
  from pandas_market_calendars.market_calendar import MarketCalendar
13
13
 
@@ -17,9 +17,7 @@ OSEWednesdayBeforeEaster = Holiday(
17
17
  "Wednesday before Easter", month=1, day=1, offset=[Easter(), Day(-4)]
18
18
  )
19
19
 
20
- OSEMaundyThursday = Holiday(
21
- "Maundy Thursday", month=1, day=1, offset=[Easter(), Day(-3)]
22
- )
20
+ OSEMaundyThursday = Holiday("Maundy Thursday", month=1, day=1, offset=[Easter(), Day(-3)])
23
21
 
24
22
  OSEGoodFriday = GoodFriday
25
23
 
@@ -83,9 +81,13 @@ class OSEExchangeCalendar(MarketCalendar):
83
81
  def name(self):
84
82
  return "OSE"
85
83
 
84
+ @property
85
+ def full_name(self):
86
+ return "Oslo Stock Exchange"
87
+
86
88
  @property
87
89
  def tz(self):
88
- return timezone("Europe/Oslo")
90
+ return ZoneInfo("Europe/Oslo")
89
91
 
90
92
  @property
91
93
  def regular_holidays(self):
@@ -1,7 +1,7 @@
1
1
  from datetime import time
2
2
 
3
3
  from pandas.tseries.holiday import AbstractHolidayCalendar
4
- from pytz import timezone
4
+ from zoneinfo import ZoneInfo
5
5
  from itertools import chain
6
6
 
7
7
  ########################################################################################################################
@@ -110,9 +110,13 @@ class SIFMAUSExchangeCalendar(MarketCalendar):
110
110
  def name(self):
111
111
  return "SIFMA_US"
112
112
 
113
+ @property
114
+ def full_name(self):
115
+ return "Securities Industry and Financial Markets Association"
116
+
113
117
  @property
114
118
  def tz(self):
115
- return timezone("America/New_York")
119
+ return ZoneInfo("America/New_York")
116
120
 
117
121
  @property
118
122
  def regular_holidays(self):
@@ -166,9 +170,9 @@ class SIFMAUSExchangeCalendar(MarketCalendar):
166
170
  def special_closes_adhoc(self):
167
171
  return [
168
172
  (
169
- time(14, tzinfo=timezone("America/New_York")),
170
- GoodFriday2pmEarlyCloseAdHoc # list
171
- + DayBeforeGoodFriday2pmEarlyCloseAdHoc,
173
+ time(14, tzinfo=ZoneInfo("America/New_York")),
174
+ GoodFriday2pmEarlyCloseAdHoc
175
+ + DayBeforeGoodFriday2pmEarlyCloseAdHoc, # list
172
176
  ),
173
177
  ]
174
178
 
@@ -205,7 +209,7 @@ class SIFMAUKExchangeCalendar(MarketCalendar):
205
209
 
206
210
  @property
207
211
  def tz(self):
208
- return timezone("Europe/London")
212
+ return ZoneInfo("Europe/London")
209
213
 
210
214
  @property
211
215
  def regular_holidays(self):
@@ -295,7 +299,7 @@ class SIFMAJPExchangeCalendar(MarketCalendar):
295
299
 
296
300
  @property
297
301
  def tz(self):
298
- return timezone("Asia/Tokyo")
302
+ return ZoneInfo("Asia/Tokyo")
299
303
 
300
304
  @property
301
305
  def regular_holidays(self):
@@ -349,6 +353,4 @@ class SIFMAJPExchangeCalendar(MarketCalendar):
349
353
 
350
354
  @property
351
355
  def special_closes(self):
352
- return [
353
- (time(15), AbstractHolidayCalendar(rules=[UKMayDay, UKWeekendChristmas]))
354
- ]
356
+ return [(time(15), AbstractHolidayCalendar(rules=[UKMayDay, UKWeekendChristmas]))]
@@ -9,7 +9,7 @@ from pandas.tseries.holiday import (
9
9
  Holiday,
10
10
  previous_friday,
11
11
  )
12
- from pytz import timezone
12
+ from zoneinfo import ZoneInfo
13
13
 
14
14
  from pandas_market_calendars.market_calendar import (
15
15
  FRIDAY,
@@ -108,9 +108,13 @@ class SIXExchangeCalendar(MarketCalendar):
108
108
  def name(self):
109
109
  return "SIX"
110
110
 
111
+ @property
112
+ def full_name(self):
113
+ return "SIX Swiss Exchange"
114
+
111
115
  @property
112
116
  def tz(self):
113
- return timezone("Europe/Zurich")
117
+ return ZoneInfo("Europe/Zurich")
114
118
 
115
119
  @property
116
120
  def regular_holidays(self):
@@ -2,7 +2,7 @@ from datetime import time, timedelta
2
2
  from functools import partial
3
3
 
4
4
  from pandas.tseries.holiday import AbstractHolidayCalendar, Holiday, next_monday
5
- from pytz import timezone
5
+ from zoneinfo import ZoneInfo
6
6
 
7
7
  from pandas_market_calendars.holidays.cn import *
8
8
  from pandas_market_calendars.market_calendar import MarketCalendar
@@ -29,9 +29,13 @@ class SSEExchangeCalendar(MarketCalendar):
29
29
  def name(self):
30
30
  return "SSE"
31
31
 
32
+ @property
33
+ def full_name(self):
34
+ return "Shanghai Stock Exchange"
35
+
32
36
  @property
33
37
  def tz(self):
34
- return timezone("Asia/Shanghai")
38
+ return ZoneInfo("Asia/Shanghai")
35
39
 
36
40
  @property
37
41
  def regular_holidays(self):
@@ -2,7 +2,7 @@ from datetime import time
2
2
 
3
3
  from typing import Literal, Union
4
4
  from pandas import Timestamp, Timedelta, DatetimeIndex
5
- from pytz import timezone
5
+ from zoneinfo import ZoneInfo
6
6
 
7
7
  from pandas_market_calendars.market_calendar import MarketCalendar
8
8
  from pandas_market_calendars.calendar_utils import Day_Anchor, Month_Anchor
@@ -186,9 +186,13 @@ class TASEExchangeCalendar(MarketCalendar):
186
186
  def name(self):
187
187
  return "TASE"
188
188
 
189
+ @property
190
+ def full_name(self):
191
+ return "Tel Aviv Stock Exchange"
192
+
189
193
  @property
190
194
  def tz(self):
191
- return timezone("Asia/Jerusalem")
195
+ return ZoneInfo("Asia/Jerusalem")
192
196
 
193
197
  @property
194
198
  def adhoc_holidays(self):
@@ -10,7 +10,7 @@ from pandas.tseries.holiday import (
10
10
  MO,
11
11
  weekend_to_monday,
12
12
  )
13
- from pytz import timezone
13
+ from zoneinfo import ZoneInfo
14
14
 
15
15
  from pandas_market_calendars.holidays.uk import (
16
16
  BoxingDay,
@@ -138,9 +138,13 @@ class TSXExchangeCalendar(MarketCalendar):
138
138
  def name(self):
139
139
  return "TSX"
140
140
 
141
+ @property
142
+ def full_name(self):
143
+ return "Toronto Stock Exchange"
144
+
141
145
  @property
142
146
  def tz(self):
143
- return timezone("Canada/Eastern")
147
+ return ZoneInfo("Canada/Eastern")
144
148
 
145
149
  regular_early_close = time(13)
146
150
 
@@ -105,9 +105,7 @@ class ProtectedDict(dict):
105
105
 
106
106
  def __str__(self):
107
107
  try:
108
- formatted = pformat(
109
- dict(self), sort_dicts=False
110
- ) # sort_dicts apparently not available < python3.8
108
+ formatted = pformat(dict(self), sort_dicts=False) # sort_dicts apparently not available < python3.8
111
109
  except TypeError:
112
110
  formatted = pformat(dict(self))
113
111