pandas-market-calendars 4.4.1__py3-none-any.whl → 4.5.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.
@@ -21,13 +21,17 @@ class JPXExchangeCalendar(MarketCalendar):
21
21
 
22
22
  Open Time: 9:31 AM, Asia/Tokyo
23
23
  LUNCH BREAK :facepalm: : 11:30 AM - 12:30 PM Asia/Tokyo
24
- Close Time: 4:00 PM, Asia/Tokyo
24
+ Close Time: 3:30 PM, Asia/Tokyo
25
+
26
+ Market close of Japan changed from 3:00 PM to 3:30 PM on November 5, 2024
27
+ Reference:
28
+ https://www.jpx.co.jp/english/equities/trading/domestic/tvdivq0000006blj-att/tradinghours_eg.pdf
25
29
  """
26
30
 
27
31
  aliases = ["JPX", "XJPX"]
28
32
  regular_market_times = {
29
33
  "market_open": ((None, time(9)),),
30
- "market_close": ((None, time(15)),),
34
+ "market_close": ((None, time(15)), ("2024-11-05", time(15, 30))),
31
35
  "break_start": ((None, time(11, 30)),),
32
36
  "break_end": ((None, time(12, 30)),),
33
37
  }
@@ -297,6 +297,8 @@ from pandas_market_calendars.holidays.nyse import (
297
297
  HurricaneSandyClosings2012,
298
298
  # 2018
299
299
  GeorgeHWBushDeath2018,
300
+ # 2025
301
+ JimmyCarterDeath2025,
300
302
  )
301
303
  from pandas_market_calendars.market_calendar import MarketCalendar
302
304
 
@@ -961,6 +963,7 @@ class NYSEExchangeCalendar(MarketCalendar):
961
963
  September11Closings2001,
962
964
  HurricaneSandyClosings2012,
963
965
  GeorgeHWBushDeath2018,
966
+ JimmyCarterDeath2025,
964
967
  )
965
968
  )
966
969
 
@@ -1529,3 +1529,8 @@ HurricaneSandyClosings2012 = [
1529
1529
  GeorgeHWBushDeath2018 = [
1530
1530
  Timestamp("2018-12-05", tz="UTC"),
1531
1531
  ]
1532
+
1533
+ # 2025
1534
+ JimmyCarterDeath2025 = [
1535
+ Timestamp("2025-01-09", tz="UTC"),
1536
+ ]
@@ -625,7 +625,15 @@ class MarketCalendar(metaclass=MarketCalendarMeta):
625
625
 
626
626
  def _tryholidays(self, cal, s, e):
627
627
  try:
628
- return cal.holidays(s, e)
628
+ # If the Calendar is all single Observance Holidays then it is far
629
+ # more efficient to extract and return those dates
630
+ observed_dates = _all_single_observance_rules(cal)
631
+ if observed_dates is not None:
632
+ return pd.DatetimeIndex(
633
+ [date for date in observed_dates if s <= date <= e]
634
+ )
635
+ else:
636
+ return cal.holidays(s, e)
629
637
  except ValueError:
630
638
  return pd.DatetimeIndex([])
631
639
 
@@ -920,3 +928,14 @@ class MarketCalendar(metaclass=MarketCalendarMeta):
920
928
 
921
929
  def __delitem__(self, key):
922
930
  return self.remove_time(key)
931
+
932
+
933
+ def _is_single_observance(holiday):
934
+ "Returns the Date of the Holiday if it is only observed once, None otherwise."
935
+ return holiday.start_date if holiday.start_date == holiday.end_date else None
936
+
937
+
938
+ def _all_single_observance_rules(calendar):
939
+ "Returns a list of timestamps if the Calendar's Rules are all single observance holidays, None Otherwise"
940
+ observances = [_is_single_observance(rule) for rule in calendar.rules]
941
+ return observances if all(observances) else None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pandas_market_calendars
3
- Version: 4.4.1
3
+ Version: 4.5.0
4
4
  Summary: Market and exchange trading calendars for pandas
5
5
  Author-email: Ryan Sheftel <rsheftel@alumni.upenn.edu>
6
6
  License: MIT
@@ -18,18 +18,19 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
21
22
  Requires-Python: >=3.8
22
23
  Description-Content-Type: text/x-rst
23
24
  License-File: LICENSE
24
25
  License-File: NOTICE
25
- Requires-Dist: pandas >=1.1
26
+ Requires-Dist: pandas>=1.1
26
27
  Requires-Dist: pytz
27
28
  Requires-Dist: python-dateutil
28
- Requires-Dist: exchange-calendars >=3.3
29
+ Requires-Dist: exchange-calendars>=3.3
29
30
  Provides-Extra: dev
30
- Requires-Dist: pytest ; extra == 'dev'
31
- Requires-Dist: black ; extra == 'dev'
32
- Requires-Dist: pre-commit ; extra == 'dev'
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Requires-Dist: black; extra == "dev"
33
+ Requires-Dist: pre-commit; extra == "dev"
33
34
 
34
35
  pandas_market_calendars
35
36
  =======================
@@ -2,7 +2,7 @@ pandas_market_calendars/__init__.py,sha256=prBpkD2f2mShZjZePVa0L3_Cf-Tv48r6q-J_m
2
2
  pandas_market_calendars/calendar_registry.py,sha256=9ecKkERkztiwVaOXVsWfUcEvaT5_SwwpD5VaUAJhR1Y,2495
3
3
  pandas_market_calendars/calendar_utils.py,sha256=6yBqT_FBBicSVurudGgCGpKakomnXfYORxnWLYVH2l8,11629
4
4
  pandas_market_calendars/class_registry.py,sha256=lpRSp1E_1vcY73a--daCIOsJpoxpJVuhlurRGDVUqlc,3868
5
- pandas_market_calendars/market_calendar.py,sha256=0Df4H8YZm5DBwAOzvVl4LysQ9FzqGnAqf6rfL05RNuc,33905
5
+ pandas_market_calendars/market_calendar.py,sha256=KxYKRcylzPP7d_iZVpO5q_TOFnmV61VVG8Prz0GE29U,34793
6
6
  pandas_market_calendars/calendars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  pandas_market_calendars/calendars/asx.py,sha256=tocL_VXzbPNx89mmtXmSw7FKHy2Hzlj5HxcYjfJSn6w,1789
8
8
  pandas_market_calendars/calendars/bmf.py,sha256=eyCFpG-ziuI862V5E41PFQw5cD3cOvmgnlAqcYuk9r4,5939
@@ -21,10 +21,10 @@ pandas_market_calendars/calendars/eurex_fixed_income.py,sha256=irtSJvCRsn_N2AjjY
21
21
  pandas_market_calendars/calendars/hkex.py,sha256=dQj4roWPLxcxcMaYC9WBaFaHcqsXPdozTufF4ByZN-A,13996
22
22
  pandas_market_calendars/calendars/ice.py,sha256=CnlbD3g7L6goukKZtSm-deuCdlB4ZcILTkYbol43TPQ,2159
23
23
  pandas_market_calendars/calendars/iex.py,sha256=e85oEuqbyxLUkm7ZtvRw2A1RLNZj3F-v17MOFuLbCZY,3027
24
- pandas_market_calendars/calendars/jpx.py,sha256=cXi_qLcNG6OIaQy5oLl8XPzPMR58O4Tf9Kb1yPIxM5g,3595
24
+ pandas_market_calendars/calendars/jpx.py,sha256=uiAtxgXGZAzxM3lxGvVOoIwKvd4gsZTYupTIKoLzn0k,3819
25
25
  pandas_market_calendars/calendars/lse.py,sha256=qltdB1TdQ3F8jqx4oykzy_cZvqHlHwnsrpRXzBsovVc,3114
26
26
  pandas_market_calendars/calendars/mirror.py,sha256=Oq9jRXYpKmPv6PfoKDVVLyIG7hqcuFFC7fPLcCIhl7k,4555
27
- pandas_market_calendars/calendars/nyse.py,sha256=QtIltvSiANIAtkr3b1KQqRsZ5aT847WvxHwC0rbhgNc,60293
27
+ pandas_market_calendars/calendars/nyse.py,sha256=xwknNZz5Thyvb2G5UzL0n7imrjvcKm5UYjuYkWcMo6M,60368
28
28
  pandas_market_calendars/calendars/ose.py,sha256=AfF11QxKYwozaaEc2PvuP3IPvVj5D70mIl0zyp5OogE,2938
29
29
  pandas_market_calendars/calendars/sifma.py,sha256=RgOX1yhT8-b6w029ILkOhU-delPCeX6uNWoWDm1Z0eE,9960
30
30
  pandas_market_calendars/calendars/six.py,sha256=RYShBBuHg6O5QrMnTmdboInh0Wy5bBNRC9dR-QH9PO8,2610
@@ -37,14 +37,14 @@ pandas_market_calendars/holidays/cme_globex.py,sha256=0SPVGABO7K66eRitDsDgxRU52a
37
37
  pandas_market_calendars/holidays/cn.py,sha256=POVI0y12lSGo437K1zpeU4AdGO9FvJBfFAKUvYCsfm0,46769
38
38
  pandas_market_calendars/holidays/jp.py,sha256=rqobVw837Uxb-4D1Zq_PyBLoeyhImYW7DBwyJupJIp8,9216
39
39
  pandas_market_calendars/holidays/jpx_equinox.py,sha256=KWbJqWsnkdyzG3fD2gJTXRLQOF3YTWSn9O6sYRL9Dnk,8070
40
- pandas_market_calendars/holidays/nyse.py,sha256=8A-Lc-mZXdWqMRXaC899unyQfjv2ixjJiC16jXZ5wGo,39757
40
+ pandas_market_calendars/holidays/nyse.py,sha256=jwcz3Xp7NNL0rnwrQG8vuuBuXg7YTSBcg733nmFw-uM,39831
41
41
  pandas_market_calendars/holidays/oz.py,sha256=P77pWe7ZQj4o-731w6fW_Vzmo41PRxh94QpclI3ZyFM,1042
42
42
  pandas_market_calendars/holidays/sifma.py,sha256=gELES9-NeV3QNGE4JpsVfmcs1-jtYQrLxjnG4B-4RmM,8754
43
43
  pandas_market_calendars/holidays/uk.py,sha256=dt5TNONlDMXPw8wjyyPBYNnLO5Yz6Mht8VrPUrNqy-M,4719
44
44
  pandas_market_calendars/holidays/us.py,sha256=OBBMMKTRzghD-b9CmPRe5zBh7zQYjWl4-9SogT6ZnBo,11515
45
- pandas_market_calendars-4.4.1.dist-info/LICENSE,sha256=qW51_A-I7YutlB-s8VSKeOP-aL83T-Lb8LqqU1x1ilw,1065
46
- pandas_market_calendars-4.4.1.dist-info/METADATA,sha256=AEdB9Of7N2uW4vT4a9izyABgrYnYmDpAsQ30HPpaCak,9011
47
- pandas_market_calendars-4.4.1.dist-info/NOTICE,sha256=mmH7c9aF5FsELh1OHXloXw1TajLD_mWDKO4dsVf43_E,11693
48
- pandas_market_calendars-4.4.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
49
- pandas_market_calendars-4.4.1.dist-info/top_level.txt,sha256=_4cUEFr07SuEAzZMT-5p0lJGXxO9imVbEK9_5oqcopQ,24
50
- pandas_market_calendars-4.4.1.dist-info/RECORD,,
45
+ pandas_market_calendars-4.5.0.dist-info/LICENSE,sha256=qW51_A-I7YutlB-s8VSKeOP-aL83T-Lb8LqqU1x1ilw,1065
46
+ pandas_market_calendars-4.5.0.dist-info/METADATA,sha256=MHL7uJAL1WICOcfnsFw9GkodErysQ2dsZRHS9hkVvhI,9058
47
+ pandas_market_calendars-4.5.0.dist-info/NOTICE,sha256=mmH7c9aF5FsELh1OHXloXw1TajLD_mWDKO4dsVf43_E,11693
48
+ pandas_market_calendars-4.5.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
49
+ pandas_market_calendars-4.5.0.dist-info/top_level.txt,sha256=_4cUEFr07SuEAzZMT-5p0lJGXxO9imVbEK9_5oqcopQ,24
50
+ pandas_market_calendars-4.5.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5