mns-common 1.4.0.0__tar.gz → 1.4.0.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.

Files changed (163) hide show
  1. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/PKG-INFO +1 -1
  2. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/akshare/stock_bid_ask_api.py +11 -11
  3. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/real_time/east_money_stock_a_api.py +27 -24
  4. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/real_time/east_money_stock_a_v2_api.py +3 -3
  5. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/symbol/symbol_his_quotes_api.py +1 -1
  6. mns_common-1.4.0.2/mns_common/component/proxies/proxy_common_api.py +156 -0
  7. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common.egg-info/PKG-INFO +1 -1
  8. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/setup.py +1 -1
  9. mns_common-1.4.0.0/mns_common/component/proxies/proxy_common_api.py +0 -186
  10. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/README.md +0 -0
  11. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/__init__.py +0 -0
  12. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/__init__.py +0 -0
  13. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/akshare/__init__.py +0 -0
  14. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/akshare/k_line_api.py +0 -0
  15. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/akshare/stock_dt_pool.py +0 -0
  16. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/akshare/stock_zb_pool.py +0 -0
  17. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/akshare/stock_zt_pool_api.py +0 -0
  18. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/akshare/yjyg_sync_api.py +0 -0
  19. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/__init__.py +0 -0
  20. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/concept/__init__.py +0 -0
  21. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/concept/em_concept_index_api.py +0 -0
  22. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/gd/__init__.py +0 -0
  23. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/gd/east_money_stock_gdfx_free_top_10_api.py +0 -0
  24. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/real_time/__init__.py +0 -0
  25. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/real_time/east_money_debt_api.py +0 -0
  26. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/real_time/east_money_etf_api.py +0 -0
  27. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/real_time/east_money_stock_hk_api.py +0 -0
  28. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/em/real_time/east_money_stock_us_api.py +0 -0
  29. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/hk/__init__.py +0 -0
  30. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/hk/ths_hk_company_info_api.py +0 -0
  31. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/k_line/__init__.py +0 -0
  32. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/k_line/stock_k_line_data_api.py +0 -0
  33. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/k_line/stock_minute_data_api.py +0 -0
  34. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/__init__.py +0 -0
  35. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/common/__init__.py +0 -0
  36. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/common/kpl_common_api.py +0 -0
  37. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/common/kpl_common_field_constant.py +0 -0
  38. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/concept/__init__.py +0 -0
  39. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/concept/kpl_concept_api.py +0 -0
  40. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/constant/__init__.py +0 -0
  41. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/constant/kpl_constant.py +0 -0
  42. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/industry/__init__.py +0 -0
  43. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/industry/kpl_industry_api.py +0 -0
  44. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/selection/__init__.py +0 -0
  45. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/selection/kpl_selection_plate_api.py +0 -0
  46. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/symbol/__init__.py +0 -0
  47. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/symbol/kpl_real_time_quotes_api.py +0 -0
  48. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/kpl/symbol/kpl_symbol_common_field_constant.py +0 -0
  49. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/msg/__init__.py +0 -0
  50. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/msg/push_msg_api.py +0 -0
  51. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/proxies/__init__.py +0 -0
  52. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/proxies/liu_guan_proxy_api.py +0 -0
  53. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/qmt/__init__.py +0 -0
  54. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/qmt/qmt_minunte_tick_data.py +0 -0
  55. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/__init__.py +0 -0
  56. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/big_deal/__init__.py +0 -0
  57. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/big_deal/ths_big_deal_api.py +0 -0
  58. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/company/__init__.py +0 -0
  59. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/company/ths_company_announce_api.py +0 -0
  60. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/company/ths_company_info_api.py +0 -0
  61. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/__init__.py +0 -0
  62. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/app/__init__.py +0 -0
  63. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/app/ths_concept_detail_app.py +0 -0
  64. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/app/ths_concept_index_app.py +0 -0
  65. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/web/__init__.py +0 -0
  66. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/web/ths_common_js_api.py +0 -0
  67. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/web/ths_company_info_web.py +0 -0
  68. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/web/ths_concept_detail_web.py +0 -0
  69. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/concept/web/ths_concept_index_web.py +0 -0
  70. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/self_choose/__init__.py +0 -0
  71. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/self_choose/ths_self_choose_api.py +0 -0
  72. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/wen_cai/__init__.py +0 -0
  73. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/wen_cai/ths_wen_cai_api.py +0 -0
  74. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/zt/__init__.py +0 -0
  75. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/zt/ths_stock_zt_pool_api.py +0 -0
  76. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py +0 -0
  77. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/us/__init__.py +0 -0
  78. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/us/ths_us_company_info_api.py +0 -0
  79. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/xueqiu/__init__.py +0 -0
  80. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/api/xueqiu/xue_qiu_k_line_api.py +0 -0
  81. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/__init__.py +0 -0
  82. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/cache/__init__.py +0 -0
  83. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/cache/cache_service.py +0 -0
  84. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/classify/__init__.py +0 -0
  85. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/classify/symbol_classify_api.py +0 -0
  86. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/classify/symbol_classify_param.py +0 -0
  87. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/common_service_fun_api.py +0 -0
  88. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/company/__init__.py +0 -0
  89. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/company/company_common_service_api.py +0 -0
  90. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/company/company_common_service_new_api.py +0 -0
  91. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/concept/__init__.py +0 -0
  92. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/concept/kpl_concept_common_service_api.py +0 -0
  93. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/concept/ths_concept_common_service_api.py +0 -0
  94. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/cookie/__init__.py +0 -0
  95. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/cookie/cookie_info_service.py +0 -0
  96. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/data/__init__.py +0 -0
  97. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/data/data_init_api.py +0 -0
  98. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/deal/__init__.py +0 -0
  99. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/deal/deal_service_api.py +0 -0
  100. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/deal/terminal_enum.py +0 -0
  101. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/em/__init__.py +0 -0
  102. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/em/em_real_time_quotes_api.py +0 -0
  103. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/em/em_stock_info_api.py +0 -0
  104. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/exception/ExceptionMonitor.py +0 -0
  105. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/exception/__init__.py +0 -0
  106. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/hk/__init__.py +0 -0
  107. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/hk/company_hk_service_api.py +0 -0
  108. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/industry/__init__.py +0 -0
  109. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/industry/ths_industry_index_api.py +0 -0
  110. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/__init__.py +0 -0
  111. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/clean/__init__.py +0 -0
  112. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/clean/k_line_param.py +0 -0
  113. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/clean/sh_small_normal_zt_k_line_check_api.py +0 -0
  114. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/common/__init__.py +0 -0
  115. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/common/k_line_common_service_api.py +0 -0
  116. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/patterns/__init__.py +0 -0
  117. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/patterns/k_line_patterns_service_api.py +0 -0
  118. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/k_line/patterns/pattern_Enum.py +0 -0
  119. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/price/__init__.py +0 -0
  120. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/price/trade_price_service_api.py +0 -0
  121. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/proxies/__init__.py +0 -0
  122. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/qmt/__init__.py +0 -0
  123. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/qmt/qmt_buy_service.py +0 -0
  124. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/real_time/__init__.py +0 -0
  125. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/real_time/real_time_common_service_api.py +0 -0
  126. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/redis_msg/__init__.py +0 -0
  127. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/redis_msg/redis_msg_publish_service.py +0 -0
  128. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/self_choose/__init__.py +0 -0
  129. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/self_choose/black_list_service_api.py +0 -0
  130. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/self_choose/self_choose_service_api.py +0 -0
  131. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/task/__init__.py +0 -0
  132. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/task/real_time_data_sync_check.py +0 -0
  133. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/tfp/__init__.py +0 -0
  134. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/tfp/stock_tfp_api.py +0 -0
  135. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/trade_date/__init__.py +0 -0
  136. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/trade_date/trade_date_common_service_api.py +0 -0
  137. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/zt/__init__.py +0 -0
  138. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/component/zt/zt_common_service_api.py +0 -0
  139. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/constant/__init__.py +0 -0
  140. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/constant/black_list_classify_enum.py +0 -0
  141. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/constant/db_name_constant.py +0 -0
  142. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/constant/east_money_stock_api.py +0 -0
  143. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/constant/extra_income_db_name.py +0 -0
  144. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/constant/price_enum.py +0 -0
  145. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/constant/redis_msg_constant.py +0 -0
  146. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/constant/self_choose_constant.py +0 -0
  147. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/db/MongodbUtil.py +0 -0
  148. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/db/MongodbUtilLocal.py +0 -0
  149. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/db/__init__.py +0 -0
  150. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/db/v2/MongodbUtilV2.py +0 -0
  151. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/db/v2/__init__.py +0 -0
  152. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/utils/__init__.py +0 -0
  153. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/utils/async_fun.py +0 -0
  154. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/utils/cmd_util.py +0 -0
  155. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/utils/data_frame_util.py +0 -0
  156. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/utils/date_handle_util.py +0 -0
  157. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/utils/db_util.py +0 -0
  158. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/utils/file_util.py +0 -0
  159. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common/utils/ip_util.py +0 -0
  160. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common.egg-info/SOURCES.txt +0 -0
  161. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common.egg-info/dependency_links.txt +0 -0
  162. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/mns_common.egg-info/top_level.txt +0 -0
  163. {mns_common-1.4.0.0 → mns_common-1.4.0.2}/setup.cfg +0 -0
