akshare 1.16.77__py3-none-any.whl → 1.16.78__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.
- akshare/__init__.py +10 -7
- akshare/futures/futures_zh_sina.py +1 -1
- akshare/stock_a/stock_zh_a_spot.py +0 -24
- {akshare-1.16.77.dist-info → akshare-1.16.78.dist-info}/METADATA +1 -8
- {akshare-1.16.77.dist-info → akshare-1.16.78.dist-info}/RECORD +8 -8
- {akshare-1.16.77.dist-info → akshare-1.16.78.dist-info}/WHEEL +0 -0
- {akshare-1.16.77.dist-info → akshare-1.16.78.dist-info}/licenses/LICENSE +0 -0
- {akshare-1.16.77.dist-info → akshare-1.16.78.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
@@ -3086,9 +3086,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
3086
3086
|
1.16.75 fix: fix get_qhkc_index interface
|
3087
3087
|
1.16.76 fix: fix spot_quotations_sge interface
|
3088
3088
|
1.16.77 add: add stock_lhb_yyb_detail_em interface
|
3089
|
+
1.16.78 fix: fix stock_zh_a_spot_em interface
|
3089
3090
|
"""
|
3090
3091
|
|
3091
|
-
__version__ = "1.16.
|
3092
|
+
__version__ = "1.16.78"
|
3092
3093
|
__author__ = "AKFamily"
|
3093
3094
|
|
3094
3095
|
import sys
|
@@ -3123,9 +3124,11 @@ from akshare.stock_fundamental.stock_gbjg_em import stock_zh_a_gbjg_em
|
|
3123
3124
|
"""
|
3124
3125
|
异步接口
|
3125
3126
|
"""
|
3126
|
-
from akshare.stock_a.stock_zh_a_spot import stock_zh_a_spot_em
|
3127
|
-
from akshare.stock_a.stock_individual_fund_flow_rank import
|
3128
|
-
|
3127
|
+
from akshare.stock_a.stock_zh_a_spot import stock_zh_a_spot_em as stock_zh_a_spot_em_async
|
3128
|
+
from akshare.stock_a.stock_individual_fund_flow_rank import (
|
3129
|
+
stock_individual_fund_flow_rank as stock_individual_fund_flow_rank_async
|
3130
|
+
)
|
3131
|
+
from akshare.stock_a.stock_board_concept_name_em import stock_board_concept_name_em as stock_board_concept_name_em_async
|
3129
3132
|
|
3130
3133
|
"""
|
3131
3134
|
雪球-个股-公司概况-公司简介
|
@@ -4170,7 +4173,7 @@ from akshare.stock.stock_board_concept_em import (
|
|
4170
4173
|
stock_board_concept_cons_em,
|
4171
4174
|
stock_board_concept_hist_em,
|
4172
4175
|
stock_board_concept_hist_min_em,
|
4173
|
-
|
4176
|
+
stock_board_concept_name_em,
|
4174
4177
|
stock_board_concept_spot_em,
|
4175
4178
|
)
|
4176
4179
|
|
@@ -4214,7 +4217,7 @@ from akshare.stock_feature.stock_pankou_em import (
|
|
4214
4217
|
A 股东方财富
|
4215
4218
|
"""
|
4216
4219
|
from akshare.stock_feature.stock_hist_em import (
|
4217
|
-
|
4220
|
+
stock_zh_a_spot_em,
|
4218
4221
|
stock_bj_a_spot_em,
|
4219
4222
|
stock_new_a_spot_em,
|
4220
4223
|
stock_kc_a_spot_em,
|
@@ -4813,7 +4816,7 @@ from akshare.stock.stock_fund_em import (
|
|
4813
4816
|
stock_individual_fund_flow,
|
4814
4817
|
stock_market_fund_flow,
|
4815
4818
|
stock_sector_fund_flow_rank,
|
4816
|
-
|
4819
|
+
stock_individual_fund_flow_rank,
|
4817
4820
|
stock_sector_fund_flow_summary,
|
4818
4821
|
stock_sector_fund_flow_hist,
|
4819
4822
|
stock_concept_fund_flow_hist,
|
@@ -88,7 +88,7 @@ def futures_symbol_mark() -> pd.DataFrame:
|
|
88
88
|
return temp_df
|
89
89
|
|
90
90
|
|
91
|
-
def futures_zh_realtime(symbol: str = "
|
91
|
+
def futures_zh_realtime(symbol: str = "PTA") -> pd.DataFrame:
|
92
92
|
"""
|
93
93
|
期货品种当前时刻所有可交易的合约实时数据
|
94
94
|
https://vip.stock.finance.sina.com.cn/quotes_service/view/qihuohangqing.html#titlePos_1
|
@@ -65,30 +65,19 @@ def process_data(page_results: List[Dict]) -> pd.DataFrame:
|
|
65
65
|
for result in page_results:
|
66
66
|
if result.get("rc") == 0 and result.get("data") and result["data"].get("diff"):
|
67
67
|
page_data = result["data"]["diff"]
|
68
|
-
|
69
|
-
# 添加页面信息以便后续计算序号
|
70
68
|
for item in page_data:
|
71
69
|
item["page_number"] = page_number
|
72
70
|
item["page_index"] = page_data.index(item)
|
73
|
-
|
74
71
|
all_data.extend(page_data)
|
75
72
|
page_number += 1
|
76
|
-
|
77
73
|
if not all_data:
|
78
74
|
return pd.DataFrame()
|
79
|
-
|
80
75
|
df = pd.DataFrame(all_data)
|
81
|
-
|
82
|
-
# 计算正确的序号
|
83
76
|
df["序号"] = df.apply(
|
84
77
|
lambda row: (row["page_number"] - 1) * items_per_page + row["page_index"] + 1,
|
85
78
|
axis=1,
|
86
79
|
)
|
87
|
-
|
88
|
-
# 删除临时列
|
89
80
|
df.drop(columns=["page_number", "page_index"], inplace=True, errors="ignore")
|
90
|
-
|
91
|
-
# 设置列名 - 修正了5分钟涨跌的映射 (f11 是正确的5分钟涨跌字段)
|
92
81
|
column_map = {
|
93
82
|
"f1": "原序号",
|
94
83
|
"f2": "最新价",
|
@@ -122,8 +111,6 @@ def process_data(page_results: List[Dict]) -> pd.DataFrame:
|
|
122
111
|
}
|
123
112
|
|
124
113
|
df.rename(columns=column_map, inplace=True)
|
125
|
-
|
126
|
-
# 选择需要的列并确保所有需要的列都存在
|
127
114
|
desired_columns = [
|
128
115
|
"序号",
|
129
116
|
"代码",
|
@@ -149,12 +136,8 @@ def process_data(page_results: List[Dict]) -> pd.DataFrame:
|
|
149
136
|
"60日涨跌幅",
|
150
137
|
"年初至今涨跌幅",
|
151
138
|
]
|
152
|
-
|
153
|
-
# 过滤出存在的列
|
154
139
|
available_columns = [col for col in desired_columns if col in df.columns]
|
155
140
|
df = df[available_columns]
|
156
|
-
|
157
|
-
# 转换数值类型
|
158
141
|
numeric_columns = [
|
159
142
|
"最新价",
|
160
143
|
"涨跌幅",
|
@@ -177,18 +160,12 @@ def process_data(page_results: List[Dict]) -> pd.DataFrame:
|
|
177
160
|
"60日涨跌幅",
|
178
161
|
"年初至今涨跌幅",
|
179
162
|
]
|
180
|
-
|
181
163
|
for col in numeric_columns:
|
182
164
|
if col in df.columns:
|
183
165
|
df[col] = pd.to_numeric(df[col], errors="coerce")
|
184
|
-
|
185
|
-
# 按涨跌幅降序排序
|
186
166
|
df.sort_values(by="涨跌幅", ascending=False, inplace=True)
|
187
|
-
|
188
|
-
# 重新生成序号
|
189
167
|
df.reset_index(drop=True, inplace=True)
|
190
168
|
df["序号"] = df.index + 1
|
191
|
-
|
192
169
|
return df
|
193
170
|
|
194
171
|
|
@@ -213,7 +190,6 @@ async def stock_zh_a_spot_em_async() -> pd.DataFrame:
|
|
213
190
|
"fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,"
|
214
191
|
"f20,f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
|
215
192
|
}
|
216
|
-
|
217
193
|
results = await fetch_all_pages_async(url, params)
|
218
194
|
return process_data(results)
|
219
195
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: akshare
|
3
|
-
Version: 1.16.
|
3
|
+
Version: 1.16.78
|
4
4
|
Summary: AKShare is an elegant and simple financial data interface library for Python, built for human beings!
|
5
5
|
Home-page: https://github.com/akfamily/akshare
|
6
6
|
Author: AKFamily
|
@@ -53,13 +53,6 @@ Dynamic: requires-dist
|
|
53
53
|
Dynamic: requires-python
|
54
54
|
Dynamic: summary
|
55
55
|
|
56
|
-
**资源分享**:对于想了解更多财经数据与量化投研的小伙伴,推荐一个专注于财经数据和量化研究的知识社区。
|
57
|
-
该社区提供相关文档和视频学习资源,汇集了各类财经数据源和量化投研工具的使用经验。
|
58
|
-
有兴趣深入学习的朋友可点此[了解更多](https://t.zsxq.com/ZCxUG),也推荐大家关注微信公众号【数据科学实战】。
|
59
|
-
|
60
|
-
**工具推荐**:期魔方是一款本地化期货量化分析工具,适合数据分析爱好者使用。无需复杂部署,支持数据分析和机器学习功能,研究功能免费开放。
|
61
|
-
如需了解更多信息可访问[期魔方](https://qmfquant.com/)。
|
62
|
-
|
63
56
|

|
64
57
|
|
65
58
|
[](https://pypi.org/project/akshare/)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
akshare/__init__.py,sha256=
|
1
|
+
akshare/__init__.py,sha256=GbUMpPLXtUTAcMkn9JIZ1ByRkQmD-SQNGuL3F6SNp6Y,193425
|
2
2
|
akshare/datasets.py,sha256=rKuRNZrqi6IMsZ9nyvO3Rx02js0tH3zMLjz8HQNAoPQ,963
|
3
3
|
akshare/exceptions.py,sha256=WEJjIhSmJ_xXNW6grwV4nufE_cfmmyuhmueVGiN1VAg,878
|
4
4
|
akshare/request.py,sha256=HtFFf9MhfEibR-ETWe-1Tts6ELU4VKSqA-ghaXjegQM,4252
|
@@ -131,7 +131,7 @@ akshare/futures/futures_spot_stock_em.py,sha256=43CPkAouDu691M6aCMdO1SGKglTak2ab
|
|
131
131
|
akshare/futures/futures_stock_js.py,sha256=sAao7ZcqBovdEo4wrVt2K6kXK2rf1_kT_StQdzhm9og,1635
|
132
132
|
akshare/futures/futures_to_spot.py,sha256=0MCVcZoZoOMd7DSR357K2UHoRBCeHyONyRCu8oWVWuw,12841
|
133
133
|
akshare/futures/futures_warehouse_receipt.py,sha256=wF98kwKsIc0GCcwgwoup2m76Pg800HdXY29Wf1jvDNc,9116
|
134
|
-
akshare/futures/futures_zh_sina.py,sha256=
|
134
|
+
akshare/futures/futures_zh_sina.py,sha256=wFFiPdud7a6HUHxohlQmN0FsnrvsadTYhbq0cZT4dpo,26191
|
135
135
|
akshare/futures/receipt.py,sha256=0VAEMkAGI0_U3JkKB5e42fZNsbDHhM-WjlXaJXACyM0,23491
|
136
136
|
akshare/futures/requests_fun.py,sha256=w4inzqYjrAiRx_E3oszbcJwrRJR3MKpm5Rkropdusoo,2893
|
137
137
|
akshare/futures/symbol_var.py,sha256=HnKKQ8waVW6sjlqh4F9vsloKY1NVs2s_-M4DB5hb7cA,5589
|
@@ -292,7 +292,7 @@ akshare/stock/stock_zh_kcb_sina.py,sha256=ZKFoyq9Y-6LhBoYERc4Oqv5q3Llpne7ngDIZcC
|
|
292
292
|
akshare/stock_a/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
293
293
|
akshare/stock_a/stock_board_concept_name_em.py,sha256=VqqvGwNHh8hFqL7zOzHjx_FvSuYycBkwgQvltK3s0Lc,5283
|
294
294
|
akshare/stock_a/stock_individual_fund_flow_rank.py,sha256=WBB8j2swF5WNlsfIk2kW4NzbhsozON2HXU5AiTYFgRw,8996
|
295
|
-
akshare/stock_a/stock_zh_a_spot.py,sha256=
|
295
|
+
akshare/stock_a/stock_zh_a_spot.py,sha256=452JAHlgj5wC9KI5bF3VSlslcHv9CrDTiR9_jJaCD6M,6072
|
296
296
|
akshare/stock_feature/__init__.py,sha256=c2VDBGyg8nWZYLvtnnSqUoQ92Cu6dJ7UFOeJsB2Gff8,82
|
297
297
|
akshare/stock_feature/cons.py,sha256=h_cIhO4YEx8joPozwE5-jHABPsT8tN7tkZ5v-gcTfmw,466
|
298
298
|
akshare/stock_feature/stock_a_below_net_asset_statistics.py,sha256=XrhZI-wLuXXufI5Nh1l9gUx9x7f0iDtdtKa14wexo54,2653
|
@@ -394,10 +394,10 @@ akshare/utils/func.py,sha256=4cwmXFztU86yJNONJ40KJLvsIEQHBbct4iMm3zT2v30,2315
|
|
394
394
|
akshare/utils/multi_decrypt.py,sha256=aWoL2iEPeuXHJg8-n7OtMKixLnIhfzepACgxfrfmQB4,1657
|
395
395
|
akshare/utils/token_process.py,sha256=nGtgnZGRprXJkhLXH8mcUH4TgIFwzsTOb0EaEPa0Euo,667
|
396
396
|
akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
|
397
|
-
akshare-1.16.
|
397
|
+
akshare-1.16.78.dist-info/licenses/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
|
398
398
|
tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
|
399
399
|
tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
|
400
|
-
akshare-1.16.
|
401
|
-
akshare-1.16.
|
402
|
-
akshare-1.16.
|
403
|
-
akshare-1.16.
|
400
|
+
akshare-1.16.78.dist-info/METADATA,sha256=Exf2oiP7sHonZthQwhNjNGrMysnsHnnMC5diPcbeCNU,11902
|
401
|
+
akshare-1.16.78.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
402
|
+
akshare-1.16.78.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
403
|
+
akshare-1.16.78.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|