mns-common 1.3.4.5__tar.gz → 1.3.4.6__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.4.5 → mns_common-1.3.4.6}/PKG-INFO +1 -1
- mns_common-1.3.4.6/mns_common/api/akshare/stock_bid_ask_api.py +87 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/common_service_fun_api.py +8 -3
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common.egg-info/PKG-INFO +1 -1
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/setup.py +1 -1
- mns_common-1.3.4.5/mns_common/api/akshare/stock_bid_ask_api.py +0 -169
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/README.md +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/akshare/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/akshare/k_line_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/akshare/stock_dt_pool.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/akshare/stock_zb_pool.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/akshare/stock_zt_pool_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/akshare/yjyg_sync_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/east_money_debt_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/east_money_etf_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/east_money_stock_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/east_money_stock_gdfx_free_top_10_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/east_money_stock_hk_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/east_money_stock_us_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/east_money_stock_v2_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/em/em_concept_index_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/hk/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/hk/ths_hk_company_info_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/k_line/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/k_line/stock_k_line_data_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/k_line/stock_minute_data_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/common/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/common/kpl_common_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/common/kpl_common_field_constant.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/concept/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/concept/kpl_concept_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/constant/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/constant/kpl_constant.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/industry/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/industry/kpl_industry_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/selection/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/selection/kpl_selection_plate_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/symbol/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/symbol/kpl_symbol_common_field_constant.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/symbol/symbol_his_quotes_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/msg/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/msg/push_msg_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/qmt/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/qmt/qmt_minunte_tick_data.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/big_deal/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/big_deal/ths_big_deal_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/company/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/company/ths_company_announce_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/company/ths_company_info_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/app/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/app/ths_concept_detail_app.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/app/ths_concept_index_app.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/ths_common_js_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/ths_company_info_web.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/ths_concept_detail_web.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/ths_concept_index_web.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/self_choose/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/self_choose/ths_self_choose_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/wen_cai/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/wen_cai/ths_wen_cai_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/zt/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/zt/ths_stock_zt_pool_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/us/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/us/ths_us_company_info_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/cache/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/cache/cache_service.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/classify/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/classify/symbol_classify_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/classify/symbol_classify_param.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/company/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/company/company_common_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/company/company_common_service_new_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/concept/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/concept/kpl_concept_common_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/concept/ths_concept_common_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/cookie/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/cookie/cookie_info_service.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/data/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/data/data_init_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/deal/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/deal/deal_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/deal/terminal_enum.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/hk/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/hk/company_hk_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/industry/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/industry/ths_industry_index_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/clean/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/clean/k_line_param.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/clean/sh_small_normal_zt_k_line_check_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/common/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/common/k_line_common_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/patterns/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/patterns/k_line_patterns_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/patterns/pattern_Enum.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/price/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/price/trade_price_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/qmt/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/qmt/qmt_buy_service.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/real_time/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/real_time/real_time_common_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/redis_msg/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/redis_msg/redis_msg_publish_service.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/self_choose/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/self_choose/black_list_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/self_choose/self_choose_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/tfp/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/tfp/stock_tfp_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/trade_date/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/trade_date/trade_date_common_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/zt/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/zt/zt_common_service_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/constant/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/constant/black_list_classify_enum.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/constant/db_name_constant.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/constant/east_money_stock_api.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/constant/extra_income_db_name.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/constant/price_enum.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/constant/redis_msg_constant.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/constant/self_choose_constant.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/db/MongodbUtil.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/db/MongodbUtilLocal.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/db/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/db/v2/MongodbUtilV2.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/db/v2/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/utils/__init__.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/utils/async_fun.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/utils/cmd_util.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/utils/data_frame_util.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/utils/date_handle_util.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/utils/db_util.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/utils/file_util.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/utils/ip_util.py +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common.egg-info/SOURCES.txt +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common.egg-info/dependency_links.txt +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common.egg-info/top_level.txt +0 -0
- {mns_common-1.3.4.5 → mns_common-1.3.4.6}/setup.cfg +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
file_path = os.path.abspath(__file__)
|
|
5
|
+
end = file_path.index('mns') + 7
|
|
6
|
+
project_path = file_path[0:end]
|
|
7
|
+
sys.path.append(project_path)
|
|
8
|
+
import pandas as pd
|
|
9
|
+
import requests
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def stock_bid_ask_em(symbol: str = "000001") -> dict:
|
|
13
|
+
"""
|
|
14
|
+
东方财富-行情报价
|
|
15
|
+
https://quote.eastmoney.com/sz000001.html
|
|
16
|
+
:param symbol: 股票代码
|
|
17
|
+
:type symbol: str
|
|
18
|
+
:return: 行情报价
|
|
19
|
+
:rtype: pandas.DataFrame
|
|
20
|
+
"""
|
|
21
|
+
url = "https://push2.eastmoney.com/api/qt/stock/get"
|
|
22
|
+
params = {
|
|
23
|
+
"fltt": "2",
|
|
24
|
+
"invt": "2",
|
|
25
|
+
"fields": "f43,f51,f52,f191,f120,f121,f122,f174,f175,f59,f163,f43,f57,f58,f169,f170,f46,f44,f51,f168,f47,f164,f116,f60,f45,f52,f50,f48,f167,f117,f71,f161,f49,f530,f135,f136,f137,f138,f139,f141,f142,f144,f145,f147,f148,f140,f143,f146,f149,f55,f62,f162,f92,f173,f104,f105,f84,f85,f183,f184,f185,f186,f187,f188,f189,f190,f191,f192,f107,f111,f86,f177,f78,f110,f262,f263,f264,f267,f268,f255,f256,f257,f258,f127,f199,f128,f198,f259,f260,f261,f171,f277,f278,f279,f288,f152,f250,f251,f252,f253,f254,f269,f270,f271,f272,f273,f274,f275,f276,f265,f266,f289,f290,f286,f285,f292,f293,f294,f295",
|
|
26
|
+
# "fields" :fields_02,
|
|
27
|
+
"secid": symbol,
|
|
28
|
+
}
|
|
29
|
+
r = requests.get(url, params=params)
|
|
30
|
+
data_json = r.json()
|
|
31
|
+
tick_dict = {
|
|
32
|
+
"now_price": data_json["data"]["f43"],
|
|
33
|
+
"dt_price": data_json["data"]["f52"],
|
|
34
|
+
"zt_price": data_json["data"]["f51"],
|
|
35
|
+
"wei_bi": data_json["data"]["f191"],
|
|
36
|
+
"sell_5": data_json["data"]["f31"],
|
|
37
|
+
"sell_5_vol": data_json["data"]["f32"] * 100,
|
|
38
|
+
"sell_4": data_json["data"]["f33"],
|
|
39
|
+
"sell_4_vol": data_json["data"]["f34"] * 100,
|
|
40
|
+
"sell_3": data_json["data"]["f35"],
|
|
41
|
+
"sell_3_vol": data_json["data"]["f36"] * 100,
|
|
42
|
+
"sell_2": data_json["data"]["f37"],
|
|
43
|
+
"sell_2_vol": data_json["data"]["f38"] * 100,
|
|
44
|
+
"sell_1": data_json["data"]["f39"],
|
|
45
|
+
"sell_1_vol": data_json["data"]["f40"] * 100,
|
|
46
|
+
"buy_1": data_json["data"]["f19"],
|
|
47
|
+
"buy_1_vol": data_json["data"]["f20"] * 100,
|
|
48
|
+
"buy_2": data_json["data"]["f17"],
|
|
49
|
+
"buy_2_vol": data_json["data"]["f18"] * 100,
|
|
50
|
+
"buy_3": data_json["data"]["f15"],
|
|
51
|
+
"buy_3_vol": data_json["data"]["f16"] * 100,
|
|
52
|
+
"buy_4": data_json["data"]["f13"],
|
|
53
|
+
"buy_4_vol": data_json["data"]["f14"] * 100,
|
|
54
|
+
"buy_5": data_json["data"]["f11"],
|
|
55
|
+
"buy_5_vol": data_json["data"]["f12"] * 100,
|
|
56
|
+
}
|
|
57
|
+
temp_df = pd.DataFrame(tick_dict, index=[1])
|
|
58
|
+
temp_df.reset_index(inplace=True)
|
|
59
|
+
temp_df.loc[temp_df['wei_bi'] == '-', 'wei_bi'] = 0
|
|
60
|
+
temp_df.loc[temp_df['sell_5'] == '-', 'sell_5_vol'] = 0
|
|
61
|
+
temp_df.loc[temp_df['sell_5'] == '-', 'sell_5'] = 0
|
|
62
|
+
temp_df.loc[temp_df['sell_4'] == '-', 'sell_4_vol'] = 0
|
|
63
|
+
temp_df.loc[temp_df['sell_4'] == '-', 'sell_4'] = 0
|
|
64
|
+
temp_df.loc[temp_df['sell_3'] == '-', 'sell_3_vol'] = 0
|
|
65
|
+
temp_df.loc[temp_df['sell_3'] == '-', 'sell_3'] = 0
|
|
66
|
+
temp_df.loc[temp_df['sell_2'] == '-', 'sell_2_vol'] = 0
|
|
67
|
+
temp_df.loc[temp_df['sell_2'] == '-', 'sell_2'] = 0
|
|
68
|
+
temp_df.loc[temp_df['sell_1'] == '-', 'sell_1_vol'] = 0
|
|
69
|
+
temp_df.loc[temp_df['sell_1'] == '-', 'sell_1'] = 0
|
|
70
|
+
temp_df.loc[temp_df['buy_1'] == '-', 'buy_1_vol'] = 0
|
|
71
|
+
temp_df.loc[temp_df['buy_1'] == '-', 'buy_1'] = 0
|
|
72
|
+
temp_df.loc[temp_df['buy_2'] == '-', 'buy_2_vol'] = 0
|
|
73
|
+
temp_df.loc[temp_df['buy_2'] == '-', 'buy_2'] = 0
|
|
74
|
+
temp_df.loc[temp_df['buy_3'] == '-', 'buy_3_vol'] = 0
|
|
75
|
+
temp_df.loc[temp_df['buy_3'] == '-', 'buy_3'] = 0
|
|
76
|
+
temp_df.loc[temp_df['buy_4'] == '-', 'buy_4_vol'] = 0
|
|
77
|
+
temp_df.loc[temp_df['buy_4'] == '-', 'buy_4'] = 0
|
|
78
|
+
temp_df.loc[temp_df['buy_5'] == '-', 'buy_5_vol'] = 0
|
|
79
|
+
temp_df.loc[temp_df['buy_5'] == '-', 'buy_5'] = 0
|
|
80
|
+
temp_df['symbol'] = symbol
|
|
81
|
+
return temp_df
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
if __name__ == '__main__':
|
|
85
|
+
while True:
|
|
86
|
+
df = stock_bid_ask_em('0.832110')
|
|
87
|
+
print(df)
|
|
@@ -145,6 +145,11 @@ def group_by_industry_sum(real_time_quotes_now, field1, field2):
|
|
|
145
145
|
return pd.DataFrame({field1: df_series.index, field2: df_series.values})
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
def symbol_add_prefix(symbol):
|
|
149
|
+
symbol_simple = symbol[0:6]
|
|
150
|
+
if symbol_simple.startswith('6'):
|
|
151
|
+
return '1' + symbol_simple
|
|
152
|
+
elif symbol_simple.startswith('0'):
|
|
153
|
+
return '0' + symbol_simple
|
|
154
|
+
else:
|
|
155
|
+
return '0' + symbol_simple
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
file_path = os.path.abspath(__file__)
|
|
5
|
-
end = file_path.index('mns') + 7
|
|
6
|
-
project_path = file_path[0:end]
|
|
7
|
-
sys.path.append(project_path)
|
|
8
|
-
import pandas as pd
|
|
9
|
-
from functools import lru_cache
|
|
10
|
-
import requests
|
|
11
|
-
|
|
12
|
-
fields_all = "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24,f25,f26,f27,f28,f29,f30,f31,f32,f33,f34,f35,f36,f37,f38,f39,f40,f41,f42,f43,f44,f45,f46,f47,f48,f49,f50,f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64,f65,f66,f67,f68,f69,f70,f71,f72,f73,f74,f75,f76,f77,f78,f79,f80,f81,f82,f83,f84,f85,f86,f87,f88,f89,f90,f91,f92,f93,f94,f95,f96,f97,f98,f99,f100,f101,f102,f103,f104,f105,f106,f107,f108" \
|
|
13
|
-
",f109,f110,f111,f112,f113,f114,f115,f116,f117,f118,f119,f120,f121,f122,f123,f124,f125,f126,f127,f128,f129,f130,f131,f132,f133,f134,f135,f136,f137,f138,f139,f140,f141,f142,f143,f144,f145,f146,f147,f148,f149,f150,f151,f152,f153,f154,f155,f156,f157,f158,f159,f160,f161,f162,f163,f164,f165,f166,f167,f168,f169,f170,f171,f172,f173,f174,f175,f176,f177,f178,f179,f180,f181,f182,f183,f184,f185,f186,f187,f188,f189,f190,f191,f192,f193,f194,f195,f196,f197,f198,f199,f200" \
|
|
14
|
-
",f209,f210,f212,f213,f214,f215,f216,f217,f218,f219,f220,f221,f222,f223,f224,f225,f226,f227,f228,f229,f230,f231,f232,f233,f234,f235,f236,f237,f238,f239,f240,f241,f242,f243,f244,f245,f246,f247,f248,f249,f250,f251,f252,f253,f254,f255,f256,f257,f258,f259,f260,f261,f262,f263,f264,f265,f266,f267,f268,f269,f270,f271,f272,f273,f274,f275,f276,f277,f278,f279,f280,f281,f282,f283,f284,f285,f286,f287,f288,f289,f290,f291,f292,f293,f294,f295,f296,f297,f298,f299,f300" \
|
|
15
|
-
",f309,f310,f312,f313,f314,f315,f316,f317,f318,f319,f320,f321,f322,f323,f324,f325,f326,f327,f328,f329,f330,f331,f332,f333,f334,f335,f336,f337,f338,f339,f340,f341,f342,f343,f344,f345,f346,f347,f348,f349,f350,f351,f352,f353,f354,f355,f356,f357,f358,f359,f360,f361,f362,f363,f364,f365,f366,f367,f368,f369,f370,f371,f372,f373,f374,f375,f376,f377,f378,f379,f380,f381,f382,f383,f384,f385,f386,f387,f388,f389,f390,f391,f392,f393,f394,f395,f396,f397,f398,f399,f401"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
# 行情报价接口
|
|
19
|
-
|
|
20
|
-
@lru_cache()
|
|
21
|
-
def __code_id_map_em() -> dict:
|
|
22
|
-
"""
|
|
23
|
-
东方财富-股票和市场代码
|
|
24
|
-
https://quote.eastmoney.com/center/gridlist.html#hs_a_board
|
|
25
|
-
:return: 股票和市场代码
|
|
26
|
-
:rtype: dict
|
|
27
|
-
"""
|
|
28
|
-
url = "http://80.push2.eastmoney.com/api/qt/clist/get"
|
|
29
|
-
params = {
|
|
30
|
-
"pn": "1",
|
|
31
|
-
"pz": "50000",
|
|
32
|
-
"po": "1",
|
|
33
|
-
"np": "3",
|
|
34
|
-
"ut": "bd1d9ddb04089700cf9c27f6f7426281",
|
|
35
|
-
"fltt": "2",
|
|
36
|
-
"invt": "2",
|
|
37
|
-
"fid": "f3",
|
|
38
|
-
"fs": "m:1 t:2,m:1 t:23",
|
|
39
|
-
"fields": "f12",
|
|
40
|
-
"_": "1623833739532",
|
|
41
|
-
}
|
|
42
|
-
r = requests.get(url, params=params)
|
|
43
|
-
data_json = r.json()
|
|
44
|
-
if not data_json["data"]["diff"]:
|
|
45
|
-
return dict()
|
|
46
|
-
temp_df = pd.DataFrame(data_json["data"]["diff"])
|
|
47
|
-
temp_df["market_id"] = 1
|
|
48
|
-
temp_df.columns = ["sh_code", "sh_id"]
|
|
49
|
-
code_id_dict = dict(zip(temp_df["sh_code"], temp_df["sh_id"]))
|
|
50
|
-
params = {
|
|
51
|
-
"pn": "1",
|
|
52
|
-
"pz": "50000",
|
|
53
|
-
"po": "1",
|
|
54
|
-
"np": "3",
|
|
55
|
-
"ut": "bd1d9ddb04089700cf9c27f6f7426281",
|
|
56
|
-
"fltt": "2",
|
|
57
|
-
"invt": "2",
|
|
58
|
-
"fid": "f3",
|
|
59
|
-
"fs": "m:0 t:6,m:0 t:80",
|
|
60
|
-
"fields": "f12",
|
|
61
|
-
"_": "1623833739532",
|
|
62
|
-
}
|
|
63
|
-
r = requests.get(url, params=params)
|
|
64
|
-
data_json = r.json()
|
|
65
|
-
if not data_json["data"]["diff"]:
|
|
66
|
-
return dict()
|
|
67
|
-
temp_df_sz = pd.DataFrame(data_json["data"]["diff"])
|
|
68
|
-
temp_df_sz["sz_id"] = 0
|
|
69
|
-
code_id_dict.update(dict(zip(temp_df_sz["f12"], temp_df_sz["sz_id"])))
|
|
70
|
-
params = {
|
|
71
|
-
"pn": "1",
|
|
72
|
-
"pz": "50000",
|
|
73
|
-
"po": "1",
|
|
74
|
-
"np": "3",
|
|
75
|
-
"ut": "bd1d9ddb04089700cf9c27f6f7426281",
|
|
76
|
-
"fltt": "2",
|
|
77
|
-
"invt": "2",
|
|
78
|
-
"fid": "f3",
|
|
79
|
-
"fs": "m:0 t:81 s:2048",
|
|
80
|
-
"fields": "f12",
|
|
81
|
-
"_": "1623833739532",
|
|
82
|
-
}
|
|
83
|
-
r = requests.get(url, params=params)
|
|
84
|
-
data_json = r.json()
|
|
85
|
-
if not data_json["data"]["diff"]:
|
|
86
|
-
return dict()
|
|
87
|
-
temp_df_sz = pd.DataFrame(data_json["data"]["diff"])
|
|
88
|
-
temp_df_sz["bj_id"] = 0
|
|
89
|
-
code_id_dict.update(dict(zip(temp_df_sz["f12"], temp_df_sz["bj_id"])))
|
|
90
|
-
return code_id_dict
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def stock_bid_ask_em(symbol: str = "000001") -> dict:
|
|
94
|
-
"""
|
|
95
|
-
东方财富-行情报价
|
|
96
|
-
https://quote.eastmoney.com/sz000001.html
|
|
97
|
-
:param symbol: 股票代码
|
|
98
|
-
:type symbol: str
|
|
99
|
-
:return: 行情报价
|
|
100
|
-
:rtype: pandas.DataFrame
|
|
101
|
-
"""
|
|
102
|
-
url = "https://push2.eastmoney.com/api/qt/stock/get"
|
|
103
|
-
code_id_map_em_dict = __code_id_map_em()
|
|
104
|
-
params = {
|
|
105
|
-
"fltt": "2",
|
|
106
|
-
"invt": "2",
|
|
107
|
-
"fields": "f43,f51,f52,f191,f120,f121,f122,f174,f175,f59,f163,f43,f57,f58,f169,f170,f46,f44,f51,f168,f47,f164,f116,f60,f45,f52,f50,f48,f167,f117,f71,f161,f49,f530,f135,f136,f137,f138,f139,f141,f142,f144,f145,f147,f148,f140,f143,f146,f149,f55,f62,f162,f92,f173,f104,f105,f84,f85,f183,f184,f185,f186,f187,f188,f189,f190,f191,f192,f107,f111,f86,f177,f78,f110,f262,f263,f264,f267,f268,f255,f256,f257,f258,f127,f199,f128,f198,f259,f260,f261,f171,f277,f278,f279,f288,f152,f250,f251,f252,f253,f254,f269,f270,f271,f272,f273,f274,f275,f276,f265,f266,f289,f290,f286,f285,f292,f293,f294,f295",
|
|
108
|
-
# "fields" :fields_02,
|
|
109
|
-
"secid": f"{code_id_map_em_dict[symbol]}.{symbol}",
|
|
110
|
-
}
|
|
111
|
-
r = requests.get(url, params=params)
|
|
112
|
-
data_json = r.json()
|
|
113
|
-
tick_dict = {
|
|
114
|
-
"now_price": data_json["data"]["f43"],
|
|
115
|
-
"dt_price": data_json["data"]["f52"],
|
|
116
|
-
"zt_price": data_json["data"]["f51"],
|
|
117
|
-
"wei_bi": data_json["data"]["f191"],
|
|
118
|
-
"sell_5": data_json["data"]["f31"],
|
|
119
|
-
"sell_5_vol": data_json["data"]["f32"] * 100,
|
|
120
|
-
"sell_4": data_json["data"]["f33"],
|
|
121
|
-
"sell_4_vol": data_json["data"]["f34"] * 100,
|
|
122
|
-
"sell_3": data_json["data"]["f35"],
|
|
123
|
-
"sell_3_vol": data_json["data"]["f36"] * 100,
|
|
124
|
-
"sell_2": data_json["data"]["f37"],
|
|
125
|
-
"sell_2_vol": data_json["data"]["f38"] * 100,
|
|
126
|
-
"sell_1": data_json["data"]["f39"],
|
|
127
|
-
"sell_1_vol": data_json["data"]["f40"] * 100,
|
|
128
|
-
"buy_1": data_json["data"]["f19"],
|
|
129
|
-
"buy_1_vol": data_json["data"]["f20"] * 100,
|
|
130
|
-
"buy_2": data_json["data"]["f17"],
|
|
131
|
-
"buy_2_vol": data_json["data"]["f18"] * 100,
|
|
132
|
-
"buy_3": data_json["data"]["f15"],
|
|
133
|
-
"buy_3_vol": data_json["data"]["f16"] * 100,
|
|
134
|
-
"buy_4": data_json["data"]["f13"],
|
|
135
|
-
"buy_4_vol": data_json["data"]["f14"] * 100,
|
|
136
|
-
"buy_5": data_json["data"]["f11"],
|
|
137
|
-
"buy_5_vol": data_json["data"]["f12"] * 100,
|
|
138
|
-
}
|
|
139
|
-
temp_df = pd.DataFrame(tick_dict, index=[1])
|
|
140
|
-
temp_df.reset_index(inplace=True)
|
|
141
|
-
temp_df.loc[temp_df['wei_bi'] == '-', 'wei_bi'] = 0
|
|
142
|
-
temp_df.loc[temp_df['sell_5'] == '-', 'sell_5_vol'] = 0
|
|
143
|
-
temp_df.loc[temp_df['sell_5'] == '-', 'sell_5'] = 0
|
|
144
|
-
temp_df.loc[temp_df['sell_4'] == '-', 'sell_4_vol'] = 0
|
|
145
|
-
temp_df.loc[temp_df['sell_4'] == '-', 'sell_4'] = 0
|
|
146
|
-
temp_df.loc[temp_df['sell_3'] == '-', 'sell_3_vol'] = 0
|
|
147
|
-
temp_df.loc[temp_df['sell_3'] == '-', 'sell_3'] = 0
|
|
148
|
-
temp_df.loc[temp_df['sell_2'] == '-', 'sell_2_vol'] = 0
|
|
149
|
-
temp_df.loc[temp_df['sell_2'] == '-', 'sell_2'] = 0
|
|
150
|
-
temp_df.loc[temp_df['sell_1'] == '-', 'sell_1_vol'] = 0
|
|
151
|
-
temp_df.loc[temp_df['sell_1'] == '-', 'sell_1'] = 0
|
|
152
|
-
temp_df.loc[temp_df['buy_1'] == '-', 'buy_1_vol'] = 0
|
|
153
|
-
temp_df.loc[temp_df['buy_1'] == '-', 'buy_1'] = 0
|
|
154
|
-
temp_df.loc[temp_df['buy_2'] == '-', 'buy_2_vol'] = 0
|
|
155
|
-
temp_df.loc[temp_df['buy_2'] == '-', 'buy_2'] = 0
|
|
156
|
-
temp_df.loc[temp_df['buy_3'] == '-', 'buy_3_vol'] = 0
|
|
157
|
-
temp_df.loc[temp_df['buy_3'] == '-', 'buy_3'] = 0
|
|
158
|
-
temp_df.loc[temp_df['buy_4'] == '-', 'buy_4_vol'] = 0
|
|
159
|
-
temp_df.loc[temp_df['buy_4'] == '-', 'buy_4'] = 0
|
|
160
|
-
temp_df.loc[temp_df['buy_5'] == '-', 'buy_5_vol'] = 0
|
|
161
|
-
temp_df.loc[temp_df['buy_5'] == '-', 'buy_5'] = 0
|
|
162
|
-
temp_df['symbol'] = symbol
|
|
163
|
-
return temp_df
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if __name__ == '__main__':
|
|
167
|
-
while True:
|
|
168
|
-
df = stock_bid_ask_em('301082')
|
|
169
|
-
print(df)
|
|
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
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/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.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/selection/kpl_selection_plate_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/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
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/company/ths_company_announce_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/company/ths_company_info_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/app/ths_concept_detail_app.py
RENAMED
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/app/ths_concept_index_app.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/ths_common_js_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/ths_company_info_web.py
RENAMED
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/ths_concept_detail_web.py
RENAMED
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/api/ths/concept/web/ths_concept_index_web.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/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
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/classify/symbol_classify_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/mns_common/component/classify/symbol_classify_param.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/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.4.5 → mns_common-1.3.4.6}/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.4.5 → mns_common-1.3.4.6}/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.4.5 → mns_common-1.3.4.6}/mns_common/component/k_line/patterns/pattern_Enum.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.4.5 → mns_common-1.3.4.6}/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.4.5 → mns_common-1.3.4.6}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|