@@ -1,3 +1,3 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mns_common
3
- Version: 1.4.0.0
3
+ Version: 1.4.0.2
@@ -57,25 +57,25 @@ def stock_bid_ask_em(symbol: str = "000001") -> dict:
57
57
  temp_df = pd.DataFrame(tick_dict, index=[1])
58
58
  temp_df.reset_index(inplace=True)
59
59
  temp_df.loc[temp_df['wei_bi'] == '-', 'wei_bi'] = 0
60
- temp_df.loc[temp_df['sell_5'] == '-', 'sell_5_vol'] = 0
60
+ temp_df.loc[temp_df['sell_5_vol'] == '-', 'sell_5_vol'] = 0
61
61
  temp_df.loc[temp_df['sell_5'] == '-', 'sell_5'] = 0
62
- temp_df.loc[temp_df['sell_4'] == '-', 'sell_4_vol'] = 0
62
+ temp_df.loc[temp_df['sell_4_vol'] == '-', 'sell_4_vol'] = 0
63
63
  temp_df.loc[temp_df['sell_4'] == '-', 'sell_4'] = 0
64
- temp_df.loc[temp_df['sell_3'] == '-', 'sell_3_vol'] = 0
64
+ temp_df.loc[temp_df['sell_3_vol'] == '-', 'sell_3_vol'] = 0
65
65
  temp_df.loc[temp_df['sell_3'] == '-', 'sell_3'] = 0
