akshare 1.14.95__py3-none-any.whl → 1.14.96__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.
Potentially problematic release.
This version of akshare might be problematic. Click here for more details.
- akshare/__init__.py +3 -1
- akshare/stock/stock_xq.py +7 -12
- akshare/stock_feature/stock_board_industry_ths.py +55 -0
- akshare/stock_feature/stock_ztb_em.py +4 -4
- {akshare-1.14.95.dist-info → akshare-1.14.96.dist-info}/METADATA +1 -1
- {akshare-1.14.95.dist-info → akshare-1.14.96.dist-info}/RECORD +9 -9
- {akshare-1.14.95.dist-info → akshare-1.14.96.dist-info}/LICENSE +0 -0
- {akshare-1.14.95.dist-info → akshare-1.14.96.dist-info}/WHEEL +0 -0
- {akshare-1.14.95.dist-info → akshare-1.14.96.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
|
@@ -2906,9 +2906,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
|
2906
2906
|
1.14.93 fix: fix stock_zt_pool_em interface
|
|
2907
2907
|
1.14.94 fix: fix stock_zt_pool_strong_em interface
|
|
2908
2908
|
1.14.95 fix: fix stock_zt_pool_sub_new_em interface
|
|
2909
|
+
1.14.96 fix: fix stock_zt_pool_sub_new_em interface
|
|
2909
2910
|
"""
|
|
2910
2911
|
|
|
2911
|
-
__version__ = "1.14.
|
|
2912
|
+
__version__ = "1.14.96"
|
|
2912
2913
|
__author__ = "AKFamily"
|
|
2913
2914
|
|
|
2914
2915
|
import sys
|
|
@@ -4152,6 +4153,7 @@ from akshare.stock_feature.stock_board_industry_ths import (
|
|
|
4152
4153
|
stock_board_industry_info_ths,
|
|
4153
4154
|
stock_board_industry_index_ths,
|
|
4154
4155
|
stock_ipo_benefit_ths,
|
|
4156
|
+
stock_xgsr_ths,
|
|
4155
4157
|
)
|
|
4156
4158
|
|
|
4157
4159
|
"""
|
akshare/stock/stock_xq.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# !/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date: 2024/
|
|
4
|
+
Date: 2024/10/14 21:20
|
|
5
5
|
Desc: 雪球-行情中心-个股
|
|
6
6
|
https://xueqiu.com/S/SH513520
|
|
7
7
|
"""
|
|
@@ -13,22 +13,18 @@ import pandas as pd
|
|
|
13
13
|
import requests
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def _convert_timestamp(timestamp_ms):
|
|
16
|
+
def _convert_timestamp(timestamp_ms: int) -> str:
|
|
17
17
|
"""
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
返回:
|
|
24
|
-
datetime: 对应的日期和时间,保留到秒
|
|
18
|
+
时间戳转换为字符串时间
|
|
19
|
+
:param timestamp_ms: 时间戳
|
|
20
|
+
:type timestamp_ms: int
|
|
21
|
+
:return: 字符串
|
|
22
|
+
:rtype: str
|
|
25
23
|
"""
|
|
26
24
|
# 将毫秒转换为秒
|
|
27
25
|
timestamp_s = timestamp_ms / 1000
|
|
28
|
-
|
|
29
26
|
# 使用 fromtimestamp 方法将时间戳转换为 datetime 对象
|
|
30
27
|
datetime_obj = datetime.fromtimestamp(timestamp_s)
|
|
31
|
-
|
|
32
28
|
return datetime_obj.strftime("%Y-%m-%d %H:%M:%S")
|
|
33
29
|
|
|
34
30
|
|
|
@@ -122,7 +118,6 @@ def stock_individual_spot_xq(
|
|
|
122
118
|
temp_df.loc[temp_df["item"] == "时间", "value"] = temp_df.loc[
|
|
123
119
|
temp_df["item"] == "时间", "value"
|
|
124
120
|
].apply(lambda x: _convert_timestamp(int(x)))
|
|
125
|
-
|
|
126
121
|
return temp_df
|
|
127
122
|
|
|
128
123
|
|
|
@@ -219,6 +219,58 @@ def stock_board_industry_index_ths(
|
|
|
219
219
|
return big_df
|
|
220
220
|
|
|
221
221
|
|
|
222
|
+
def stock_xgsr_ths() -> pd.DataFrame:
|
|
223
|
+
"""
|
|
224
|
+
同花顺-数据中心-新股数据-新股上市首日
|
|
225
|
+
https://data.10jqka.com.cn/ipo/xgsr/
|
|
226
|
+
:return: 新股上市首日
|
|
227
|
+
:rtype: pandas.DataFrame
|
|
228
|
+
"""
|
|
229
|
+
js_code = py_mini_racer.MiniRacer()
|
|
230
|
+
js_content = _get_file_content_ths("ths.js")
|
|
231
|
+
js_code.eval(js_content)
|
|
232
|
+
v_code = js_code.call("v")
|
|
233
|
+
headers = {
|
|
234
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
235
|
+
"Chrome/89.0.4389.90 Safari/537.36",
|
|
236
|
+
"Cookie": f"v={v_code}",
|
|
237
|
+
"hexin-v": v_code,
|
|
238
|
+
}
|
|
239
|
+
url = "https://data.10jqka.com.cn/ipo/xgsr/field/SSRQ/order/desc/page/1/ajax/1/free/1/"
|
|
240
|
+
r = requests.get(url, headers=headers)
|
|
241
|
+
soup = BeautifulSoup(r.text, features="lxml")
|
|
242
|
+
page_num = soup.find(name="span", attrs={"class": "page_info"}).text.split("/")[1]
|
|
243
|
+
big_df = pd.DataFrame()
|
|
244
|
+
tqdm = get_tqdm()
|
|
245
|
+
for page in tqdm(range(1, int(page_num) + 1), leave=False):
|
|
246
|
+
url = f"https://data.10jqka.com.cn/ipo/xgsr/field/SSRQ/order/desc/page/{page}/ajax/1/free/1/"
|
|
247
|
+
v_code = js_code.call("v")
|
|
248
|
+
headers = {
|
|
249
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
250
|
+
"Chrome/89.0.4389.90 Safari/537.36",
|
|
251
|
+
"Cookie": f"v={v_code}",
|
|
252
|
+
"hexin-v": v_code,
|
|
253
|
+
}
|
|
254
|
+
r = requests.get(url, headers=headers)
|
|
255
|
+
temp_df = pd.read_html(StringIO(r.text))[0]
|
|
256
|
+
big_df = pd.concat(objs=[big_df, temp_df], ignore_index=True)
|
|
257
|
+
|
|
258
|
+
big_df.rename(columns={"发行价(元)": "发行价"}, inplace=True)
|
|
259
|
+
big_df["序号"] = pd.to_numeric(big_df["序号"], errors="coerce")
|
|
260
|
+
big_df["股票代码"] = big_df["股票代码"].astype(str).str.zfill(6)
|
|
261
|
+
big_df["发行价"] = pd.to_numeric(big_df["发行价"], errors="coerce")
|
|
262
|
+
big_df["最新价"] = pd.to_numeric(big_df["最新价"], errors="coerce")
|
|
263
|
+
big_df["首日开盘价"] = pd.to_numeric(big_df["首日开盘价"], errors="coerce")
|
|
264
|
+
big_df["首日收盘价"] = pd.to_numeric(big_df["首日收盘价"], errors="coerce")
|
|
265
|
+
big_df["首日最高价"] = pd.to_numeric(big_df["首日最高价"], errors="coerce")
|
|
266
|
+
big_df["首日最低价"] = pd.to_numeric(big_df["首日最低价"], errors="coerce")
|
|
267
|
+
big_df["首日涨跌幅"] = (
|
|
268
|
+
pd.to_numeric(big_df["首日涨跌幅"].str.strip("%"), errors="coerce") / 100
|
|
269
|
+
)
|
|
270
|
+
big_df["上市日期"] = pd.to_datetime(big_df["上市日期"], errors="coerce").dt.date
|
|
271
|
+
return big_df
|
|
272
|
+
|
|
273
|
+
|
|
222
274
|
def stock_ipo_benefit_ths() -> pd.DataFrame:
|
|
223
275
|
"""
|
|
224
276
|
同花顺-数据中心-新股数据-IPO受益股
|
|
@@ -350,5 +402,8 @@ if __name__ == "__main__":
|
|
|
350
402
|
stock_board_industry_index_ths_df = stock_board_industry_index_ths(symbol=stock)
|
|
351
403
|
print(stock_board_industry_index_ths_df)
|
|
352
404
|
|
|
405
|
+
stock_xgsr_ths_df = stock_xgsr_ths()
|
|
406
|
+
print(stock_xgsr_ths_df)
|
|
407
|
+
|
|
353
408
|
stock_ipo_benefit_ths_df = stock_ipo_benefit_ths()
|
|
354
409
|
print(stock_ipo_benefit_ths_df)
|
|
@@ -345,7 +345,7 @@ def stock_zt_pool_sub_new_em(date: str = "20241011") -> pd.DataFrame:
|
|
|
345
345
|
return temp_df
|
|
346
346
|
|
|
347
347
|
|
|
348
|
-
def stock_zt_pool_zbgc_em(date: str = "
|
|
348
|
+
def stock_zt_pool_zbgc_em(date: str = "20241011") -> pd.DataFrame:
|
|
349
349
|
"""
|
|
350
350
|
东方财富网-行情中心-涨停板行情-炸板股池
|
|
351
351
|
https://quote.eastmoney.com/ztb/detail#type=zbgc
|
|
@@ -428,7 +428,7 @@ def stock_zt_pool_zbgc_em(date: str = "20231129") -> pd.DataFrame:
|
|
|
428
428
|
return temp_df
|
|
429
429
|
|
|
430
430
|
|
|
431
|
-
def stock_zt_pool_dtgc_em(date: str = "
|
|
431
|
+
def stock_zt_pool_dtgc_em(date: str = "20241011") -> pd.DataFrame:
|
|
432
432
|
"""
|
|
433
433
|
东方财富网-行情中心-涨停板行情-跌停股池
|
|
434
434
|
https://quote.eastmoney.com/ztb/detail#type=dtgc
|
|
@@ -528,8 +528,8 @@ if __name__ == "__main__":
|
|
|
528
528
|
stock_zt_pool_sub_new_em_df = stock_zt_pool_sub_new_em(date="20241011")
|
|
529
529
|
print(stock_zt_pool_sub_new_em_df)
|
|
530
530
|
|
|
531
|
-
stock_zt_pool_zbgc_em_df = stock_zt_pool_zbgc_em(date="
|
|
531
|
+
stock_zt_pool_zbgc_em_df = stock_zt_pool_zbgc_em(date="20241011")
|
|
532
532
|
print(stock_zt_pool_zbgc_em_df)
|
|
533
533
|
|
|
534
|
-
stock_zt_pool_dtgc_em_df = stock_zt_pool_dtgc_em(date="
|
|
534
|
+
stock_zt_pool_dtgc_em_df = stock_zt_pool_dtgc_em(date="20241011")
|
|
535
535
|
print(stock_zt_pool_dtgc_em_df)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
akshare/__init__.py,sha256=
|
|
1
|
+
akshare/__init__.py,sha256=KnCf23BWYZ5SUYeJT1wRUQmiUmVjqBKKQqxupNoJFGs,182744
|
|
2
2
|
akshare/datasets.py,sha256=-qdwaQjgBlftX84uM74KJqCYJYkQ50PV416_neA4uls,995
|
|
3
3
|
akshare/air/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
|
|
4
4
|
akshare/air/air_hebei.py,sha256=xIXNGLK7IGYqrkteM9fxnHAwWqk6PCQs6D9-ggZ7byY,4442
|
|
@@ -278,7 +278,7 @@ akshare/stock/stock_us_js.py,sha256=wwZpRvVHqjxwd0cb2O5vtRW8Zw90Kdl5O4XNwoevN64,
|
|
|
278
278
|
akshare/stock/stock_us_pink.py,sha256=jgkEjPm_qa4zSN1MH0unHJopSkcF-8Rqlp5Kus2KaQ8,3062
|
|
279
279
|
akshare/stock/stock_us_sina.py,sha256=3bD41Y5GqDTv52bx5jbjrt0psaHZS10UL_e7E2B6wW8,8146
|
|
280
280
|
akshare/stock/stock_weibo_nlp.py,sha256=eM7ofsNSrKiYeS0g38Qj9CxT6dkJZrn_pmziIiTqp4U,3286
|
|
281
|
-
akshare/stock/stock_xq.py,sha256=
|
|
281
|
+
akshare/stock/stock_xq.py,sha256=pdqikdhjWR_eqAVJ8bMWDdsa8BE8E1MBNagvMKSvymg,4619
|
|
282
282
|
akshare/stock/stock_zh_a_sina.py,sha256=gryRmUwqF9PyNl-fPhD72y5nfNmLVEnvzjZDhAe-cpg,18862
|
|
283
283
|
akshare/stock/stock_zh_a_special.py,sha256=RRXkeZtRWm_maIPWgxvhBdX6eNybECjhSuEesZHRFJI,10294
|
|
284
284
|
akshare/stock/stock_zh_a_tick_tx.py,sha256=TJUAWLKAeoLEaVVJQlj0t-1smZGoAO0X0rPsUPVhZZ4,2131
|
|
@@ -295,7 +295,7 @@ akshare/stock_feature/stock_a_pe_and_pb.py,sha256=8R67gE1vUYtu9bLbZNXD88kHMcKSnB
|
|
|
295
295
|
akshare/stock_feature/stock_account_em.py,sha256=PA-531xnv5uerFrYGc40mk8q8O0DGciHC_XVlE9udis,3342
|
|
296
296
|
akshare/stock_feature/stock_all_pb.py,sha256=2yQLq03qXNbTB5AtJ-Q8uJldOluElH5zTjYneY3aaZ0,1194
|
|
297
297
|
akshare/stock_feature/stock_analyst_em.py,sha256=Md3_G-Px0O1lk4dx5dCEKl8Vjgwt79Sh-FSh_sW1Elo,9508
|
|
298
|
-
akshare/stock_feature/stock_board_industry_ths.py,sha256=
|
|
298
|
+
akshare/stock_feature/stock_board_industry_ths.py,sha256=KvaWYEdxidYo4qL4LRJOZRsTNe0e3GeiBq1YLi8mf0I,15084
|
|
299
299
|
akshare/stock_feature/stock_buffett_index_lg.py,sha256=NpNccHmGjtqLz6aUladB6InPzO2pjoImbgCgmNEYUuM,2027
|
|
300
300
|
akshare/stock_feature/stock_classify_sina.py,sha256=Lg7ROG5W9HioFRplJI2rZ6tAAHM09N3g9qF6kReIQYI,3210
|
|
301
301
|
akshare/stock_feature/stock_comment_em.py,sha256=uSOS5YmyXB9jSDsZf1fNC0RPGTE6_4RzjwxaewhJQtc,13697
|
|
@@ -352,7 +352,7 @@ akshare/stock_feature/stock_zdhtmx_em.py,sha256=2BpJQntGgUlEIOmDlepOiOkw-e-tKLRa
|
|
|
352
352
|
akshare/stock_feature/stock_zf_pg.py,sha256=nYJ1uLOBdzM_PDyq4MNeWoCTripFMAPoAiaPfhDqkcg,6343
|
|
353
353
|
akshare/stock_feature/stock_zh_valuation_baidu.py,sha256=oxYIHP68pFvAYyqjCvZp3a9tpczTFiWhSxZ0w4eyo7I,1904
|
|
354
354
|
akshare/stock_feature/stock_zh_vote_baidu.py,sha256=SsSNnCq7PDFMzWFcPFcC_MSc9rua412P14vHc923gmo,1761
|
|
355
|
-
akshare/stock_feature/stock_ztb_em.py,sha256=
|
|
355
|
+
akshare/stock_feature/stock_ztb_em.py,sha256=DducYpjOOZmguhVlMbFX33EHVzoAMMjNvbef_oXuZPo,17019
|
|
356
356
|
akshare/stock_feature/ths.js,sha256=AWPkHf3L2Il1UUL0F5qDqNn1dfU0OlZBNUbMf8AmI3Y,39664
|
|
357
357
|
akshare/stock_fundamental/__init__.py,sha256=jiXoO9OXiMxB0wHaPQkuxNckYuoFKtzuhZL1ytnE2nQ,82
|
|
358
358
|
akshare/stock_fundamental/stock_finance.py,sha256=WuYvLo8xZxH-VS-6P-S31yzsKA1ojrwegcLXP2byle4,30676
|
|
@@ -382,8 +382,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
|
|
|
382
382
|
akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
|
|
383
383
|
tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
|
|
384
384
|
tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
|
|
385
|
-
akshare-1.14.
|
|
386
|
-
akshare-1.14.
|
|
387
|
-
akshare-1.14.
|
|
388
|
-
akshare-1.14.
|
|
389
|
-
akshare-1.14.
|
|
385
|
+
akshare-1.14.96.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
|
|
386
|
+
akshare-1.14.96.dist-info/METADATA,sha256=ppYCML2cAOHC3S1KfDJknL9VEJ1HxxAwDrAQ9KNvTS8,14163
|
|
387
|
+
akshare-1.14.96.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
388
|
+
akshare-1.14.96.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
|
389
|
+
akshare-1.14.96.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|