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.
Files changed (46) hide show
  1. pandas_market_calendars/__init__.py +38 -38
  2. pandas_market_calendars/calendar_registry.py +57 -57
  3. pandas_market_calendars/calendar_utils.py +262 -262
  4. pandas_market_calendars/calendars/asx.py +66 -66
  5. pandas_market_calendars/calendars/bmf.py +223 -223
  6. pandas_market_calendars/calendars/bse.py +421 -421
  7. pandas_market_calendars/calendars/cboe.py +145 -145
  8. pandas_market_calendars/calendars/cme.py +405 -405
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
  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 -131
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
  18. pandas_market_calendars/calendars/hkex.py +429 -429
  19. pandas_market_calendars/calendars/ice.py +81 -81
  20. pandas_market_calendars/calendars/iex.py +112 -112
  21. pandas_market_calendars/calendars/lse.py +114 -114
  22. pandas_market_calendars/calendars/mirror.py +149 -149
  23. pandas_market_calendars/calendars/nyse.py +3 -0
  24. pandas_market_calendars/calendars/ose.py +116 -116
  25. pandas_market_calendars/calendars/sifma.py +354 -354
  26. pandas_market_calendars/calendars/six.py +132 -132
  27. pandas_market_calendars/calendars/sse.py +1 -1
  28. pandas_market_calendars/calendars/tase.py +197 -197
  29. pandas_market_calendars/calendars/tsx.py +181 -181
  30. pandas_market_calendars/holidays/cme.py +385 -385
  31. pandas_market_calendars/holidays/cme_globex.py +214 -214
  32. pandas_market_calendars/holidays/cn.py +20 -0
  33. pandas_market_calendars/holidays/jp.py +401 -401
  34. pandas_market_calendars/holidays/jpx_equinox.py +506 -506
  35. pandas_market_calendars/holidays/nyse.py +5 -0
  36. pandas_market_calendars/holidays/oz.py +63 -63
  37. pandas_market_calendars/holidays/sifma.py +350 -350
  38. pandas_market_calendars/holidays/us.py +376 -376
  39. pandas_market_calendars/market_calendar.py +20 -1
  40. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/METADATA +1 -1
  41. pandas_market_calendars-4.5.1.dist-info/RECORD +50 -0
  42. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/WHEEL +1 -1
  43. pandas_market_calendars-4.4.2.dist-info/RECORD +0 -50
  44. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/LICENSE +0 -0
  45. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/NOTICE +0 -0
  46. {pandas_market_calendars-4.4.2.dist-info → pandas_market_calendars-4.5.1.dist-info}/top_level.txt +0 -0
@@ -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.2
3
+ Version: 4.5.1
4
4
  Summary: Market and exchange trading calendars for pandas
5
5
  Author-email: Ryan Sheftel <rsheftel@alumni.upenn.edu>
6
6
  License: MIT