66
- temp_df.loc[temp_df['sell_2'] == '-', 'sell_2_vol'] = 0
66
+ temp_df.loc[temp_df['sell_2_vol'] == '-', 'sell_2_vol'] = 0
67
67
  temp_df.loc[temp_df['sell_2'] == '-', 'sell_2'] = 0
68
- temp_df.loc[temp_df['sell_1'] == '-', 'sell_1_vol'] = 0
68
+ temp_df.loc[temp_df['sell_1_vol'] == '-', 'sell_1_vol'] = 0
69
69
  temp_df.loc[temp_df['sell_1'] == '-', 'sell_1'] = 0
70
- temp_df.loc[temp_df['buy_1'] == '-', 'buy_1_vol'] = 0
70
+ temp_df.loc[temp_df['buy_1_vol'] == '-', 'buy_1_vol'] = 0
71
71
  temp_df.loc[temp_df['buy_1'] == '-', 'buy_1'] = 0
72
- temp_df.loc[temp_df['buy_2'] == '-', 'buy_2_vol'] = 0
72
+ temp_df.loc[temp_df['buy_2_vol'] == '-', 'buy_2_vol'] = 0
73
73
  temp_df.loc[temp_df['buy_2'] == '-', 'buy_2'] = 0
74
- temp_df.loc[temp_df['buy_3'] == '-', 'buy_3_vol'] = 0
74
+ temp_df.loc[temp_df['buy_3_vol'] == '-', 'buy_3_vol'] = 0
75
75
  temp_df.loc[temp_df['buy_3'] == '-', 'buy_3'] = 0
