mns-common 1.3.9.3__py3-none-any.whl → 1.3.9.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mns-common might be problematic. Click here for more details.
- mns_common/api/xueqiu/xue_qiu_k_line_api.py +19 -22
- {mns_common-1.3.9.3.dist-info → mns_common-1.3.9.4.dist-info}/METADATA +1 -1
- {mns_common-1.3.9.3.dist-info → mns_common-1.3.9.4.dist-info}/RECORD +5 -5
- {mns_common-1.3.9.3.dist-info → mns_common-1.3.9.4.dist-info}/WHEEL +0 -0
- {mns_common-1.3.9.3.dist-info → mns_common-1.3.9.4.dist-info}/top_level.txt +0 -0
|
@@ -5,7 +5,6 @@ file_path = os.path.abspath(__file__)
|
|
|
5
5
|
end = file_path.index('mns') + 16
|
|
6
6
|
project_path = file_path[0:end]
|
|
7
7
|
sys.path.append(project_path)
|
|
8
|
-
from loguru import logger
|
|
9
8
|
import requests
|
|
10
9
|
import pandas as pd
|
|
11
10
|
|
|
@@ -42,28 +41,26 @@ def get_xue_qiu_k_line(symbol, period, cookie, end_time, hq):
|
|
|
42
41
|
"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
42
|
"cookie": cookie
|
|
44
43
|
}
|
|
45
|
-
try:
|
|
46
|
-
response = requests.get(
|
|
47
|
-
url=url,
|
|
48
|
-
params=params,
|
|
49
|
-
headers=headers
|
|
50
|
-
)
|
|
51
44
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
response = requests.get(
|
|
46
|
+
url=url,
|
|
47
|
+
params=params,
|
|
48
|
+
headers=headers
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
if response.status_code == 200:
|
|
52
|
+
response_data = response.json()
|
|
53
|
+
df = pd.DataFrame(
|
|
54
|
+
data=response_data['data']['item'],
|
|
55
|
+
columns=response_data['data']['column']
|
|
56
|
+
)
|
|
57
|
+
# 处理DataFrame列(秒级时间戳)
|
|
58
|
+
df['str_day'] = pd.to_datetime(df['timestamp'], unit='ms').dt.normalize()
|
|
59
|
+
df["str_day"] = df["str_day"].dt.strftime("%Y-%m-%d")
|
|
60
|
+
return df
|
|
61
|
+
else:
|
|
62
|
+
# 直接抛出带有明确信息的异常
|
|
63
|
+
raise ValueError("获取到的DataFrame数据为空")
|
|
67
64
|
|
|
68
65
|
|
|
69
66
|
if __name__ == '__main__':
|
|
@@ -71,7 +71,7 @@ mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py,sha256=eICTYaHJYp2ccsHkeDnkzpJ
|
|
|
71
71
|
mns_common/api/us/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
72
72
|
mns_common/api/us/ths_us_company_info_api.py,sha256=qQjv4F-ovQ2uuu-FlBAnxjvVA7qj9y_x5WZtUoyoEW4,241
|
|
73
73
|
mns_common/api/xueqiu/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
74
|
-
mns_common/api/xueqiu/xue_qiu_k_line_api.py,sha256=
|
|
74
|
+
mns_common/api/xueqiu/xue_qiu_k_line_api.py,sha256=G0AAejex8Fv7FCBtFUiMslrjlIxlo3JnuxqHdDzNrek,4424
|
|
75
75
|
mns_common/component/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
76
76
|
mns_common/component/common_service_fun_api.py,sha256=ZPPqo-ZBwSJ23I_2xXGxXyN6emYrlPqUuBGjA2Cv4gs,6629
|
|
77
77
|
mns_common/component/cache/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
@@ -152,7 +152,7 @@ mns_common/utils/date_handle_util.py,sha256=XS-MyA8_7k35LOCFAYOHgVcVkMft_Kc4Wa9U
|
|
|
152
152
|
mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
|
|
153
153
|
mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
|
|
154
154
|
mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
|
|
155
|
-
mns_common-1.3.9.
|
|
156
|
-
mns_common-1.3.9.
|
|
157
|
-
mns_common-1.3.9.
|
|
158
|
-
mns_common-1.3.9.
|
|
155
|
+
mns_common-1.3.9.4.dist-info/METADATA,sha256=wAxR5QG05NWjAmUIoKTo0MvIo5ehDn6fntqE_awhCi8,61
|
|
156
|
+
mns_common-1.3.9.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
157
|
+
mns_common-1.3.9.4.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
|
|
158
|
+
mns_common-1.3.9.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|