mns-common 1.3.1.8__tar.gz → 1.3.2.0__tar.gz
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-1.3.1.8 → mns_common-1.3.2.0}/PKG-INFO +1 -1
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/east_money_debt_api.py +1 -1
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/east_money_etf_api.py +1 -1
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/east_money_stock_api.py +1 -1
- mns_common-1.3.2.0/mns_common/api/em/east_money_stock_api_develop.py +217 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/east_money_stock_hk_api.py +1 -1
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/east_money_stock_v2_api.py +1 -1
- mns_common-1.3.2.0/mns_common/api/us/ths_us_company_info_api.py +9 -0
- mns_common-1.3.2.0/mns_common/component/tfp/__init__.py +7 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common.egg-info/PKG-INFO +1 -1
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common.egg-info/SOURCES.txt +3 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/setup.py +1 -1
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/README.md +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/akshare/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/akshare/k_line_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/akshare/stock_bid_ask_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/akshare/stock_dt_pool.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/akshare/stock_zb_pool.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/akshare/stock_zt_pool_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/akshare/yjyg_sync_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/east_money_stock_gdfx_free_top_10_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/em_concept_index_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/self_choose/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/hk/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/hk/ths_hk_company_info_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/common/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/common/kpl_common_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/common/kpl_common_field_constant.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/concept/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/concept/kpl_concept_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/constant/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/constant/kpl_constant.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/industry/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/industry/kpl_industry_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/selection/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/selection/kpl_selection_plate_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/symbol/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/symbol/kpl_symbol_common_field_constant.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/symbol/symbol_his_quotes_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/msg/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/msg/push_msg_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/big_deal/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/big_deal/ths_big_deal_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/company/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/company/ths_company_announce_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/company/ths_company_info_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/app/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/app/ths_concept_detail_app.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/app/ths_concept_index_app.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/ths_common_js_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/ths_company_info_web.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/ths_concept_detail_web.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/ths_concept_index_web.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/self_choose/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/self_choose/ths_self_choose_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/wen_cai/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/wen_cai/ths_wen_cai_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/zt/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/zt/ths_stock_zt_pool_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/classify → mns_common-1.3.2.0/mns_common/api/us}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/cache/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/cache/cache_service.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/cookie → mns_common-1.3.2.0/mns_common/component/classify}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/classify/symbol_classify_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/classify/symbol_classify_param.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/common_service_fun_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/company/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/company/company_common_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/company/company_common_service_new_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/concept/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/concept/kpl_concept_common_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/concept/ths_concept_common_service_api.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/deal → mns_common-1.3.2.0/mns_common/component/cookie}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/cookie/cookie_info_service.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/data/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/data/data_init_api.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/hk → mns_common-1.3.2.0/mns_common/component/deal}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/deal/deal_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/deal/terminal_enum.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/price → mns_common-1.3.2.0/mns_common/component/hk}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/hk/company_hk_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/industry/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/industry/ths_industry_index_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/clean/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/clean/k_line_param.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/clean/sh_small_normal_zt_k_line_check_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/common/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/common/k_line_common_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/patterns/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/patterns/k_line_patterns_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/patterns/pattern_Enum.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/qmt → mns_common-1.3.2.0/mns_common/component/price}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/price/trade_price_service_api.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/redis_msg → mns_common-1.3.2.0/mns_common/component/qmt}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/qmt/qmt_buy_service.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/real_time/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/real_time/real_time_common_service_api.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/self_choose → mns_common-1.3.2.0/mns_common/component/redis_msg}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/redis_msg/redis_msg_publish_service.py +0 -0
- {mns_common-1.3.1.8/mns_common/component/tfp → mns_common-1.3.2.0/mns_common/component/self_choose}/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/self_choose/black_list_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/self_choose/self_choose_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/tfp/stock_tfp_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/trade_date/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/trade_date/trade_date_common_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/zt/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/zt/zt_common_service_api.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/constant/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/constant/black_list_classify_enum.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/constant/db_name_constant.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/constant/price_enum.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/constant/redis_msg_constant.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/constant/self_choose_constant.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/db/MongodbUtil.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/db/MongodbUtilLocal.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/db/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/utils/__init__.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/utils/async_fun.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/utils/cmd_util.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/utils/data_frame_util.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/utils/date_handle_util.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/utils/db_util.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/utils/file_util.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/utils/ip_util.py +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common.egg-info/dependency_links.txt +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common.egg-info/top_level.txt +0 -0
- {mns_common-1.3.1.8 → mns_common-1.3.2.0}/setup.cfg +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
file_path = os.path.abspath(__file__)
|
|
5
|
+
end = file_path.index('mns') + 14
|
|
6
|
+
project_path = file_path[0:end]
|
|
7
|
+
sys.path.append(project_path)
|
|
8
|
+
import mns_common.utils.data_frame_util as data_frame_util
|
|
9
|
+
import requests
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
import pandas as pd
|
|
13
|
+
from loguru import logger
|
|
14
|
+
import json
|
|
15
|
+
import threading
|
|
16
|
+
|
|
17
|
+
# 定义一个全局锁,用于保护 result 变量的访问
|
|
18
|
+
result_lock = threading.Lock()
|
|
19
|
+
# 初始化 result 变量为一个空的 Pandas DataFrame
|
|
20
|
+
result = pd.DataFrame()
|
|
21
|
+
|
|
22
|
+
MAX_PAGE_NUMBER = 200
|
|
23
|
+
# A股股票数量 todo暂定
|
|
24
|
+
STOCK_NUMBER = 5600
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def sync_real_time_quotes():
|
|
28
|
+
global result
|
|
29
|
+
result = pd.DataFrame() # 重新初始化 result 变量
|
|
30
|
+
threads = []
|
|
31
|
+
page_number = round(STOCK_NUMBER / MAX_PAGE_NUMBER, 0) + 1
|
|
32
|
+
page_number = int(page_number)
|
|
33
|
+
# 创建多个线程来获取数据
|
|
34
|
+
for page in range(page_number): # 0到100页
|
|
35
|
+
thread = threading.Thread(target=all_stock_ticker_data_new, args=(page,))
|
|
36
|
+
threads.append(thread)
|
|
37
|
+
thread.start()
|
|
38
|
+
|
|
39
|
+
# 等待所有线程完成
|
|
40
|
+
for thread in threads:
|
|
41
|
+
thread.join()
|
|
42
|
+
|
|
43
|
+
return result
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def all_stock_ticker_data_new(page) -> pd.DataFrame:
|
|
47
|
+
global result
|
|
48
|
+
fields = ("f352,f2,f3,f5,f6,f8,f10,f11,f22,f12,f14,f15,f16,f17,f18,f20,f21,f26,f33,f34,f35,f62,f66,f69,f72,f100,"
|
|
49
|
+
"f184,f211,f212"),
|
|
50
|
+
fs = "m:0 t:6,m:0 t:80,m:1 t:2,m:1 t:23,m:0 t:81 s:2048"
|
|
51
|
+
|
|
52
|
+
url = "https://13.push2.eastmoney.com/api/qt/clist/get"
|
|
53
|
+
# url = "https://push2.eastmoney.com/api/qt/clist/get?cb=jQuery112303212778189608789_1645434416300&fid=f62&po=1&pz=6000&pn=1&np=1&fltt=2&invt=2&ut=b2884a393a59ad64002292a3e90d46a5&fs=m%3A0%2Bt%3A6%2Bf%3A!2%2Cm%3A0%2Bt%3A13%2Bf%3A!2%2Cm%3A0%2Bt%3A80%2Bf%3A!2%2Cm%3A1%2Bt%3A2%2Bf%3A!2%2Cm%3A1%2Bt%3A23%2Bf%3A!2%2Cm%3A0%2Bt%3A7%2Bf%3A!2%2Cm%3A1%2Bt%3A3%2Bf%3A!2&fields=f12%2Cf14%2Cf2%2Cf3%2Cf62%2Cf184%2Cf66%2Cf69%2Cf72%2Cf75%2Cf78%2Cf81%2Cf84%2Cf87%2Cf204%2Cf205%2Cf124%2Cf1%2Cf13"
|
|
54
|
+
params = {
|
|
55
|
+
"cb": "jQuery1124046660442520420653_1660036672477",
|
|
56
|
+
"pn": "1",
|
|
57
|
+
"pz": "10000",
|
|
58
|
+
"po": "1",
|
|
59
|
+
"np": str(page),
|
|
60
|
+
"ut": " bd1d9ddb04089700cf9c27f6f7426281",
|
|
61
|
+
"fltt": "2",
|
|
62
|
+
"invt": "2",
|
|
63
|
+
"wbp2u": "|0|0|0|web",
|
|
64
|
+
"fid": "f3",
|
|
65
|
+
"fs": fs,
|
|
66
|
+
"fields": fields,
|
|
67
|
+
"_": 1660036672518
|
|
68
|
+
}
|
|
69
|
+
try:
|
|
70
|
+
r = requests.get(url, params)
|
|
71
|
+
data_text = r.text
|
|
72
|
+
begin_index = data_text.index('[')
|
|
73
|
+
end_index = data_text.index(']')
|
|
74
|
+
data_json = data_text[begin_index:end_index + 1]
|
|
75
|
+
data_json = json.loads(data_json)
|
|
76
|
+
logger.info("页码:{}",page)
|
|
77
|
+
if data_json is None:
|
|
78
|
+
data_df = pd.DataFrame()
|
|
79
|
+
else:
|
|
80
|
+
data_df = pd.DataFrame(data_json)
|
|
81
|
+
with result_lock:
|
|
82
|
+
# 使用锁来保护 result 变量的访问,将每页的数据添加到结果中
|
|
83
|
+
try:
|
|
84
|
+
if data_frame_util.is_not_empty(data_df):
|
|
85
|
+
result = pd.concat([result, data_df], ignore_index=True)
|
|
86
|
+
except BaseException as e:
|
|
87
|
+
logger.error("同步东财实时数据异常:{}", e)
|
|
88
|
+
result = pd.DataFrame()
|
|
89
|
+
except Exception as e:
|
|
90
|
+
logger.error("获取股票列表,实时行情异常:{},{}", e,page)
|
|
91
|
+
return pd.DataFrame()
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
# f212 卖1
|
|
95
|
+
# f211 买1
|
|
96
|
+
# f31 买1价格
|
|
97
|
+
# "f32" : 卖1价格
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# 获取所有股票实时行情数据 f33,委比
|
|
101
|
+
def get_real_time_quotes_all_stocks():
|
|
102
|
+
# todo old version
|
|
103
|
+
# stock_ticker_data = all_stock_ticker_data(
|
|
104
|
+
# "f352,f2,f3,f5,f6,f8,f10,f11,f12,f14,f15,f16,f17,f18,f20,f21,f26,"
|
|
105
|
+
# "f33,f34,f35,f62,f66,f69,f72,f100,f184",
|
|
106
|
+
# "m:0+t:6+f:!2,m:0+t:13+f:!2,m:0+t:80+f:!2,m:1+t:2+f:!2,m:1+t:23+f:!2,m:0+t:7+f:!2,m:1+t:3+f:!2")
|
|
107
|
+
|
|
108
|
+
# todo new version
|
|
109
|
+
stock_ticker_data = all_stock_ticker_data_new(
|
|
110
|
+
"f352,f2,f3,f5,f6,f8,f10,f11,f22,f12,f14,f15,f16,f17,f18,f20,f21,f26,"
|
|
111
|
+
"f33,f34,f35,f62,f66,f69,f72,f100,f184,f211,f212",
|
|
112
|
+
"m:0 t:6,m:0 t:80,m:1 t:2,m:1 t:23,m:0 t:81 s:2048")
|
|
113
|
+
|
|
114
|
+
temp_df = stock_ticker_data.rename(columns={
|
|
115
|
+
"f2": "now_price",
|
|
116
|
+
"f3": "chg",
|
|
117
|
+
"f5": "volume",
|
|
118
|
+
"f6": "amount",
|
|
119
|
+
"f8": "exchange",
|
|
120
|
+
"f10": "quantity_ratio",
|
|
121
|
+
"f22": "up_speed",
|
|
122
|
+
"f11": "up_speed_05",
|
|
123
|
+
"f12": "symbol",
|
|
124
|
+
"f14": "name",
|
|
125
|
+
"f15": "high",
|
|
126
|
+
"f16": "low",
|
|
127
|
+
"f17": "open",
|
|
128
|
+
"f18": "yesterday_price",
|
|
129
|
+
"f20": "total_mv",
|
|
130
|
+
"f21": "flow_mv",
|
|
131
|
+
"f26": "list_date",
|
|
132
|
+
"f33": "wei_bi",
|
|
133
|
+
"f34": "outer_disk",
|
|
134
|
+
"f35": "inner_disk",
|
|
135
|
+
"f62": "today_main_net_inflow",
|
|
136
|
+
"f66": "super_large_order_net_inflow",
|
|
137
|
+
"f69": "super_large_order_net_inflow_ratio",
|
|
138
|
+
"f72": "large_order_net_inflow",
|
|
139
|
+
# "f78": "medium_order_net_inflow",
|
|
140
|
+
# "f84": "small_order_net_inflow",
|
|
141
|
+
"f100": "industry",
|
|
142
|
+
# "f103": "concept",
|
|
143
|
+
"f184": "today_main_net_inflow_ratio",
|
|
144
|
+
"f352": "average_price",
|
|
145
|
+
"f211": "buy_1_num",
|
|
146
|
+
"f212": "sell_1_num"
|
|
147
|
+
})
|
|
148
|
+
temp_df.loc[temp_df['buy_1_num'] == '-', 'buy_1_num'] = 0
|
|
149
|
+
temp_df.loc[temp_df['sell_1_num'] == '-', 'sell_1_num'] = 0
|
|
150
|
+
temp_df.loc[temp_df['up_speed_05'] == '-', 'up_speed_05'] = 0
|
|
151
|
+
temp_df.loc[temp_df['up_speed'] == '-', 'up_speed'] = 0
|
|
152
|
+
temp_df.loc[temp_df['average_price'] == '-', 'average_price'] = 0
|
|
153
|
+
temp_df.loc[temp_df['wei_bi'] == '-', 'wei_bi'] = 0
|
|
154
|
+
temp_df.loc[temp_df['yesterday_price'] == '-', 'yesterday_price'] = 0
|
|
155
|
+
temp_df.loc[temp_df['now_price'] == '-', 'now_price'] = 0
|
|
156
|
+
temp_df.loc[temp_df['chg'] == '-', 'chg'] = 0
|
|
157
|
+
temp_df.loc[temp_df['volume'] == '-', 'volume'] = 0
|
|
158
|
+
temp_df.loc[temp_df['amount'] == '-', 'amount'] = 0
|
|
159
|
+
temp_df.loc[temp_df['exchange'] == '-', 'exchange'] = 0
|
|
160
|
+
temp_df.loc[temp_df['quantity_ratio'] == '-', 'quantity_ratio'] = 0
|
|
161
|
+
temp_df.loc[temp_df['high'] == '-', 'high'] = 0
|
|
162
|
+
temp_df.loc[temp_df['low'] == '-', 'low'] = 0
|
|
163
|
+
temp_df.loc[temp_df['open'] == '-', 'open'] = 0
|
|
164
|
+
temp_df.loc[temp_df['total_mv'] == '-', 'total_mv'] = 0
|
|
165
|
+
temp_df.loc[temp_df['flow_mv'] == '-', 'flow_mv'] = 0
|
|
166
|
+
temp_df.loc[temp_df['inner_disk'] == '-', 'inner_disk'] = 0
|
|
167
|
+
temp_df.loc[temp_df['outer_disk'] == '-', 'outer_disk'] = 0
|
|
168
|
+
temp_df.loc[temp_df['today_main_net_inflow_ratio'] == '-', 'today_main_net_inflow_ratio'] = 0
|
|
169
|
+
temp_df.loc[temp_df['today_main_net_inflow'] == '-', 'today_main_net_inflow'] = 0
|
|
170
|
+
temp_df.loc[temp_df['super_large_order_net_inflow'] == '-', 'super_large_order_net_inflow'] = 0
|
|
171
|
+
temp_df.loc[temp_df['super_large_order_net_inflow_ratio'] == '-', 'super_large_order_net_inflow_ratio'] = 0
|
|
172
|
+
temp_df.loc[temp_df['large_order_net_inflow'] == '-', 'large_order_net_inflow'] = 0
|
|
173
|
+
# temp_df.loc[temp_df['medium_order_net_inflow'] == '-', 'medium_order_net_inflow'] = 0
|
|
174
|
+
# temp_df.loc[temp_df['small_order_net_inflow'] == '-', 'small_order_net_inflow'] = 0
|
|
175
|
+
|
|
176
|
+
temp_df["list_date"] = pd.to_numeric(temp_df["list_date"], errors="coerce")
|
|
177
|
+
temp_df["wei_bi"] = pd.to_numeric(temp_df["wei_bi"], errors="coerce")
|
|
178
|
+
temp_df["average_price"] = pd.to_numeric(temp_df["average_price"], errors="coerce")
|
|
179
|
+
temp_df["yesterday_price"] = pd.to_numeric(temp_df["yesterday_price"], errors="coerce")
|
|
180
|
+
temp_df["now_price"] = pd.to_numeric(temp_df["now_price"], errors="coerce")
|
|
181
|
+
temp_df["chg"] = pd.to_numeric(temp_df["chg"], errors="coerce")
|
|
182
|
+
temp_df["volume"] = pd.to_numeric(temp_df["volume"], errors="coerce")
|
|
183
|
+
temp_df["amount"] = pd.to_numeric(temp_df["amount"], errors="coerce")
|
|
184
|
+
temp_df["exchange"] = pd.to_numeric(temp_df["exchange"], errors="coerce")
|
|
185
|
+
temp_df["quantity_ratio"] = pd.to_numeric(temp_df["quantity_ratio"], errors="coerce")
|
|
186
|
+
temp_df["high"] = pd.to_numeric(temp_df["high"], errors="coerce")
|
|
187
|
+
temp_df["low"] = pd.to_numeric(temp_df["low"], errors="coerce")
|
|
188
|
+
temp_df["open"] = pd.to_numeric(temp_df["open"], errors="coerce")
|
|
189
|
+
temp_df["total_mv"] = pd.to_numeric(temp_df["total_mv"], errors="coerce")
|
|
190
|
+
temp_df["flow_mv"] = pd.to_numeric(temp_df["flow_mv"], errors="coerce")
|
|
191
|
+
temp_df["outer_disk"] = pd.to_numeric(temp_df["outer_disk"], errors="coerce")
|
|
192
|
+
temp_df["inner_disk"] = pd.to_numeric(temp_df["inner_disk"], errors="coerce")
|
|
193
|
+
temp_df["today_main_net_inflow"] = pd.to_numeric(temp_df["today_main_net_inflow"], errors="coerce")
|
|
194
|
+
temp_df["super_large_order_net_inflow"] = pd.to_numeric(temp_df["super_large_order_net_inflow"],
|
|
195
|
+
errors="coerce")
|
|
196
|
+
temp_df["super_large_order_net_inflow_ratio"] = pd.to_numeric(temp_df["super_large_order_net_inflow_ratio"],
|
|
197
|
+
errors="coerce")
|
|
198
|
+
temp_df["large_order_net_inflow"] = pd.to_numeric(temp_df["large_order_net_inflow"],
|
|
199
|
+
errors="coerce")
|
|
200
|
+
# temp_df["medium_order_net_inflow"] = pd.to_numeric(temp_df["medium_order_net_inflow"],
|
|
201
|
+
# errors="coerce")
|
|
202
|
+
# temp_df["small_order_net_inflow"] = pd.to_numeric(temp_df["small_order_net_inflow"], errors="coerce")
|
|
203
|
+
|
|
204
|
+
# 大单比例
|
|
205
|
+
temp_df['large_order_net_inflow_ratio'] = round((temp_df['large_order_net_inflow'] / temp_df['amount']) * 100, 2)
|
|
206
|
+
|
|
207
|
+
# 外盘是内盘倍数
|
|
208
|
+
temp_df['disk_ratio'] = round((temp_df['outer_disk'] - temp_df['inner_disk']) / temp_df['inner_disk'], 2)
|
|
209
|
+
# 只有外盘没有内盘
|
|
210
|
+
temp_df.loc[temp_df["inner_disk"] == 0, ['disk_ratio']] = 1688
|
|
211
|
+
|
|
212
|
+
return temp_df
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
if __name__ == '__main__':
|
|
216
|
+
df = all_stock_ticker_data_new(1)
|
|
217
|
+
print(df)
|
|
@@ -17,6 +17,7 @@ mns_common/api/em/__init__.py
|
|
|
17
17
|
mns_common/api/em/east_money_debt_api.py
|
|
18
18
|
mns_common/api/em/east_money_etf_api.py
|
|
19
19
|
mns_common/api/em/east_money_stock_api.py
|
|
20
|
+
mns_common/api/em/east_money_stock_api_develop.py
|
|
20
21
|
mns_common/api/em/east_money_stock_gdfx_free_top_10_api.py
|
|
21
22
|
mns_common/api/em/east_money_stock_hk_api.py
|
|
22
23
|
mns_common/api/em/east_money_stock_v2_api.py
|
|
@@ -64,6 +65,8 @@ mns_common/api/ths/wen_cai/ths_wen_cai_api.py
|
|
|
64
65
|
mns_common/api/ths/zt/__init__.py
|
|
65
66
|
mns_common/api/ths/zt/ths_stock_zt_pool_api.py
|
|
66
67
|
mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py
|
|
68
|
+
mns_common/api/us/__init__.py
|
|
69
|
+
mns_common/api/us/ths_us_company_info_api.py
|
|
67
70
|
mns_common/component/__init__.py
|
|
68
71
|
mns_common/component/common_service_fun_api.py
|
|
69
72
|
mns_common/component/cache/__init__.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/em/east_money_stock_gdfx_free_top_10_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/common/kpl_common_field_constant.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/selection/kpl_selection_plate_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/kpl/symbol/symbol_his_quotes_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/company/ths_company_announce_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/company/ths_company_info_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/app/ths_concept_detail_app.py
RENAMED
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/app/ths_concept_index_app.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/ths_common_js_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/ths_company_info_web.py
RENAMED
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/ths_concept_detail_web.py
RENAMED
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/concept/web/ths_concept_index_web.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/api/ths/self_choose/ths_self_choose_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/classify/symbol_classify_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/classify/symbol_classify_param.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/company/company_common_service_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/cookie/cookie_info_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/industry/ths_industry_index_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/k_line/patterns/pattern_Enum.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/price/trade_price_service_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.1.8 → mns_common-1.3.2.0}/mns_common/component/self_choose/black_list_service_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|