mns-common 1.3.3.5__py3-none-any.whl → 1.3.3.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.
Potentially problematic release.
This version of mns-common might be problematic. Click here for more details.
- mns_common/api/em/east_money_stock_v2_api.py +64 -0
- {mns_common-1.3.3.5.dist-info → mns_common-1.3.3.6.dist-info}/METADATA +1 -1
- {mns_common-1.3.3.5.dist-info → mns_common-1.3.3.6.dist-info}/RECORD +5 -5
- {mns_common-1.3.3.5.dist-info → mns_common-1.3.3.6.dist-info}/WHEEL +0 -0
- {mns_common-1.3.3.5.dist-info → mns_common-1.3.3.6.dist-info}/top_level.txt +0 -0
|
@@ -210,8 +210,72 @@ def rename_real_time_quotes_df(temp_df):
|
|
|
210
210
|
return temp_df
|
|
211
211
|
|
|
212
212
|
|
|
213
|
+
# 北向/南向资金状况 北向已经停止
|
|
214
|
+
def get_sum_north_south_net_buy_amt():
|
|
215
|
+
# 设置请求头部信息
|
|
216
|
+
headers = {
|
|
217
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
# 设置请求URL
|
|
221
|
+
url = 'http://push2.eastmoney.com/api/qt/kamt/get?fields1=f1,f2,f3,f4&fields2=f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64,f65,f66,f67,f68,f69,f70&ut=b2884a393a59ad640022ce1e1e78431c&deviceid=0&cb=jsonp_1622790712837&_=1622790712926'
|
|
222
|
+
|
|
223
|
+
# 发送HTTP请求
|
|
224
|
+
response = requests.get(url, headers=headers, params={"type": "json"})
|
|
225
|
+
|
|
226
|
+
# 解析JSON数据
|
|
227
|
+
data = json.loads(response.text.lstrip('jsonp_1622790712837(').rstrip(');'))
|
|
228
|
+
|
|
229
|
+
# 处理数据
|
|
230
|
+
|
|
231
|
+
# 单位(万元)
|
|
232
|
+
# dayNetAmtIn 资金净流入
|
|
233
|
+
# dayAmtRemain 当日资金余额
|
|
234
|
+
# dayAmtThreshold 当日资金限额
|
|
235
|
+
# monthNetAmtIn 当月净流入
|
|
236
|
+
# yearNetAmtIn 年度净流入
|
|
237
|
+
# allNetAmtIn 总净流入
|
|
238
|
+
# buyAmt 当日买入金额
|
|
239
|
+
# sellAmt 当日卖出金额
|
|
240
|
+
# buySellAmt 当日买入卖出总金额
|
|
241
|
+
# netBuyAmt 成交净买额
|
|
242
|
+
|
|
243
|
+
# Hongkong to Shanghai
|
|
244
|
+
hk2sh = data['data']['hk2sh']
|
|
245
|
+
hk2sh_df = pd.DataFrame(hk2sh, index=[0])
|
|
246
|
+
# Hongkong to ShenZhen
|
|
247
|
+
hk2sz = data['data']['hk2sz']
|
|
248
|
+
hk2sz_df = pd.DataFrame(hk2sz, index=[0])
|
|
249
|
+
|
|
250
|
+
# Shanghai to Hongkong
|
|
251
|
+
sh2hk = data['data']['sh2hk']
|
|
252
|
+
sh2hk_df = pd.DataFrame(sh2hk, index=[0])
|
|
253
|
+
|
|
254
|
+
# ShenZhen to Hongkong
|
|
255
|
+
sz2hk = data['data']['sz2hk']
|
|
256
|
+
sz2hk_df = pd.DataFrame(sz2hk, index=[0])
|
|
257
|
+
# 北向总额
|
|
258
|
+
sum_north_netBuyAmt = hk2sh_df['netBuyAmt'] + hk2sz_df['netBuyAmt']
|
|
259
|
+
|
|
260
|
+
sum_south_netBuyAmt = sh2hk_df['netBuyAmt'] + sz2hk_df['netBuyAmt']
|
|
261
|
+
|
|
262
|
+
df = pd.DataFrame([[
|
|
263
|
+
list(hk2sh_df['netBuyAmt'])[0],
|
|
264
|
+
list(hk2sz_df['netBuyAmt'])[0],
|
|
265
|
+
list(sum_north_netBuyAmt)[0],
|
|
266
|
+
list(sh2hk_df['netBuyAmt'])[0],
|
|
267
|
+
list(sz2hk_df['netBuyAmt'])[0],
|
|
268
|
+
list(sum_south_netBuyAmt)[0]]],
|
|
269
|
+
columns=['sh_netBuyAmt', 'sz_netBuyAmt', 'sum_north_netBuyAmt',
|
|
270
|
+
'sh_hk_netBuyAmt', 'sz_hk_netBuyAmt', 'sum_south_netBuyAmt'])
|
|
271
|
+
|
|
272
|
+
# 打印结果
|
|
273
|
+
return df
|
|
274
|
+
|
|
275
|
+
|
|
213
276
|
# 示例调用
|
|
214
277
|
if __name__ == "__main__":
|
|
278
|
+
get_sum_north_south_net_buy_amt()
|
|
215
279
|
while True:
|
|
216
280
|
df = get_all_real_time_quotes()
|
|
217
281
|
print(df)
|
|
@@ -14,7 +14,7 @@ mns_common/api/em/east_money_stock_api.py,sha256=hTDbc3k_7QU3xp9ZSIcyPP5jpm1FWwd
|
|
|
14
14
|
mns_common/api/em/east_money_stock_gdfx_free_top_10_api.py,sha256=jVy3fNdrkLq3ri7yUwXWt0ItB8LCHzt9CPz91Fj8sPA,9198
|
|
15
15
|
mns_common/api/em/east_money_stock_hk_api.py,sha256=vaJK9A_zMHAdFaIAw6QEG6FuyXBKnl60tzMySi8bzlc,14356
|
|
16
16
|
mns_common/api/em/east_money_stock_us_api.py,sha256=_EKzQ0rTTE9JFaOEQkG7e7MgO2IyJZXQxeit_UKcYA4,11013
|
|
17
|
-
mns_common/api/em/east_money_stock_v2_api.py,sha256=
|
|
17
|
+
mns_common/api/em/east_money_stock_v2_api.py,sha256=6LDx6B_VcyhZ8Zw8ZIkhywG0gkbTag8N32Sw7ATF6gk,11533
|
|
18
18
|
mns_common/api/em/em_concept_index_api.py,sha256=PP87ES8a_y0o3SKLzBsPrc7DCPI3MBCD-4SmoUUirl0,8285
|
|
19
19
|
mns_common/api/hk/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
20
20
|
mns_common/api/hk/ths_hk_company_info_api.py,sha256=Cxlbuccopa0G1s8o0uTnnyLn2QaxOvbDpJQJOj7J8a8,5360
|
|
@@ -135,7 +135,7 @@ mns_common/utils/date_handle_util.py,sha256=XS-MyA8_7k35LOCFAYOHgVcVkMft_Kc4Wa9U
|
|
|
135
135
|
mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
|
|
136
136
|
mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
|
|
137
137
|
mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
|
|
138
|
-
mns_common-1.3.3.
|
|
139
|
-
mns_common-1.3.3.
|
|
140
|
-
mns_common-1.3.3.
|
|
141
|
-
mns_common-1.3.3.
|
|
138
|
+
mns_common-1.3.3.6.dist-info/METADATA,sha256=DmPtYwsWNlstVUiKJeEuhTP4JTcMO67rnba9hUF6Yxs,61
|
|
139
|
+
mns_common-1.3.3.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
140
|
+
mns_common-1.3.3.6.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
|
|
141
|
+
mns_common-1.3.3.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|