@@ -0,0 +1,50 @@
1
+ pandas_market_calendars/__init__.py,sha256=prBpkD2f2mShZjZePVa0L3_Cf-Tv48r6q-J_mFNFFuY,1323
2
+ pandas_market_calendars/calendar_registry.py,sha256=9ecKkERkztiwVaOXVsWfUcEvaT5_SwwpD5VaUAJhR1Y,2495
3
+ pandas_market_calendars/calendar_utils.py,sha256=6yBqT_FBBicSVurudGgCGpKakomnXfYORxnWLYVH2l8,11629
4
+ pandas_market_calendars/class_registry.py,sha256=lpRSp1E_1vcY73a--daCIOsJpoxpJVuhlurRGDVUqlc,3868
5
+ pandas_market_calendars/market_calendar.py,sha256=Dh_ojZG9XLUoW6J3DcJ_e0dKzxJnnf4IMQxbekWnJK0,35734
6
+ pandas_market_calendars/calendars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ pandas_market_calendars/calendars/asx.py,sha256=tocL_VXzbPNx89mmtXmSw7FKHy2Hzlj5HxcYjfJSn6w,1789
8
+ pandas_market_calendars/calendars/bmf.py,sha256=eyCFpG-ziuI862V5E41PFQw5cD3cOvmgnlAqcYuk9r4,5939
9
+ pandas_market_calendars/calendars/bse.py,sha256=mclRAAK5AvF9vyuIos1PexO0Z3d45ZolrPALVdcSoj0,16947
10
+ pandas_market_calendars/calendars/cboe.py,sha256=tRfq1hiOU2LpEAk-8OC5difM2qLjxNDDpkgobTQtcVI,3765
11
+ pandas_market_calendars/calendars/cme.py,sha256=YJH58ztmnKiyZZ7z2CK4pcvBLOQtflZcUFn1m3o5aLA,10450
12
+ pandas_market_calendars/calendars/cme_globex_agriculture.py,sha256=j1Dyg1Q_i3fh4452OeFa5Jw55FW0dhdjmPkmjP85KPc,4666
13
+ pandas_market_calendars/calendars/cme_globex_base.py,sha256=0mvilo9TY5O5EVHNQVNcI8TGycKM5-ymsIcZ4a-ANhU,3062
14
+ pandas_market_calendars/calendars/cme_globex_crypto.py,sha256=HbjTTN8pt2dGfgnE3LS0LIzJlaenYAzilvN9AMwkbfc,5463
15
+ pandas_market_calendars/calendars/cme_globex_energy_and_metals.py,sha256=lcd09CIfZMaZ-mXrI-6c7bqgPx8tj6-2yCOG-f2Hlu4,6620
16
+ pandas_market_calendars/calendars/cme_globex_equities.py,sha256=FMgBDPdamDAgcslQuf-BDUACCQDoYzV4lIbixNLOO-w,3639
17
+ pandas_market_calendars/calendars/cme_globex_fixed_income.py,sha256=egxw-OKUI-SPbNjsLquqPDWQIVX94-torkAuzW6a0aA,4287
18
+ pandas_market_calendars/calendars/cme_globex_fx.py,sha256=lZJpZvKWC9kGcHVjUSG69vH82VwiifLYt1rAlZsDVaM,3206
19
+ pandas_market_calendars/calendars/eurex.py,sha256=h9K0kvLggc50MKjGb61gfepuiyKovD2uPHCLBruvcBU,2677
20
+ pandas_market_calendars/calendars/eurex_fixed_income.py,sha256=irtSJvCRsn_N2AjjYe5jMvuxblgOx1BTQW2C34RGFlg,2132
21
+ pandas_market_calendars/calendars/hkex.py,sha256=dQj4roWPLxcxcMaYC9WBaFaHcqsXPdozTufF4ByZN-A,13996
22
+ pandas_market_calendars/calendars/ice.py,sha256=CnlbD3g7L6goukKZtSm-deuCdlB4ZcILTkYbol43TPQ,2159
23
+ pandas_market_calendars/calendars/iex.py,sha256=e85oEuqbyxLUkm7ZtvRw2A1RLNZj3F-v17MOFuLbCZY,3027
24
+ pandas_market_calendars/calendars/jpx.py,sha256=ZovoMt-d-J4MXdvM8Hijer7Jr3TYB9lSB9rWvx9HMjc,3932
25
+ pandas_market_calendars/calendars/lse.py,sha256=qltdB1TdQ3F8jqx4oykzy_cZvqHlHwnsrpRXzBsovVc,3114
26
+ pandas_market_calendars/calendars/mirror.py,sha256=Oq9jRXYpKmPv6PfoKDVVLyIG7hqcuFFC7fPLcCIhl7k,4555
27
+ pandas_market_calendars/calendars/nyse.py,sha256=E1up3Gg-tnl_ugFNjll50NwSU3-iP8q9fyMCyUcS9OM,61695
28
+ pandas_market_calendars/calendars/ose.py,sha256=AfF11QxKYwozaaEc2PvuP3IPvVj5D70mIl0zyp5OogE,2938
29
+ pandas_market_calendars/calendars/sifma.py,sha256=RgOX1yhT8-b6w029ILkOhU-delPCeX6uNWoWDm1Z0eE,9960
30
+ pandas_market_calendars/calendars/six.py,sha256=RYShBBuHg6O5QrMnTmdboInh0Wy5bBNRC9dR-QH9PO8,2610
31
+ pandas_market_calendars/calendars/sse.py,sha256=4l9fqzvStQgWQ8MmHrH01l1IywkdJ_6p2liWtvlbqrE,11218
32
+ pandas_market_calendars/calendars/tase.py,sha256=JQdnuU7qfG_XVBBNfki3Kf3zNZ8Svo3VKOEE037EdVI,7836
33
+ pandas_market_calendars/calendars/tsx.py,sha256=3zQwdU9LkiJjZRF1fgLGHYYcJMC-443QITVS9hn4kOc,4014
34
+ pandas_market_calendars/holidays/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ pandas_market_calendars/holidays/cme.py,sha256=TrxR8xA6cgy0YcUfImaKI2QjRmqlwv6pW5KjMKsE1Rg,9089
36
+ pandas_market_calendars/holidays/cme_globex.py,sha256=0SPVGABO7K66eRitDsDgxRU52aPX8SRGgtUVyB_-LYk,5090
37
+ pandas_market_calendars/holidays/cn.py,sha256=n-BjfoGQkouQnB21nVQZvkP-6OO1rCAlLKJFUNKb_UA,48943
38
+ pandas_market_calendars/holidays/jp.py,sha256=rqobVw837Uxb-4D1Zq_PyBLoeyhImYW7DBwyJupJIp8,9216
39
+ pandas_market_calendars/holidays/jpx_equinox.py,sha256=KWbJqWsnkdyzG3fD2gJTXRLQOF3YTWSn9O6sYRL9Dnk,8070
40
+ pandas_market_calendars/holidays/nyse.py,sha256=6F9e2zSPS2RVrJK5fhC4GnCXW6t8fpfPemFsgsVqxLM,41367
41
+ pandas_market_calendars/holidays/oz.py,sha256=P77pWe7ZQj4o-731w6fW_Vzmo41PRxh94QpclI3ZyFM,1042
42
+ pandas_market_calendars/holidays/sifma.py,sha256=gELES9-NeV3QNGE4JpsVfmcs1-jtYQrLxjnG4B-4RmM,8754
43
+ pandas_market_calendars/holidays/uk.py,sha256=dt5TNONlDMXPw8wjyyPBYNnLO5Yz6Mht8VrPUrNqy-M,4719
44
+ pandas_market_calendars/holidays/us.py,sha256=OBBMMKTRzghD-b9CmPRe5zBh7zQYjWl4-9SogT6ZnBo,11515
45
+ pandas_market_calendars-4.5.1.dist-info/LICENSE,sha256=qW51_A-I7YutlB-s8VSKeOP-aL83T-Lb8LqqU1x1ilw,1065
46
+ pandas_market_calendars-4.5.1.dist-info/METADATA,sha256=HUDIRaxLfbHQ2f5Gz92LiBcyl3II_dN2wAsffOnnFSU,9058
47
+ pandas_market_calendars-4.5.1.dist-info/NOTICE,sha256=mmH7c9aF5FsELh1OHXloXw1TajLD_mWDKO4dsVf43_E,11693
48
+ pandas_market_calendars-4.5.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
49
+ pandas_market_calendars-4.5.1.dist-info/top_level.txt,sha256=_4cUEFr07SuEAzZMT-5p0lJGXxO9imVbEK9_5oqcopQ,24
50
+ pandas_market_calendars-4.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,50 +0,0 @@
1
- pandas_market_calendars/__init__.py,sha256=Mv4FiG78VDgnFxB9HF66tEP0T9a567NaDPZvaDdjYKQ,1361
2
- pandas_market_calendars/calendar_registry.py,sha256=g2IUYlYfZ5w1iv-SrWJ5PQ-9O67qpdWTNR5PQgKCfP0,2552
3
- pandas_market_calendars/calendar_utils.py,sha256=iQnuNWm7ZwyGxKBN0oc01chRPxfhMYeLx6YrJswhlXE,11891
4
- pandas_market_calendars/class_registry.py,sha256=lpRSp1E_1vcY73a--daCIOsJpoxpJVuhlurRGDVUqlc,3868
5
- pandas_market_calendars/market_calendar.py,sha256=cX0pmRPD3HTiIGTtKt9fHJv6sg7YesPlo-5Svxmx9as,34827
6
- pandas_market_calendars/calendars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- pandas_market_calendars/calendars/asx.py,sha256=zMva21MfmbIHEk4p66CrY17GPhtPDOHoRlrvOHsyaYQ,1855
8
- pandas_market_calendars/calendars/bmf.py,sha256=Q9wzu4P4k1SrH5uuezh1xVIWSE1doesrN-UGHcYlShE,6162
9
- pandas_market_calendars/calendars/bse.py,sha256=yW6fqbFMb8tuuOssRIlZZ5D-Sc6h6IQ_bUpmQaT_Tbk,17368
10
- pandas_market_calendars/calendars/cboe.py,sha256=NYHXwMm5B6ynNyWEOqXnOEhzWWqbBPRWFW5v7c4Ul8Q,3910
11
- pandas_market_calendars/calendars/cme.py,sha256=NRUAxamEn2zFWZ9-RqsNj-83sJH5G_ud-hCrh1ENSPs,10855
12
- pandas_market_calendars/calendars/cme_globex_agriculture.py,sha256=Zgm8FejxpgtlgLiBgq8BOATLrOmxrIN3957f9gvnSUc,4838
13
- pandas_market_calendars/calendars/cme_globex_base.py,sha256=M8nIv0ZqJ_8ePrNaCZx3patXp8DW6sS-wLCEStl9Mxs,3181
14
- pandas_market_calendars/calendars/cme_globex_crypto.py,sha256=oORJKcqbM30upCDz-9PLgc1dnOj2y4CwTbulqsTu7OI,5623
15
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py,sha256=XsN0u6aubf5CMVUB41H64DcnZgiCgAfOxMS9xAhjDm4,6836
16
- pandas_market_calendars/calendars/cme_globex_equities.py,sha256=vti4rHb6uVtzHkrHFqLkCKuVnJUDGgq7zgEdBH-n28A,3762
17
- pandas_market_calendars/calendars/cme_globex_fixed_income.py,sha256=xWKkqZPlAEB_75boIKnGIBGjYshLGzBdJRKg715WY6c,4423
18
- pandas_market_calendars/calendars/cme_globex_fx.py,sha256=hYqU6s-BorE4x4drCGJ9RBTysg54WKpFPpw8nPVYYOI,3307
19
- pandas_market_calendars/calendars/eurex.py,sha256=uryP2kesB2ud63hlGLN8Wf2SCLBPOw7xt88X8RChlGc,2808
20
- pandas_market_calendars/calendars/eurex_fixed_income.py,sha256=cGeO6DtVB_RvEW725igBDBzsJTpDamP4jRNYlk_QkPA,2230
21
- pandas_market_calendars/calendars/hkex.py,sha256=JsquZEAeK8Z3KilcHPiGdqzNIXHGw6hZP01g3HmsxBw,14425
22
- pandas_market_calendars/calendars/ice.py,sha256=YWxxfgtZJFt8B4A5TLlpwd3E1RqTMzJ9xxgLn7bYEk8,2240
23
- pandas_market_calendars/calendars/iex.py,sha256=IqA5-9H6qZxWikXdyjGOy7SIgr5rp_lhOcFucGA6aXE,3139
24
- pandas_market_calendars/calendars/jpx.py,sha256=ZovoMt-d-J4MXdvM8Hijer7Jr3TYB9lSB9rWvx9HMjc,3932
25
- pandas_market_calendars/calendars/lse.py,sha256=PmDS-f3DaIKvU5D4n9z603dHvajuqa-bPNuQ4baPmbU,3228
26
- pandas_market_calendars/calendars/mirror.py,sha256=ChVbn-RbbggXvQ27cIlYlNJ7Hf3c6DKTQjodPNOjMu8,4704
27
- pandas_market_calendars/calendars/nyse.py,sha256=V9X-NRAQsK0UIU3Asv9kmcFak7rsdQhcP_xx6sqLF6A,61617
28
- pandas_market_calendars/calendars/ose.py,sha256=8bTjdV-FFRrCTFrpyAh7MVyB5BhXl63Q9NteVVMhelc,3054
29
- pandas_market_calendars/calendars/sifma.py,sha256=dA4TFxOrUZFw5ihhxvPzCi3_MpiYfwzAB18ZZLUyEXs,10314
30
- pandas_market_calendars/calendars/six.py,sha256=G5IbzC3mq4lQet7m0PQsDa2HQGa_91br_RkEU6U7y88,2742
31
- pandas_market_calendars/calendars/sse.py,sha256=i2xhnAIeuV37MKcHOhlmw2dl04VwPJFcjbStc0YZZVg,11218
32
- pandas_market_calendars/calendars/tase.py,sha256=Zv8hNJdrPp5GAaHNzPEklxDvMx4D2bxCItkpplCtCp8,8033
33
- pandas_market_calendars/calendars/tsx.py,sha256=VYT_Qm8flncguf_AtYhMgqmF8fhfclnUhyxCRROGTcQ,4195
34
- pandas_market_calendars/holidays/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- pandas_market_calendars/holidays/cme.py,sha256=NWI37dnwc8ThGr1NDnTOw6eAKMicnt4nq50DgjYE7gk,9474
36
- pandas_market_calendars/holidays/cme_globex.py,sha256=lN5AV9b1J4vDUhoMsr1YXTFNE8siseZJGKvX5qL9si0,5304
37
- pandas_market_calendars/holidays/cn.py,sha256=pRQKHafvOgbewUpbpN7WyT2Ws9ai81svN2rVKPeX6So,48225
38
- pandas_market_calendars/holidays/jp.py,sha256=CMu7FWKurQEynLQWHRyZi3celLVJZhjAjOyzfvthGho,9617
39
- pandas_market_calendars/holidays/jpx_equinox.py,sha256=FuEYckZM5RSmBn7fxr9H_ghn65dMDrxb9PBkZY5SxB4,8576
40
- pandas_market_calendars/holidays/nyse.py,sha256=Fi9FlsJOrM6x3aiH6EHJ7s5K6u5IAnvVjYA9zBl2dDc,41288
41
- pandas_market_calendars/holidays/oz.py,sha256=dHPD2t4ffcC8083g05dT5HJbFTzLqC2ZCAvq8UPeKMo,1105
42
- pandas_market_calendars/holidays/sifma.py,sha256=eTg1cd8T78eydSySfgn3uj8iZ7VShs-kjEH5A1Pahxo,9104
43
- pandas_market_calendars/holidays/uk.py,sha256=dt5TNONlDMXPw8wjyyPBYNnLO5Yz6Mht8VrPUrNqy-M,4719
44
- pandas_market_calendars/holidays/us.py,sha256=Lk4LjyP4QKG3MIFQnvd4NykPDId1FhqBxfO9khivCNU,11891
45
- pandas_market_calendars-4.4.2.dist-info/LICENSE,sha256=qW51_A-I7YutlB-s8VSKeOP-aL83T-Lb8LqqU1x1ilw,1065
46
- pandas_market_calendars-4.4.2.dist-info/METADATA,sha256=lg_esxnNhciJ44hj0NkxVGs00uCimL1ktARsi7hM7Rs,9058
47
- pandas_market_calendars-4.4.2.dist-info/NOTICE,sha256=mmH7c9aF5FsELh1OHXloXw1TajLD_mWDKO4dsVf43_E,11693
48
- pandas_market_calendars-4.4.2.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
49
- pandas_market_calendars-4.4.2.dist-info/top_level.txt,sha256=_4cUEFr07SuEAzZMT-5p0lJGXxO9imVbEK9_5oqcopQ,24
50
- pandas_market_calendars-4.4.2.dist-info/RECORD,,