76
- temp_df.loc[temp_df['buy_4'] == '-', 'buy_4_vol'] = 0
76
+ temp_df.loc[temp_df['buy_4_vol'] == '-', 'buy_4_vol'] = 0
77
77
  temp_df.loc[temp_df['buy_4'] == '-', 'buy_4'] = 0
78
- temp_df.loc[temp_df['buy_5'] == '-', 'buy_5_vol'] = 0
78
+ temp_df.loc[temp_df['buy_5_vol'] == '-', 'buy_5_vol'] = 0
79
79
  temp_df.loc[temp_df['buy_5'] == '-', 'buy_5'] = 0
80
80
  temp_df['symbol'] = symbol
81
81
  return temp_df
@@ -83,5 +83,5 @@ def stock_bid_ask_em(symbol: str = "000001") -> dict:
83
83
 
84
84
  if __name__ == '__main__':
85
85
  while True:
86
- df = stock_bid_ask_em('0.832110')
86
+ df = stock_bid_ask_em('0.000001')
87
87
  print(df)
@@ -1,11 +1,12 @@
1
1
  import sys
2
2
  import os
3
+ import time
3
4
 
4
5
  file_path = os.path.abspath(__file__)
5
6
  end = file_path.index('mns') + 16
6
7
  project_path = file_path[0:end]
7
8
  sys.path.append(project_path)
8
-
9
+ from mns_common.db.MongodbUtil import MongodbUtil
9
10
  import requests
10
11
  import json
11
12
  import pandas as pd
@@ -14,15 +15,20 @@ import datetime
14
15
  from loguru import logger
15
16
  import mns_common.utils.data_frame_util as data_frame_util
16
17
 
18
+ mongodb_util = MongodbUtil('27017')
19
+ fields = ("f352,f2,f3,f5,f6,f8,f10,f11,f22,f12,f14,f15,f16,f17,"
20
+ "f18,f20,f21,f26,f33,f34,f35,f62,f66,f69,f72,f100,f184,f211,f212"),
21
+ fs = "m:0 t:6,m:0 t:80,m:1 t:2,m:1 t:23,m:0 t:81 s:2048"
22
+
17
23
  # 最大返回条数
18
24
  max_number = 5800
19
25
  # 最小返回条数
20
26
  min_number = 5600
21
27
  # 分页条数
22
- page_number = 100
28
+ PAGE_SIZE = 100
23
29
 
24
30
 
25
- def get_stock_page_data(pn, fields, fs, proxies):
31
+ def get_stock_page_data(pn, proxies, page_size):
26
32
  """
27
33
  获取单页股票数据
28
34
  """
