ezKit 1.8.4__py3-none-any.whl → 1.8.6__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.
- ezKit/cls.py +38 -0
- {ezKit-1.8.4.dist-info → ezKit-1.8.6.dist-info}/METADATA +1 -1
- {ezKit-1.8.4.dist-info → ezKit-1.8.6.dist-info}/RECORD +6 -6
- {ezKit-1.8.4.dist-info → ezKit-1.8.6.dist-info}/LICENSE +0 -0
- {ezKit-1.8.4.dist-info → ezKit-1.8.6.dist-info}/WHEEL +0 -0
- {ezKit-1.8.4.dist-info → ezKit-1.8.6.dist-info}/top_level.txt +0 -0
ezKit/cls.py
CHANGED
@@ -200,6 +200,11 @@ def latest_data(
|
|
200
200
|
# 转换数据类型
|
201
201
|
response_dict: dict = response.json()
|
202
202
|
|
203
|
+
# 判断数据是否正确
|
204
|
+
if True not in [utils.v_true(response_dict["data"], dict), utils.v_true(response_dict["data"], list)]:
|
205
|
+
logger.error(f"{info} [失败]")
|
206
|
+
return None
|
207
|
+
|
203
208
|
# ------------------------------------------------------------------------------------------
|
204
209
|
|
205
210
|
# 个股
|
@@ -254,3 +259,36 @@ def latest_data(
|
|
254
259
|
logger.error(f"{info} [失败]")
|
255
260
|
logger.exception(e)
|
256
261
|
return None
|
262
|
+
|
263
|
+
|
264
|
+
# --------------------------------------------------------------------------------------------------
|
265
|
+
|
266
|
+
|
267
|
+
def plate_codes(plate: str) -> list | None:
|
268
|
+
"""获取板块成分股代码"""
|
269
|
+
|
270
|
+
if utils.v_true(plate, str) is False:
|
271
|
+
logger.error("Incorrect function argument type: plate")
|
272
|
+
return None
|
273
|
+
|
274
|
+
info: str = "获取板块成分股代码"
|
275
|
+
|
276
|
+
try:
|
277
|
+
|
278
|
+
logger.info(f"{info} ......")
|
279
|
+
|
280
|
+
items = latest_data(payload=plate, data_type="plate")
|
281
|
+
|
282
|
+
if isinstance(items, list):
|
283
|
+
codes: list = [stock.coderename(i["secu_code"], restore=True) for i in items]
|
284
|
+
codes.sort()
|
285
|
+
logger.success(f"{info} [成功]")
|
286
|
+
return codes
|
287
|
+
|
288
|
+
logger.error(f"{info} [失败]")
|
289
|
+
return None
|
290
|
+
|
291
|
+
except Exception as e:
|
292
|
+
logger.error(f"{info} [失败]")
|
293
|
+
logger.exception(e)
|
294
|
+
return None
|
@@ -2,7 +2,7 @@ ezKit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
ezKit/bottle.py,sha256=usKK1wVaZw4_D-4VwMYmOIc8jtz4TrpM30nck59HMFw,180178
|
3
3
|
ezKit/bottle_extensions.py,sha256=LQikCbbYZBAa4AcihvrTvixWHHMY7OjCBsT02PqWMMM,1129
|
4
4
|
ezKit/cipher.py,sha256=0T_StbjiNI4zgrjVgcfU-ffKgu1waBA9UDudAnqFcNM,2896
|
5
|
-
ezKit/cls.py,sha256=
|
5
|
+
ezKit/cls.py,sha256=B-of0yM7QAAk-6J7sPcg0iOec5CzDornFCvYvTbUvK8,10352
|
6
6
|
ezKit/database.py,sha256=kYb0ybACxrdFZnwJ40bTbG8Obh2oEF3GQWmCbPVgH-c,6878
|
7
7
|
ezKit/http.py,sha256=N2x86HCmJ5ejwA3-gHowEgSpaFTFT9nCWFjPuQ1T_do,1801
|
8
8
|
ezKit/mongo.py,sha256=P6WTwFRxaaHixJK_PyKlOfPHkeJRxxrNLV77xy5LVBQ,2048
|
@@ -13,8 +13,8 @@ ezKit/stock.py,sha256=p-l6Tv0oZdJ3juxkddScphm7BW4vH-mBozBgSH1Qu0w,1730
|
|
13
13
|
ezKit/token.py,sha256=9CAZhPdXiRiWoOIeWmP0q6L3j1zQAv4YcVWH95Tjefs,1755
|
14
14
|
ezKit/utils.py,sha256=an7joZy_EEpYfN8zBtEWAnhP0YXYfPieabsK_HAxXl4,48921
|
15
15
|
ezKit/xftp.py,sha256=XyIdr_2rxRVLqPofG6fIYWhAMVsFwTyp46dg5P9FLW4,7774
|
16
|
-
ezKit-1.8.
|
17
|
-
ezKit-1.8.
|
18
|
-
ezKit-1.8.
|
19
|
-
ezKit-1.8.
|
20
|
-
ezKit-1.8.
|
16
|
+
ezKit-1.8.6.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
17
|
+
ezKit-1.8.6.dist-info/METADATA,sha256=KUvniqMInshbTRAtYAXUhXHgADiYNI6jn5NBT8L2KrY,190
|
18
|
+
ezKit-1.8.6.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
19
|
+
ezKit-1.8.6.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
|
20
|
+
ezKit-1.8.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|