mns-common 1.3.5.9__tar.gz → 1.3.6.2__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.5.9 → mns_common-1.3.6.2}/PKG-INFO +1 -1
- mns_common-1.3.6.2/mns_common/api/em/east_money_stock_api_v3.py +231 -0
- mns_common-1.3.6.2/mns_common/api/proxies/liu_guan_proxy_api.py +65 -0
- mns_common-1.3.6.2/mns_common/api/xueqiu/xue_qiu_k_line_api.py +70 -0
- mns_common-1.3.6.2/mns_common/db/v2/__init__.py +7 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common.egg-info/PKG-INFO +1 -1
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common.egg-info/SOURCES.txt +3 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/setup.py +1 -1
- mns_common-1.3.5.9/mns_common/api/xueqiu/xue_qiu_k_line_api.py +0 -88
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/README.md +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/akshare/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/akshare/k_line_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/akshare/stock_bid_ask_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/akshare/stock_dt_pool.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/akshare/stock_zb_pool.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/akshare/stock_zt_pool_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/akshare/yjyg_sync_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_debt_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_etf_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_stock_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_stock_gdfx_free_top_10_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_stock_hk_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_stock_quotes_sync_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_stock_us_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_stock_v2_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/em_concept_index_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/hk/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/hk/ths_hk_company_info_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/k_line/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/k_line/stock_k_line_data_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/k_line/stock_minute_data_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/common/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/common/kpl_common_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/common/kpl_common_field_constant.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/concept/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/concept/kpl_concept_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/constant/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/constant/kpl_constant.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/industry/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/industry/kpl_industry_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/selection/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/selection/kpl_selection_plate_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/symbol/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/symbol/kpl_symbol_common_field_constant.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/symbol/symbol_his_quotes_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/msg/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/msg/push_msg_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/api/qmt → mns_common-1.3.6.2/mns_common/api/proxies}/__init__.py +0 -0
- {mns_common-1.3.5.9/mns_common/api/ths/company → mns_common-1.3.6.2/mns_common/api/qmt}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/qmt/qmt_minunte_tick_data.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/big_deal/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/big_deal/ths_big_deal_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/api/us → mns_common-1.3.6.2/mns_common/api/ths/company}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/company/ths_company_announce_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/company/ths_company_info_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/app/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/app/ths_concept_detail_app.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/app/ths_concept_index_app.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/ths_common_js_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/ths_company_info_web.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/ths_concept_detail_web.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/ths_concept_index_web.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/self_choose/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/self_choose/ths_self_choose_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/wen_cai/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/wen_cai/ths_wen_cai_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/zt/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/zt/ths_stock_zt_pool_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/api/xueqiu → mns_common-1.3.6.2/mns_common/api/us}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/us/ths_us_company_info_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/classify → mns_common-1.3.6.2/mns_common/api/xueqiu}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/cache/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/cache/cache_service.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/cookie → mns_common-1.3.6.2/mns_common/component/classify}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/classify/symbol_classify_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/classify/symbol_classify_param.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/common_service_fun_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/company/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/company/company_common_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/company/company_common_service_new_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/concept/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/concept/kpl_concept_common_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/concept/ths_concept_common_service_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/deal → mns_common-1.3.6.2/mns_common/component/cookie}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/cookie/cookie_info_service.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/data/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/data/data_init_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/hk → mns_common-1.3.6.2/mns_common/component/deal}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/deal/deal_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/deal/terminal_enum.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/price → mns_common-1.3.6.2/mns_common/component/hk}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/hk/company_hk_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/industry/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/industry/ths_industry_index_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/clean/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/clean/k_line_param.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/clean/sh_small_normal_zt_k_line_check_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/common/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/common/k_line_common_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/patterns/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/patterns/k_line_patterns_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/patterns/pattern_Enum.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/qmt → mns_common-1.3.6.2/mns_common/component/price}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/price/trade_price_service_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/redis_msg → mns_common-1.3.6.2/mns_common/component/qmt}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/qmt/qmt_buy_service.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/real_time/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/real_time/real_time_common_service_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/self_choose → mns_common-1.3.6.2/mns_common/component/redis_msg}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/redis_msg/redis_msg_publish_service.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/task → mns_common-1.3.6.2/mns_common/component/self_choose}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/self_choose/black_list_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/self_choose/self_choose_service_api.py +0 -0
- {mns_common-1.3.5.9/mns_common/component/tfp → mns_common-1.3.6.2/mns_common/component/task}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/task/real_time_data_sync_check.py +0 -0
- {mns_common-1.3.5.9/mns_common/db/v2 → mns_common-1.3.6.2/mns_common/component/tfp}/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/tfp/stock_tfp_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/trade_date/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/trade_date/trade_date_common_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/zt/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/zt/zt_common_service_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/constant/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/constant/black_list_classify_enum.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/constant/db_name_constant.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/constant/east_money_stock_api.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/constant/extra_income_db_name.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/constant/price_enum.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/constant/redis_msg_constant.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/constant/self_choose_constant.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/db/MongodbUtil.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/db/MongodbUtilLocal.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/db/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/db/v2/MongodbUtilV2.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/utils/__init__.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/utils/async_fun.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/utils/cmd_util.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/utils/data_frame_util.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/utils/date_handle_util.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/utils/db_util.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/utils/file_util.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/utils/ip_util.py +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common.egg-info/dependency_links.txt +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common.egg-info/top_level.txt +0 -0
- {mns_common-1.3.5.9 → mns_common-1.3.6.2}/setup.cfg +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
file_path = os.path.abspath(__file__)
|
|
5
|
+
end = file_path.index('mns') + 16
|
|
6
|
+
project_path = file_path[0:end]
|
|
7
|
+
sys.path.append(project_path)
|
|
8
|
+
|
|
9
|
+
import requests
|
|
10
|
+
import json
|
|
11
|
+
import pandas as pd
|
|
12
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
13
|
+
import datetime
|
|
14
|
+
from loguru import logger
|
|
15
|
+
|
|
16
|
+
# 最大返回条数
|
|
17
|
+
max_number = 5800
|
|
18
|
+
# 最小返回条数
|
|
19
|
+
min_number = 5600
|
|
20
|
+
# 分页条数
|
|
21
|
+
page_number = 100
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def get_stock_page_data(pn, fields, fs, proxies):
|
|
25
|
+
"""
|
|
26
|
+
获取单页股票数据
|
|
27
|
+
"""
|
|
28
|
+
# 获取当前日期和时间
|
|
29
|
+
current_time = datetime.datetime.now()
|
|
30
|
+
|
|
31
|
+
# 将当前时间转换为时间戳(以毫秒为单位)
|
|
32
|
+
current_timestamp_ms = int(current_time.timestamp() * 1000)
|
|
33
|
+
|
|
34
|
+
url = "https://13.push2.eastmoney.com/api/qt/clist/get"
|
|
35
|
+
params = {
|
|
36
|
+
"cb": "jQuery1124046660442520420653_" + str(current_timestamp_ms),
|
|
37
|
+
"pn": str(pn),
|
|
38
|
+
"pz": "10000", # 每页最大200条
|
|
39
|
+
"po": "0",
|
|
40
|
+
"np": "3",
|
|
41
|
+
"ut": "bd1d9ddb04089700cf9c27f6f7426281",
|
|
42
|
+
"fltt": "2",
|
|
43
|
+
"invt": "2",
|
|
44
|
+
"wbp2u": "|0|0|0|web",
|
|
45
|
+
"fid": "f12",
|
|
46
|
+
"fs": fs,
|
|
47
|
+
"fields": fields,
|
|
48
|
+
"_": current_timestamp_ms
|
|
49
|
+
}
|
|
50
|
+
try:
|
|
51
|
+
r = requests.get(url, params, proxies=proxies)
|
|
52
|
+
data_text = r.text
|
|
53
|
+
if pn == 1:
|
|
54
|
+
try:
|
|
55
|
+
begin_index_total = data_text.index('"total":')
|
|
56
|
+
|
|
57
|
+
end_index_total = data_text.index('"diff"')
|
|
58
|
+
global max_number
|
|
59
|
+
max_number = int(data_text[begin_index_total + 8:end_index_total - 1])
|
|
60
|
+
except Exception as e:
|
|
61
|
+
logger.error(f"获取第{pn}页股票列表异常: {e}")
|
|
62
|
+
return pd.DataFrame()
|
|
63
|
+
|
|
64
|
+
begin_index = data_text.index('[')
|
|
65
|
+
end_index = data_text.index(']')
|
|
66
|
+
data_json = data_text[begin_index:end_index + 1]
|
|
67
|
+
data_json = json.loads(data_json)
|
|
68
|
+
if data_json is None:
|
|
69
|
+
return pd.DataFrame()
|
|
70
|
+
else:
|
|
71
|
+
return pd.DataFrame(data_json)
|
|
72
|
+
except Exception as e:
|
|
73
|
+
logger.error(f"获取第{pn}页股票列表异常: {e}")
|
|
74
|
+
return pd.DataFrame()
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def all_stock_ticker_data_new(fields, fs, proxies) -> pd.DataFrame:
|
|
78
|
+
"""
|
|
79
|
+
使用多线程获取所有股票数据
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
per_page = page_number
|
|
83
|
+
total_pages = (max_number + per_page - 1) // per_page # 向上取整
|
|
84
|
+
|
|
85
|
+
# 创建线程池
|
|
86
|
+
with ThreadPoolExecutor(max_workers=10) as executor:
|
|
87
|
+
# 提交任务,获取每页数据
|
|
88
|
+
futures = [executor.submit(get_stock_page_data, pn, fields, fs, proxies)
|
|
89
|
+
for pn in range(1, total_pages + 1)]
|
|
90
|
+
|
|
91
|
+
# 收集结果
|
|
92
|
+
results = []
|
|
93
|
+
for future in futures:
|
|
94
|
+
result = future.result()
|
|
95
|
+
if not result.empty:
|
|
96
|
+
results.append(result)
|
|
97
|
+
|
|
98
|
+
# 合并所有页面的数据
|
|
99
|
+
if results:
|
|
100
|
+
return pd.concat(results, ignore_index=True)
|
|
101
|
+
else:
|
|
102
|
+
return pd.DataFrame()
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def get_real_time_quotes_all_stocks(proxies):
|
|
106
|
+
fields = ("f352,f2,f3,f5,f6,f8,f10,f11,f22,f12,f14,f15,f16,f17,"
|
|
107
|
+
"f18,f20,f21,f26,f33,f34,f35,f62,f66,f69,f72,f100,f184,f211,f212"),
|
|
108
|
+
fs = "m:0 t:6,m:0 t:80,m:1 t:2,m:1 t:23,m:0 t:81 s:2048"
|
|
109
|
+
# 获取第一页数据
|
|
110
|
+
page_one_df = get_stock_page_data(1, fields, fs, proxies)
|
|
111
|
+
# 数据接口正常返回5600以上的数量
|
|
112
|
+
if page_one_df.shape[0] > min_number:
|
|
113
|
+
page_one_df = rename_real_time_quotes_df(page_one_df)
|
|
114
|
+
page_one_df.drop_duplicates('symbol', keep='last', inplace=True)
|
|
115
|
+
return page_one_df
|
|
116
|
+
else:
|
|
117
|
+
page_df = all_stock_ticker_data_new(fields, fs, proxies)
|
|
118
|
+
page_df = rename_real_time_quotes_df(page_df)
|
|
119
|
+
page_df.drop_duplicates('symbol', keep='last', inplace=True)
|
|
120
|
+
return page_df
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
# 获取所有股票实时行情数据 f33,委比
|
|
124
|
+
def rename_real_time_quotes_df(temp_df):
|
|
125
|
+
temp_df = temp_df.rename(columns={
|
|
126
|
+
"f2": "now_price",
|
|
127
|
+
"f3": "chg",
|
|
128
|
+
"f5": "volume",
|
|
129
|
+
"f6": "amount",
|
|
130
|
+
"f8": "exchange",
|
|
131
|
+
"f10": "quantity_ratio",
|
|
132
|
+
"f22": "up_speed",
|
|
133
|
+
"f11": "up_speed_05",
|
|
134
|
+
"f12": "symbol",
|
|
135
|
+
"f14": "name",
|
|
136
|
+
"f15": "high",
|
|
137
|
+
"f16": "low",
|
|
138
|
+
"f17": "open",
|
|
139
|
+
"f18": "yesterday_price",
|
|
140
|
+
"f20": "total_mv",
|
|
141
|
+
"f21": "flow_mv",
|
|
142
|
+
"f26": "list_date",
|
|
143
|
+
"f33": "wei_bi",
|
|
144
|
+
"f34": "outer_disk",
|
|
145
|
+
"f35": "inner_disk",
|
|
146
|
+
"f62": "today_main_net_inflow",
|
|
147
|
+
"f66": "super_large_order_net_inflow",
|
|
148
|
+
"f69": "super_large_order_net_inflow_ratio",
|
|
149
|
+
"f72": "large_order_net_inflow",
|
|
150
|
+
# "f78": "medium_order_net_inflow",
|
|
151
|
+
# "f84": "small_order_net_inflow",
|
|
152
|
+
"f100": "industry",
|
|
153
|
+
# "f103": "concept",
|
|
154
|
+
"f184": "today_main_net_inflow_ratio",
|
|
155
|
+
"f352": "average_price",
|
|
156
|
+
"f211": "buy_1_num",
|
|
157
|
+
"f212": "sell_1_num"
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
temp_df.loc[temp_df['buy_1_num'] == '-', 'buy_1_num'] = 0
|
|
161
|
+
temp_df.loc[temp_df['sell_1_num'] == '-', 'sell_1_num'] = 0
|
|
162
|
+
temp_df.loc[temp_df['up_speed_05'] == '-', 'up_speed_05'] = 0
|
|
163
|
+
temp_df.loc[temp_df['up_speed'] == '-', 'up_speed'] = 0
|
|
164
|
+
temp_df.loc[temp_df['average_price'] == '-', 'average_price'] = 0
|
|
165
|
+
temp_df.loc[temp_df['wei_bi'] == '-', 'wei_bi'] = 0
|
|
166
|
+
temp_df.loc[temp_df['yesterday_price'] == '-', 'yesterday_price'] = 0
|
|
167
|
+
temp_df.loc[temp_df['now_price'] == '-', 'now_price'] = 0
|
|
168
|
+
temp_df.loc[temp_df['chg'] == '-', 'chg'] = 0
|
|
169
|
+
temp_df.loc[temp_df['volume'] == '-', 'volume'] = 0
|
|
170
|
+
temp_df.loc[temp_df['amount'] == '-', 'amount'] = 0
|
|
171
|
+
temp_df.loc[temp_df['exchange'] == '-', 'exchange'] = 0
|
|
172
|
+
temp_df.loc[temp_df['quantity_ratio'] == '-', 'quantity_ratio'] = 0
|
|
173
|
+
temp_df.loc[temp_df['high'] == '-', 'high'] = 0
|
|
174
|
+
temp_df.loc[temp_df['low'] == '-', 'low'] = 0
|
|
175
|
+
temp_df.loc[temp_df['open'] == '-', 'open'] = 0
|
|
176
|
+
temp_df.loc[temp_df['total_mv'] == '-', 'total_mv'] = 0
|
|
177
|
+
temp_df.loc[temp_df['flow_mv'] == '-', 'flow_mv'] = 0
|
|
178
|
+
temp_df.loc[temp_df['inner_disk'] == '-', 'inner_disk'] = 0
|
|
179
|
+
temp_df.loc[temp_df['outer_disk'] == '-', 'outer_disk'] = 0
|
|
180
|
+
temp_df.loc[temp_df['today_main_net_inflow_ratio'] == '-', 'today_main_net_inflow_ratio'] = 0
|
|
181
|
+
temp_df.loc[temp_df['today_main_net_inflow'] == '-', 'today_main_net_inflow'] = 0
|
|
182
|
+
temp_df.loc[temp_df['super_large_order_net_inflow'] == '-', 'super_large_order_net_inflow'] = 0
|
|
183
|
+
temp_df.loc[temp_df['super_large_order_net_inflow_ratio'] == '-', 'super_large_order_net_inflow_ratio'] = 0
|
|
184
|
+
temp_df.loc[temp_df['large_order_net_inflow'] == '-', 'large_order_net_inflow'] = 0
|
|
185
|
+
# temp_df.loc[temp_df['medium_order_net_inflow'] == '-', 'medium_order_net_inflow'] = 0
|
|
186
|
+
# temp_df.loc[temp_df['small_order_net_inflow'] == '-', 'small_order_net_inflow'] = 0
|
|
187
|
+
|
|
188
|
+
temp_df["list_date"] = pd.to_numeric(temp_df["list_date"], errors="coerce")
|
|
189
|
+
temp_df["wei_bi"] = pd.to_numeric(temp_df["wei_bi"], errors="coerce")
|
|
190
|
+
temp_df["average_price"] = pd.to_numeric(temp_df["average_price"], errors="coerce")
|
|
191
|
+
temp_df["yesterday_price"] = pd.to_numeric(temp_df["yesterday_price"], errors="coerce")
|
|
192
|
+
temp_df["now_price"] = pd.to_numeric(temp_df["now_price"], errors="coerce")
|
|
193
|
+
temp_df["chg"] = pd.to_numeric(temp_df["chg"], errors="coerce")
|
|
194
|
+
temp_df["volume"] = pd.to_numeric(temp_df["volume"], errors="coerce")
|
|
195
|
+
temp_df["amount"] = pd.to_numeric(temp_df["amount"], errors="coerce")
|
|
196
|
+
temp_df["exchange"] = pd.to_numeric(temp_df["exchange"], errors="coerce")
|
|
197
|
+
temp_df["quantity_ratio"] = pd.to_numeric(temp_df["quantity_ratio"], errors="coerce")
|
|
198
|
+
temp_df["high"] = pd.to_numeric(temp_df["high"], errors="coerce")
|
|
199
|
+
temp_df["low"] = pd.to_numeric(temp_df["low"], errors="coerce")
|
|
200
|
+
temp_df["open"] = pd.to_numeric(temp_df["open"], errors="coerce")
|
|
201
|
+
temp_df["total_mv"] = pd.to_numeric(temp_df["total_mv"], errors="coerce")
|
|
202
|
+
temp_df["flow_mv"] = pd.to_numeric(temp_df["flow_mv"], errors="coerce")
|
|
203
|
+
temp_df["outer_disk"] = pd.to_numeric(temp_df["outer_disk"], errors="coerce")
|
|
204
|
+
temp_df["inner_disk"] = pd.to_numeric(temp_df["inner_disk"], errors="coerce")
|
|
205
|
+
temp_df["today_main_net_inflow"] = pd.to_numeric(temp_df["today_main_net_inflow"], errors="coerce")
|
|
206
|
+
temp_df["super_large_order_net_inflow"] = pd.to_numeric(temp_df["super_large_order_net_inflow"],
|
|
207
|
+
errors="coerce")
|
|
208
|
+
temp_df["super_large_order_net_inflow_ratio"] = pd.to_numeric(temp_df["super_large_order_net_inflow_ratio"],
|
|
209
|
+
errors="coerce")
|
|
210
|
+
temp_df["large_order_net_inflow"] = pd.to_numeric(temp_df["large_order_net_inflow"],
|
|
211
|
+
errors="coerce")
|
|
212
|
+
# temp_df["medium_order_net_inflow"] = pd.to_numeric(temp_df["medium_order_net_inflow"],
|
|
213
|
+
# errors="coerce")
|
|
214
|
+
# temp_df["small_order_net_inflow"] = pd.to_numeric(temp_df["small_order_net_inflow"], errors="coerce")
|
|
215
|
+
|
|
216
|
+
# 大单比例
|
|
217
|
+
temp_df['large_order_net_inflow_ratio'] = round((temp_df['large_order_net_inflow'] / temp_df['amount']) * 100, 2)
|
|
218
|
+
|
|
219
|
+
# 外盘是内盘倍数
|
|
220
|
+
temp_df['disk_ratio'] = round((temp_df['outer_disk'] - temp_df['inner_disk']) / temp_df['inner_disk'], 2)
|
|
221
|
+
# 只有外盘没有内盘
|
|
222
|
+
temp_df.loc[temp_df["inner_disk"] == 0, ['disk_ratio']] = 1688
|
|
223
|
+
temp_df = temp_df.sort_values(by=['chg'], ascending=False)
|
|
224
|
+
return temp_df
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
# 示例调用
|
|
228
|
+
if __name__ == "__main__":
|
|
229
|
+
while True:
|
|
230
|
+
df = get_real_time_quotes_all_stocks()
|
|
231
|
+
logger.info("涨停数据,{}", 1)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
file_path = os.path.abspath(__file__)
|
|
5
|
+
end = file_path.index('mns') + 16
|
|
6
|
+
project_path = file_path[0:end]
|
|
7
|
+
sys.path.append(project_path)
|
|
8
|
+
from loguru import logger
|
|
9
|
+
import requests
|
|
10
|
+
import time
|
|
11
|
+
import hashlib
|
|
12
|
+
import json
|
|
13
|
+
|
|
14
|
+
# 提取订单
|
|
15
|
+
"""
|
|
16
|
+
orderId:提取订单号
|
|
17
|
+
secret:用户密钥
|
|
18
|
+
num:提取IP个数
|
|
19
|
+
pid:省份
|
|
20
|
+
cid:城市
|
|
21
|
+
type:请求类型,1=http/https,2=socks5
|
|
22
|
+
unbindTime:使用时长,秒/s为单位
|
|
23
|
+
noDuplicate:去重,0=不去重,1=去重
|
|
24
|
+
lineSeparator:分隔符
|
|
25
|
+
singleIp:切换,0=切换,1=不切换
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_proxy_api(order_id, secret, unbind_time):
|
|
30
|
+
num = "1"
|
|
31
|
+
pid = "-1"
|
|
32
|
+
cid = ""
|
|
33
|
+
noDuplicate = "0"
|
|
34
|
+
lineSeparator = "0"
|
|
35
|
+
singleIp = "0"
|
|
36
|
+
time_str = str(int(time.time())) # 时间戳
|
|
37
|
+
|
|
38
|
+
# 计算sign
|
|
39
|
+
txt = "orderId=" + order_id + "&" + "secret=" + secret + "&" + "time=" + time_str
|
|
40
|
+
sign = hashlib.md5(txt.encode()).hexdigest()
|
|
41
|
+
# 访问URL获取IP
|
|
42
|
+
url = (
|
|
43
|
+
"http://api.hailiangip.com:8422/api/getIp?type=1" + "&num=" + num + "&pid=" + pid
|
|
44
|
+
+ "&unbindTime=" + unbind_time + "&cid=" + cid
|
|
45
|
+
+ "&orderId=" + order_id + "&time=" + time_str + "&sign=" + sign + "&dataType=0"
|
|
46
|
+
+ "&lineSeparator=" + lineSeparator + "&noDuplicate=" + noDuplicate + "&singleIp=" + singleIp)
|
|
47
|
+
my_response = requests.get(url).content
|
|
48
|
+
js_res = json.loads(my_response)
|
|
49
|
+
for dic in js_res["data"]:
|
|
50
|
+
try:
|
|
51
|
+
ip = dic["ip"]
|
|
52
|
+
port = dic["port"]
|
|
53
|
+
ip_port = ip + ":" + str(port)
|
|
54
|
+
return ip_port
|
|
55
|
+
except BaseException as e:
|
|
56
|
+
logger.error("获取ip地址异常:{}", e)
|
|
57
|
+
return None
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if __name__ == '__main__':
|
|
61
|
+
order_id = ''
|
|
62
|
+
secret = ''
|
|
63
|
+
unbind_time = str(60 * 10)
|
|
64
|
+
ip = get_proxy_api(order_id, secret, unbind_time)
|
|
65
|
+
print(ip)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
file_path = os.path.abspath(__file__)
|
|
5
|
+
end = file_path.index('mns') + 16
|
|
6
|
+
project_path = file_path[0:end]
|
|
7
|
+
sys.path.append(project_path)
|
|
8
|
+
from loguru import logger
|
|
9
|
+
import requests
|
|
10
|
+
import pandas as pd
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# year 年
|
|
14
|
+
# quarter 季度
|
|
15
|
+
# month 月度
|
|
16
|
+
# week 周
|
|
17
|
+
# day 日
|
|
18
|
+
def get_xue_qiu_k_line(symbol, period):
|
|
19
|
+
url = "https://stock.xueqiu.com/v5/stock/chart/kline.json"
|
|
20
|
+
|
|
21
|
+
params = {
|
|
22
|
+
"symbol": symbol,
|
|
23
|
+
"begin": "1742574377493",
|
|
24
|
+
"period": period,
|
|
25
|
+
"type": "before",
|
|
26
|
+
"count": "-120084",
|
|
27
|
+
"indicator": "kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
headers = {
|
|
31
|
+
"accept": "application/json, text/plain, */*",
|
|
32
|
+
"accept-language": "zh-CN,zh;q=0.9",
|
|
33
|
+
"origin": "https://xueqiu.com",
|
|
34
|
+
"priority": "u=1, i",
|
|
35
|
+
"referer": "https://xueqiu.com/S/SZ300879?md5__1038=n4%2BxgDniDQeWqxYwq0y%2BbDyG%2BYDtODuD7q%2BqRYID",
|
|
36
|
+
"sec-ch-ua": '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"',
|
|
37
|
+
"sec-ch-ua-mobile": "?0",
|
|
38
|
+
"sec-ch-ua-platform": '"Windows"',
|
|
39
|
+
"sec-fetch-dest": "empty",
|
|
40
|
+
"sec-fetch-mode": "cors",
|
|
41
|
+
"sec-fetch-site": "same-site",
|
|
42
|
+
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
|
|
43
|
+
"cookie": "cookiesu=401743509129481; device_id=e7bd664c2ad4091241066c3a2ddbd736; remember=1; xq_is_login=1; u=9627701445; xq_a_token=4d1dc50464f7995ed9da20125e94fc77df0605d4; xqat=4d1dc50464f7995ed9da20125e94fc77df0605d4; xq_id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1aWQiOjk2Mjc3MDE0NDUsImlzcyI6InVjIiwiZXhwIjoxNzQ2NjM0MzExLCJjdG0iOjE3NDQwNDIzMTE3OTIsImNpZCI6ImQ5ZDBuNEFadXAifQ.ehhu6ZGP8bXmIO4rB_UDPgCg7P996ExBcXkeuVRMTmswc_ZIRntQ04sv0nRoW7r6dBU10BIEFQmA3bvZO7kYuDKBVrCR86KBzDC5_3X6dTtHgb-Yr405r5ts-aQo0eYlDp4DMigJsfp6deH-058sKQlIIQajTjK4OI-0RZBNVPx6jhQcNHAJCpHNmUc613EnYTMOs9DUADOY63KIbf9VOz6fQyNd5bnyAkU0ubsoVMWu5_cFx14UUgq5BipMzG9zsjbWcXjqp2VsGQ42sJ9x-L_uqLaWdpcz5K8JqNTkvV6ADbsG3yOlzp4kdS-1WBVEYjj4vZv7UWe8eB6Aaf4Uyg; xq_r_token=cfb922056d8dd2e5212255f2fb0958cd6d98b416; Hm_lvt_1db88642e346389874251b5a1eded6e3=1744115609,1744116531,1744123698,1744128314; HMACCOUNT=1CFFE969351DFC92; is_overseas=0; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1744131160; ssxmod_itna=QqAx0DRGiQdbei7ditG8DI6KGRQrD2jDl4BttiGgDYq7=GFiDCOizO1CxBKA6Kd3Dj22AxWRxGXPmDA5Dnzx7YDt=SPxDB7YHi1KjnG+beSAj7e4qOaUehb3qQGnYFmEat0USSVYmkeDHxi8DB9DYG9FDenWDCeDQxirDD4DAQPDFxibDimI34DdTIOvstOwCDGrDlKDRx07CC3DWxDFTU0HKQgj48ExDGvxqk04rhP4DmRmC37LCl3Dn=Dv=QoD9p4DsOh9M4DCky6x+Roc=mQb=USfDCKDjoLIe/fQFbfv3IQ8e7vskhDjQ4dGvPGP3CGxeeViDRWQ1ei4Aqn7xdGPdQmqKmVjptt4DDcDo2Ky4xF0KHvM+ymIHZKhDrDxwOzFDbGYbYx7QGH9OUiTtBho5iq4+Pnri9Yie+ewo+DYPeD; ssxmod_itna2=QqAx0DRGiQdbei7ditG8DI6KGRQrD2jDl4BttiGgDYq7=GFiDCOizO1CxBKA6Kd3Dj22AxWKxDfCecxD5qDFrv4A=iDGX5is6Y7iAYQig8n7YGzGl9xrojBSddLV8xkjxkone8iq0Ejc4Mp9dBZRzPA9deDpPqmaGYSyOCPcDFDghi=DFWRBDNbo1/a9OqenaQKqsemSFI9SHF/AfvOhsQKP4=c8UGgBad0AE/2Owk9MOs/71ihBwzgQRHPZROZgINUiWdQZxbp1frOOL8c=AO6yjHaiGk+O7XUoF4UcHo+0HaKzTSG9yWDxwEiihkhxtkizH4ttfkd3xGrGSB3MrTqB=pOkhwdx+CYmb8l+0xxKbbYWsYfa88ajgN3l=Crtd8T0eijCG=AGk8+LnWqWt6O+wL3ZOoto5rr5xQksExto71TEISWtk+jE3P0WF7NW0DNS+7pD8pL8dEx2sGRb=riia3v=kopew0Du6UYY5l0=HjdFi5zEUn1DwBUdiDD"
|
|
44
|
+
}
|
|
45
|
+
try:
|
|
46
|
+
response = requests.get(
|
|
47
|
+
url=url,
|
|
48
|
+
params=params,
|
|
49
|
+
headers=headers
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
if response.status_code == 200:
|
|
53
|
+
response_data = response.json()
|
|
54
|
+
df = pd.DataFrame(
|
|
55
|
+
data=response_data['data']['item'],
|
|
56
|
+
columns=response_data['data']['column']
|
|
57
|
+
)
|
|
58
|
+
# 处理DataFrame列(秒级时间戳)
|
|
59
|
+
df['str_day'] = pd.to_datetime(df['timestamp'], unit='ms').dt.normalize()
|
|
60
|
+
df["str_day"] = df["str_day"].dt.strftime("%Y-%m-%d")
|
|
61
|
+
return df
|
|
62
|
+
else:
|
|
63
|
+
return pd.DataFrame()
|
|
64
|
+
except BaseException as e:
|
|
65
|
+
logger.error("同步股票年度数据出现异常:{},{}", symbol, e)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
if __name__ == '__main__':
|
|
69
|
+
test_df = get_xue_qiu_k_line('SZ000001', 'year')
|
|
70
|
+
print(test_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_v3.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_quotes_sync_api.py
|
|
@@ -46,6 +47,8 @@ mns_common/api/kpl/symbol/kpl_symbol_common_field_constant.py
|
|
|
46
47
|
mns_common/api/kpl/symbol/symbol_his_quotes_api.py
|
|
47
48
|
mns_common/api/msg/__init__.py
|
|
48
49
|
mns_common/api/msg/push_msg_api.py
|
|
50
|
+
mns_common/api/proxies/__init__.py
|
|
51
|
+
mns_common/api/proxies/liu_guan_proxy_api.py
|
|
49
52
|
mns_common/api/qmt/__init__.py
|
|
50
53
|
mns_common/api/qmt/qmt_minunte_tick_data.py
|
|
51
54
|
mns_common/api/ths/__init__.py
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
file_path = os.path.abspath(__file__)
|
|
5
|
-
end = file_path.index('mns') + 16
|
|
6
|
-
project_path = file_path[0:end]
|
|
7
|
-
sys.path.append(project_path)
|
|
8
|
-
from loguru import logger
|
|
9
|
-
import requests
|
|
10
|
-
import pandas as pd
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# year 年
|
|
14
|
-
# quarter 季度
|
|
15
|
-
# month 月度
|
|
16
|
-
# week 周
|
|
17
|
-
# day 日
|
|
18
|
-
def get_xue_qiu_k_line(symbol, period):
|
|
19
|
-
url = "https://stock.xueqiu.com/v5/stock/chart/kline.json"
|
|
20
|
-
|
|
21
|
-
params = {
|
|
22
|
-
"symbol": symbol,
|
|
23
|
-
"begin": "1742574377493",
|
|
24
|
-
"period": period,
|
|
25
|
-
"type": "before",
|
|
26
|
-
"count": "-120084",
|
|
27
|
-
"indicator": "kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
headers = {
|
|
31
|
-
"accept": "application/json, text/plain, */*",
|
|
32
|
-
"accept-language": "zh-CN,zh;q=0.9",
|
|
33
|
-
"origin": "https://xueqiu.com",
|
|
34
|
-
"priority": "u=1, i",
|
|
35
|
-
"referer": "https://xueqiu.com/S/SZ300879?md5__1038=n4%2BxgDniDQeWqxYwq0y%2BbDyG%2BYDtODuD7q%2BqRYID",
|
|
36
|
-
"sec-ch-ua": '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"',
|
|
37
|
-
"sec-ch-ua-mobile": "?0",
|
|
38
|
-
"sec-ch-ua-platform": '"Windows"',
|
|
39
|
-
"sec-fetch-dest": "empty",
|
|
40
|
-
"sec-fetch-mode": "cors",
|
|
41
|
-
"sec-fetch-site": "same-site",
|
|
42
|
-
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
|
|
43
|
-
"cookie": "xq_a_token=cc9943aa6d41f0ae420f49b428f2f90a472b070a;"
|
|
44
|
-
" xqat=cc9943aa6d41f0ae420f49b428f2f90a472b070a; "
|
|
45
|
-
"xq_r_token=20869bd02083b2ef75d4d4b7654f827f00fdcd22;"
|
|
46
|
-
" xq_id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1aWQiOi0xLCJpc3MiOiJ1YyIsImV4cCI6MTc0NDc2NTA3MCwiY3RtIjoxNzQyNDg4OD"
|
|
47
|
-
"kyNDc1LCJjaWQiOiJkOWQwbjRBWnVwIn0.Ep9IIWPMwb85xYIJ_pmYTDmUmcySD4t5nv4LpYSqdLJzNzqgvzGFx6vowXm-ZtyePuppJxd2YjJDREHu7OkvZk"
|
|
48
|
-
"qHRGMGQOhuCDzyMQjpND2yTgyOTNkn2hNs0e5p4FihaSeRmLu8vQDU17No3LjM3y4-0caZ-8LNJnOm0Wet1uOD7h9ASf7sLRQCjGyB-Pd4D2r-213umj7c6TD"
|
|
49
|
-
"V5ud3rfTsUlCG7DwWMAdIZGkew5CX2WRXOz-G2Duf3d4GMRggiaLHVsP6PSTzOGUQBF1zAg5hprkxK3J_dV1SdiuaAZxJDp3FCFQ5vG0JkcOs9CLB5z-92kQ2-"
|
|
50
|
-
"YEhAkd3PCpGKQ; cookiesu=251742488951389; u=251742488951389; is_overseas=0; Hm_lvt_1db88642e346389874251b5a1eded6e3=1742488952; "
|
|
51
|
-
"Hm_lpvt_1db88642e346389874251b5a1eded6e3=1742488952; HMACCOUNT=A216813C8A2D1B76; device_id=e7bd664c2ad4091241066c3a2ddbd736; "
|
|
52
|
-
"ssxmod_itna=eqIxgDB7q+0=ei7qqAKG7D8D9DQqqiIqGHDyxW9P0CGDLxn4GQDUiHxttBmPvc7EkqE5gD0yG3wDA5Dnzx7YDt=SpND0mTAc3qACQIwPw+Ocyrm2tfA"
|
|
53
|
-
"br4MWHlPP5jokUkpQw5xB3DExGkeeu77xiirx0rD0eDPxDYDGbWD7PDoxDrF8YDjl7pOUgwoz4DKx0kDY5Dw1RADiPD7ZBDkOcwXSvmFxDzFZLaqle42Di3N+EsEzRfDi5"
|
|
54
|
-
"x79cwD7v3DlaPFsdD0119FgoIiya2PpBEv40OD0ILF4BfuYoA8872wprrZQ4F2G0YjEDQ0DO03e7qSh5tY7t0sOGe2GDNQKc3xeY5ldw7xDipwGg2QIhxjhrCtccU5ZUB="
|
|
55
|
-
"+VcwwiGxCeBGPyew=jp=lDqQ4ZAqzBqPj0=jh1Fxq7De903iYLYD; ssxmod_itna2=eqIxgDB7q+0=ei7qqAKG7D8D9DQqqiIqGHDyxW9P0CGDLxn4GQDUiHxttBmPvc7E"
|
|
56
|
-
"kqE5wDDcA73imLDD7Djbb5NZaEoD/zpofwEa9m=Fn7T5jOiFKWsbAb9Qi=utFFLry0Ii9=+TINLqBPqzemrFP/ehSZRDixpiEh5WeA5WXGvaHoKw+rEINZbPjOApkpEQG8cm="
|
|
57
|
-
"rHCN=0DUoI+HxcF6Zohnh3hUEcTYQykDVyXyfHsX9eFZAlAHxdWq/5qZ=Eh0KCAV2xA2/yKFtivK+DzQb0sajPwql5xkzLh966v0g6MzzUlc4SFYAv3YKBjP7rhhOdqmKEa"
|
|
58
|
-
"j6C6PKp+Pq2QEP6heBX7BU7iG=GGLA6IrDjYvHCDh1tr93XpUr9X9rPjYUvWxPI0RBwHUpC+fs6xsg07+ifjd9gU26do2K0lLwRhhPfppAKj5+gow2IN3KLQ0K1P/mY9BKKYAt"
|
|
59
|
-
"2Qx/34rb5evohIrUI=DKe1djnDvrDnjwcBbgK2lzA3eQVix=46cxf77D9GKug6PLBL0Fi67Htrl2K5CP9PQDHb1Yjx0ttRKjCU7hE3GIs2Y88AdxfF+Iuc2=IenBfqW52ngad82Y"
|
|
60
|
-
"8KvKqn5xEiODXgYCKgGxyOjl4+v9bvIm120i2pN6o6dBRZqxpvsA4S9YP2TPjS+1/4ZnVeYQ+4=UCevs5P3Qf2x6w8s=U7dD=cvG1skhxiD8Kjl32RGPC=4FDHIrQQoKGnixsWzp"
|
|
61
|
-
"Fb7F=PlrD/3=0F6DNx2hDnr4RDW7WGYSiPQFihqY15iS7GAr44w1+x/3wnYQ4=rN/wOitjqZ0N0FRpxlw/7PGeZADD"
|
|
62
|
-
}
|
|
63
|
-
try:
|
|
64
|
-
response = requests.get(
|
|
65
|
-
url=url,
|
|
66
|
-
params=params,
|
|
67
|
-
headers=headers
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
if response.status_code == 200:
|
|
71
|
-
response_data = response.json()
|
|
72
|
-
df = pd.DataFrame(
|
|
73
|
-
data=response_data['data']['item'],
|
|
74
|
-
columns=response_data['data']['column']
|
|
75
|
-
)
|
|
76
|
-
# 处理DataFrame列(秒级时间戳)
|
|
77
|
-
df['str_day'] = pd.to_datetime(df['timestamp'], unit='ms').dt.normalize()
|
|
78
|
-
df["str_day"] = df["str_day"].dt.strftime("%Y-%m-%d")
|
|
79
|
-
return df
|
|
80
|
-
else:
|
|
81
|
-
return pd.DataFrame()
|
|
82
|
-
except BaseException as e:
|
|
83
|
-
logger.error("同步股票年度数据出现异常:{},{}", symbol, e)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if __name__ == '__main__':
|
|
87
|
-
test_df = get_xue_qiu_k_line('SZ000001', 'year')
|
|
88
|
-
print(test_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
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_stock_gdfx_free_top_10_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/em/east_money_stock_quotes_sync_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.5.9 → mns_common-1.3.6.2}/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.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/selection/kpl_selection_plate_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/kpl/symbol/symbol_his_quotes_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9/mns_common/api/qmt → mns_common-1.3.6.2/mns_common/api/proxies}/__init__.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9/mns_common/api/ths/company → mns_common-1.3.6.2/mns_common/api/qmt}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9/mns_common/api/us → mns_common-1.3.6.2/mns_common/api/ths/company}/__init__.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/company/ths_company_announce_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/company/ths_company_info_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/app/ths_concept_detail_app.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/app/ths_concept_index_app.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/ths_common_js_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/ths_company_info_web.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/ths_concept_detail_web.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/api/ths/concept/web/ths_concept_index_web.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/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
|
{mns_common-1.3.5.9/mns_common/api/xueqiu → mns_common-1.3.6.2/mns_common/api/us}/__init__.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.5.9 → mns_common-1.3.6.2}/mns_common/component/classify/symbol_classify_api.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/classify/symbol_classify_param.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/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.5.9 → mns_common-1.3.6.2}/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.5.9 → mns_common-1.3.6.2}/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.5.9 → mns_common-1.3.6.2}/mns_common/component/k_line/patterns/pattern_Enum.py
RENAMED
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/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.5.9 → mns_common-1.3.6.2}/mns_common/component/self_choose/black_list_service_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mns_common-1.3.5.9 → mns_common-1.3.6.2}/mns_common/component/task/real_time_data_sync_check.py
RENAMED
|
File without changes
|
{mns_common-1.3.5.9/mns_common/db/v2 → mns_common-1.3.6.2/mns_common/component/tfp}/__init__.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
|