@@ -36,7 +42,7 @@ def get_stock_page_data(pn, fields, fs, proxies):
36
42
  params = {
37
43
  "cb": "jQuery1124046660442520420653_" + str(current_timestamp_ms),
38
44
  "pn": str(pn),
39
- "pz": "10000", # 每页最大200条
45
+ "pz": str(page_size), # 每页最大200条
40
46
  "po": "0",
41
47
  "np": "3",
42
48
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -79,18 +85,18 @@ def get_stock_page_data(pn, fields, fs, proxies):
79
85
  return pd.DataFrame()
80
86
 
81
87
 
82
- def all_stock_ticker_data_new(fields, fs, proxies) -> pd.DataFrame:
88
+ def all_stock_ticker_data_new(proxies) -> pd.DataFrame:
83
89
  """
84
90
  使用多线程获取所有股票数据
85
91
  """
86
92
 
87
- per_page = page_number
93
+ per_page = PAGE_SIZE
88
94
  total_pages = (max_number + per_page - 1) // per_page # 向上取整
89
95
 
90
96
  # 创建线程池
91
97
  with ThreadPoolExecutor(max_workers=10) as executor:
92
98
  # 提交任务,获取每页数据
93
- futures = [executor.submit(get_stock_page_data, pn, fields, fs, proxies)
99
+ futures = [executor.submit(get_stock_page_data, pn, proxies, PAGE_SIZE)
94
100
  for pn in range(1, total_pages + 1)]
95
101
 
96
102
  # 收集结果
@@ -108,21 +114,10 @@ def all_stock_ticker_data_new(fields, fs, proxies) -> pd.DataFrame:
108
114
 
109
115
 
110
116
  def get_real_time_quotes_all_stocks(proxies):
111
- fields = ("f352,f2,f3,f5,f6,f8,f10,f11,f22,f12,f14,f15,f16,f17,"
112
- "f18,f20,f21,f26,f33,f34,f35,f62,f66,f69,f72,f100,f184,f211,f212"),
113
- fs = "m:0 t:6,m:0 t:80,m:1 t:2,m:1 t:23,m:0 t:81 s:2048"
114
- # 获取第一页数据
115
- page_one_df = get_stock_page_data(1, fields, fs, proxies)
116
- # 数据接口正常返回5600以上的数量
117
- if page_one_df.shape[0] > min_number:
118
- page_one_df = rename_real_time_quotes_df(page_one_df)
119
- page_one_df.drop_duplicates('symbol', keep='last', inplace=True)
120
- return page_one_df
121
- else:
122
- page_df = all_stock_ticker_data_new(fields, fs, proxies)
123
- page_df = rename_real_time_quotes_df(page_df)
124
- page_df.drop_duplicates('symbol', keep='last', inplace=True)
125
- return page_df
117
+ page_df = all_stock_ticker_data_new(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
126
121
 
127
122
 
128
123
  # 获取所有股票实时行情数据 f33,委比
@@ -298,5 +293,13 @@ def get_sum_north_south_net_buy_amt():
298
293
  # 示例调用
299
294
  if __name__ == "__main__":
300
295
  while True:
301
- df = get_real_time_quotes_all_stocks(None)
302
- logger.info("涨停数据,{}", 1)
296
+ ip_proxy_pool = mongodb_util.find_all_data('ip_proxy_pool')
297
+ if data_frame_util.is_not_empty(ip_proxy_pool):
298
+ proxy_ip = list(ip_proxy_pool['ip'])[0]
299
+ proxy = {
300
+ "https": proxy_ip}
301
+ df = get_real_time_quotes_all_stocks(proxy)
302
+ logger.info("涨停数据,{}", 1)
303
+ else:
304
+ time.sleep(1)
305
+ logger.error("ip为空")
@@ -288,9 +288,9 @@ def rename_real_time_quotes_df(temp_df):
288
288
 
289
289
  # 示例调用
290
290
  if __name__ == "__main__":
291
-
291
+ number = 1
292
292
  while True:
293
293
  df = get_all_real_time_quotes(None)
294
- print(df)
295
294
  zt_df = df.loc[df['wei_bi'] == 100]
296
- logger.info("涨停数据,{}", zt_df)
295
+ logger.info("同步次数,{}", number)
296
+ number = number + 1
@@ -115,7 +115,7 @@ if __name__ == '__main__':
115
115
  # 2021-10-25,45,0925,0955 2023-09-15,11,0925,1005
116
116
 
117
117
  # get_stock_quotes_his('2023-09-20', 11, '0925', '1005')
118
- df = sync_stock_his_quotes('2024-04-18', '0935', '0940')
118
+ df = sync_stock_his_quotes('2025-04-18', '0935', '0940')
119
119
  get_stock_count('2023-09-14', 0, '0925', '1500')
120
120
 
121
121
  his_test('2021-10-20')
@@ -0,0 +1,156 @@
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 mns_common.api.proxies.liu_guan_proxy_api as liu_guan_proxy_api
10
+ import pandas as pd
11
+ import mns_common.utils.data_frame_util as data_frame_util
12
+ from mns_common.db.MongodbUtil import MongodbUtil
13
+ import mns_common.constant.db_name_constant as db_name_constant
14
+ import datetime
15
+ import requests
16
+ import time
17
+ from loguru import logger
18
+ from functools import lru_cache
19
+ import mns_common.api.em.real_time.east_money_stock_a_api as east_money_stock_a_api
20
+ import threading
21
+
22
+ mongodb_util = MongodbUtil('27017')
23
+
24
+
25
+ def query_liu_guan_proxy_ip():
26
+ ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
27
+ return ip_proxy_pool
28
+
29
+
30
+ def remove_proxy_ip():
31
+ mongodb_util.remove_data({}, db_name_constant.IP_PROXY_POOL)
32
+
33
+
34
+ def check_valid(ip_proxy_pool):
35
+ effect_time = list(ip_proxy_pool['effect_time'])[0]
36
+
37
+ now_date = datetime.datetime.now()
38
+
39
+ str_now_date = now_date.strftime('%Y-%m-%d %H:%M:%S')
40
+
41
+ if effect_time > str_now_date:
42
+ return True
43
+ else:
44
+ remove_proxy_ip()
45
+ return False
46
+
47
+
48
+ @lru_cache(maxsize=None)
49
+ def get_account_cache():
50
+ query = {"type": "liu_guan_proxy", }
51
+ return mongodb_util.find_query_data(db_name_constant.STOCK_ACCOUNT_INFO, query)
52
+
53
+
54
+ def generate_proxy_ip_api(minutes):
55
+ stock_account_info = get_account_cache()
56
+ order_id = list(stock_account_info['password'])[0]
57
+ secret = list(stock_account_info['account'])[0]
58
+ # 获取10分钟动态ip
59
+ ip = liu_guan_proxy_api.get_proxy_api(order_id, secret, str(60 * minutes))
60
+ return ip
61
+
62
+
63
+ def generate_proxy_ip(minutes):
64
+ ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
65
+ if data_frame_util.is_not_empty(ip_proxy_pool):
66
+ return list(ip_proxy_pool['ip'])[0]
67
+ else:
68
+ remove_proxy_ip()
69
+ now_date = datetime.datetime.now()
70
+ # 加上分钟
71
+ time_to_add = datetime.timedelta(minutes=minutes)
72
+ new_date = now_date + time_to_add
73
+ str_now_date = new_date.strftime('%Y-%m-%d %H:%M:%S')
74
+ # 获取10分钟动态ip
75
+ while True:
76
+ remove_proxy_ip()
77
+ ip = generate_proxy_ip_api(minutes)
78
+ if check_proxy(ip):
79
+ result_dict = {"_id": ip,
80
+ 'effect_time': str_now_date,
81
+ 'ip': ip}
82
+ result_df = pd.DataFrame(result_dict, index=[1])
83
+
84
+ mongodb_util.insert_mongo(result_df, db_name_constant.IP_PROXY_POOL)
85
+ break
86
+ else:
87
+ time.sleep(0.5)
88
+ return ip
89
+
90
+
91
+ def get_proxy_ip(minutes):
92
+ ip_proxy_pool = query_liu_guan_proxy_ip()
93
+ if data_frame_util.is_empty(ip_proxy_pool):
94
+ return generate_proxy_ip(minutes)
95
+ else:
96
+ if check_valid(ip_proxy_pool):
97
+ return list(ip_proxy_pool['ip'])[0]
98
+ else:
99
+ return generate_proxy_ip(minutes)
100
+
101
+
102
+ def check_proxy(proxy_ip):
103
+ try:
104
+ # 两秒超时
105
+ test_df = call_with_timeout(get_em_real_time_data, proxy_ip, timeout=2)
106
+ if data_frame_util.is_not_empty(test_df):
107
+ logger.info("可用代理ip:{}", proxy_ip)
108
+ return True
109
+ else:
110
+ return False
111
+ except Exception as e:
112
+ logger.error("代理ip不可用:{},{}", proxy_ip, e)
113
+ return False
114
+
115
+
116
+ def get_em_real_time_data(proxy_ip):
117
+ proxies = {
118
+ "http": proxy_ip,
119
+ "https": proxy_ip
120
+ }
121
+ return east_money_stock_a_api.get_stock_page_data(1, proxies, 20)
122
+
123
+
124
+ # 定义一个带超时的函数调用
125
+ def call_with_timeout(func, *args, timeout=2, **kwargs):
126
+ # 用于存储函数执行结果
127
+ result = None
128
+ exception = None
129
+
130
+ # 定义一个线程目标函数
131
+ def target():
132
+ nonlocal result, exception
133
+ try:
134
+ result = func(*args, **kwargs)
135
+ except Exception as e:
136
+ exception = e
137
+
138
+ # 创建线程并启动
139
+ thread = threading.Thread(target=target)
140
+ thread.start()
141
+
142
+ # 等待线程完成,最多等待 timeout 秒
143
+ thread.join(timeout)
144
+
145
+ # 如果线程仍然存活,说明函数超时了
146
+ if thread.is_alive():
147
+ raise TimeoutError(f"Function exceeded timeout of {timeout} seconds")
148
+
149
+ # 如果函数抛出了异常,重新抛出
150
+ if exception is not None:
151
+ raise exception
152
+ return result
153
+
154
+
155
+ if __name__ == "__main__":
156
+ generate_proxy_ip(1)
@@ -1,3 +1,3 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mns-common
3
- Version: 1.4.0.0
3
+ Version: 1.4.0.2
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='mns_common',
5
- version='1.4.0.0',
5
+ version='1.4.0.2',
6
6
  # packages=["mns_common", "mns_common.api",
7
7
  # "mns_common.api.akshare",
8
8
  # "mns_common.api.em",
@@ -1,186 +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
-
9
- import mns_common.api.proxies.liu_guan_proxy_api as liu_guan_proxy_api
10
- import pandas as pd
11
- import mns_common.utils.data_frame_util as data_frame_util
12
- from mns_common.db.MongodbUtil import MongodbUtil
13
- import mns_common.constant.db_name_constant as db_name_constant
14
- import datetime
15
- import requests
16
- import time
17
- from loguru import logger
18
- from functools import lru_cache
19
-
20
- mongodb_util = MongodbUtil('27017')
21
-
22
-
23
- def query_liu_guan_proxy_ip():
24
- ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
25
- return ip_proxy_pool
26
-
27
-
28
- def remove_proxy_ip():
29
- mongodb_util.remove_data({}, db_name_constant.IP_PROXY_POOL)
30
-
31
-
32
- def check_valid(ip_proxy_pool):
33
- effect_time = list(ip_proxy_pool['effect_time'])[0]
34
-
35
- now_date = datetime.datetime.now()
36
-
37
- str_now_date = now_date.strftime('%Y-%m-%d %H:%M:%S')
38
-
39
- if effect_time > str_now_date:
40
- return True
41
- else:
42
- remove_proxy_ip()
43
- return False
44
-
45
-
46
- @lru_cache(maxsize=None)
47
- def get_account_cache():
48
- query = {"type": "liu_guan_proxy", }
49
- return mongodb_util.find_query_data(db_name_constant.STOCK_ACCOUNT_INFO, query)
50
-
51
-
52
- def generate_proxy_ip_api(minutes):
53
- stock_account_info = get_account_cache()
54
- order_id = list(stock_account_info['password'])[0]
55
- secret = list(stock_account_info['account'])[0]
56
- # 获取10分钟动态ip
57
- ip = liu_guan_proxy_api.get_proxy_api(order_id, secret, str(60 * minutes))
58
- return ip
59
-
60
-
61
- def generate_proxy_ip(minutes):
62
- ip_proxy_pool = mongodb_util.find_all_data(db_name_constant.IP_PROXY_POOL)
63
- if data_frame_util.is_not_empty(ip_proxy_pool):
64
- return list(ip_proxy_pool['ip'])[0]
65
- else:
66
- remove_proxy_ip()
67
- now_date = datetime.datetime.now()
68
- # 加上分钟
69
- time_to_add = datetime.timedelta(minutes=minutes)
70
- new_date = now_date + time_to_add
71
- str_now_date = new_date.strftime('%Y-%m-%d %H:%M:%S')
72
- # 获取10分钟动态ip
73
- ip = generate_proxy_ip_api(minutes)
74
- result_dict = {"_id": ip,
75
- 'effect_time': str_now_date,
76
- 'ip': ip}
77
- result_df = pd.DataFrame(result_dict, index=[1])
78
-
79
- mongodb_util.insert_mongo(result_df, db_name_constant.IP_PROXY_POOL)
80
-
81
- return ip
82
-
83
-
84
- def get_proxy_ip(minutes):
85
- ip_proxy_pool = query_liu_guan_proxy_ip()
86
- if data_frame_util.is_empty(ip_proxy_pool):
87
- return generate_proxy_ip(minutes)
88
- else:
89
- if check_valid(ip_proxy_pool):
90
- return list(ip_proxy_pool['ip'])[0]
91
- else:
92
- return generate_proxy_ip(minutes)
93
-
94
-
95
- def check_baidu_proxy(proxy_ip, timeout=2):
96
- """
97
- 检测代理IP是否能访问百度
98
- :param proxy_ip: 代理IP地址
99
- :param proxy_port: 代理端口
100
- :param timeout: 超时时间(秒)
101
- :return: (是否可用, 响应时间, 检测结果信息)
102
- """
103
- # 构造代理地址
104
-
105
- # 设置代理参数
106
- proxies = {
107
- "http": proxy_ip,
108
- "https": proxy_ip
109
- }
110
-
111
- # 模拟浏览器请求头
112
- headers = {
113
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
114
- "Accept-Language": "zh-CN,zh;q=0.9",
115
- "Connection": "keep-alive"
116
- }
117
-
118
- try:
119
- # 记录开始时间
120
- start_time = time.time()
121
-
122
- # 发送请求到百度
123
- response = requests.get(
124
- url="https://www.baidu.com",
125
- proxies=proxies,
126
- headers=headers,
127
- timeout=timeout,
128
- allow_redirects=True # 允许重定向
129
- )
130
-
131
- # 计算响应时间
132
- response_time = round((time.time() - start_time) * 1000) # 毫秒
133
- # 检查响应状态和内容
134
- if response.status_code == 200:
135
- # 验证是否返回百度页面
136
- if "百度一下" in response.text and "baidu.com" in response.text:
137
- logger.info("代理ip可用:{},响应时间:{}", proxy_ip, response_time)
138
- return True
139
- else:
140
- logger.error("代理ip不可用:{},响应时间:{}", proxy_ip, response_time)
141
- return False
142
- else:
143
- logger.error("代理ip不可用:{},响应时间:{},HTTP状态码异常:{}", proxy_ip, response_time, response.status_code)
144
- return False
145
- except requests.exceptions.ConnectTimeout:
146
- logger.error("代理ip不可用:{},连接超时", proxy_ip, response_time)
147
- return False
148
- except requests.exceptions.ProxyError:
149
- logger.error("代理ip不可用:{},代理拒绝连接", proxy_ip, response_time)
150
- return False
151
- except requests.exceptions.SSLError:
152
- logger.error("代理ip不可用:{},SSL证书错误", proxy_ip, response_time)
153
- return False
154
- except requests.exceptions.RequestException as e:
155
- logger.error("代理ip不可用:{},网络错误:{}", proxy_ip, str(e))
156
- return False
157
-
158
-
159
- def check_proxy(proxy_ip, timeout=2):
160
- proxies = {
161
- "http": proxy_ip,
162
- "https": proxy_ip
163
- }
164
- try:
165
- # 测试请求(httpbin.org 返回请求的IP)
166
- response = requests.get(
167
- "http://httpbin.org/ip",
168
- proxies=proxies,
169
- timeout=timeout # 超时时间
170
- )
171
- if response.status_code == 200:
172
- return True
173
- else:
174
- logger.error("代理ip不可用:{}", proxy_ip)
175
- return False
176
- except Exception as e:
177
- logger.error("代理ip不可用:{},{}", proxy_ip, e)
178
- return False
179
-
180
-
181
- if __name__ == "__main__":
182
- target_ip = "112.28.228.67:35528" # Google DNS
183
- if check_proxy(target_ip, 2):
184
- print(f"{target_ip} 可以访问")
185
- else:
186
- print(f"{target_ip} 无法访问")
File without changes
File without changes