chinadata 0.1.0__py3-none-any.whl → 0.1.1__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.
- chinadata/ca_data.py +7 -8
- chinadata/example.py +4 -13
- {chinadata-0.1.0.dist-info → chinadata-0.1.1.dist-info}/METADATA +1 -1
- chinadata-0.1.1.dist-info/RECORD +9 -0
- chinadata-0.1.0.dist-info/RECORD +0 -9
- {chinadata-0.1.0.dist-info → chinadata-0.1.1.dist-info}/WHEEL +0 -0
- {chinadata-0.1.0.dist-info → chinadata-0.1.1.dist-info}/top_level.txt +0 -0
chinadata/ca_data.py
CHANGED
|
@@ -41,7 +41,7 @@ class pro_api:
|
|
|
41
41
|
pd.DataFrame: A DataFrame containing the fetched stock data.
|
|
42
42
|
"""
|
|
43
43
|
# url="http://127.0.0.1:9002/tq"
|
|
44
|
-
url = "http://
|
|
44
|
+
url = "http://120.53.122.167:9002/tq"
|
|
45
45
|
|
|
46
46
|
params = {
|
|
47
47
|
'token': get_token(),
|
|
@@ -52,6 +52,7 @@ class pro_api:
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
+
|
|
55
56
|
response = requests.post(url, json=params)
|
|
56
57
|
|
|
57
58
|
if response.status_code == 200:
|
|
@@ -68,9 +69,9 @@ class pro_api:
|
|
|
68
69
|
raise ValueError("数据获取错误",e)
|
|
69
70
|
|
|
70
71
|
else:
|
|
71
|
-
print(f"Failed to fetch data. Status code: {response.status_code}")
|
|
72
|
-
print(response.text)
|
|
73
|
-
raise ValueError("数据获取错误",response.text)
|
|
72
|
+
# print(f"Failed to fetch data. Status code: {response.status_code}")
|
|
73
|
+
# print(response.text)
|
|
74
|
+
raise ValueError("数据获取错误",response.status_code,response.text)
|
|
74
75
|
|
|
75
76
|
|
|
76
77
|
|
|
@@ -772,7 +773,7 @@ def pro_bar(ts_code='', api=None, start_date='', end_date='', freq='D', asset='E
|
|
|
772
773
|
|
|
773
774
|
"""
|
|
774
775
|
# url = "http://127.0.0.1:9002/tp"
|
|
775
|
-
url = "http://
|
|
776
|
+
url = "http://120.53.122.167:9002/tp"
|
|
776
777
|
|
|
777
778
|
params = {
|
|
778
779
|
'token':get_token(),
|
|
@@ -813,6 +814,4 @@ def pro_bar(ts_code='', api=None, start_date='', end_date='', freq='D', asset='E
|
|
|
813
814
|
raise ValueError(e)
|
|
814
815
|
else:
|
|
815
816
|
|
|
816
|
-
|
|
817
|
-
print(response.text)
|
|
818
|
-
raise ValueError("数据获取错误")
|
|
817
|
+
raise ValueError("数据获取错误",response.status_code,response.text)
|
chinadata/example.py
CHANGED
|
@@ -8,27 +8,18 @@ pip install chinadata
|
|
|
8
8
|
import chinadata.ca_data as ts
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ts.set_token('
|
|
12
|
-
pro=ts.pro_api('
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# 你要测量的代码块
|
|
11
|
+
ts.set_token('5821074c7482c04e8d39da5c8313')
|
|
12
|
+
pro=ts.pro_api('d55821074c7482c04e8d39da5c8313')
|
|
17
13
|
|
|
18
14
|
# #查询当前所有正常上市交易的股票列表
|
|
19
|
-
data = pro.stock_basic(exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date'
|
|
15
|
+
data = pro.stock_basic(exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date')
|
|
20
16
|
print(data)
|
|
21
|
-
|
|
17
|
+
#
|
|
22
18
|
#
|
|
23
19
|
df = ts.pro_bar(ts_code='000007.SZ', start_date='20240817', end_date='20241215')
|
|
24
20
|
print(df)
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# pro = ts.pro_api()
|
|
29
|
-
|
|
30
22
|
df = pro.daily(ts_code='000001.SZ', start_date='20000701', end_date='20180718')
|
|
31
23
|
print(df)
|
|
32
24
|
|
|
33
25
|
|
|
34
|
-
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
chinadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
chinadata/ca_data.py,sha256=HWOAeHDQlplk-t84BU7ntaqVCSxFx9pp6YdIuCyd6HA,34525
|
|
3
|
+
chinadata/example.py,sha256=eKj2Hl5KVq9EJGWVY2ZoRJOqZ-p4yiSoFI-xVzdf8LA,575
|
|
4
|
+
chinadata/__pycache__/__init__.cpython-39.pyc,sha256=lKHpULD0OJDbXwp5XGcechnIx0op6A2wVR3j91dTffw,145
|
|
5
|
+
chinadata/__pycache__/ca_data.cpython-39.pyc,sha256=muqYg-MFjQrzr9bNHaLH0ToPeaNwdeWJiDoPnYBpZNQ,37842
|
|
6
|
+
chinadata-0.1.1.dist-info/METADATA,sha256=vRj6aYr2ntgkjtGvynJTeIRmTyBAozVC-Q33j0iFz-M,163
|
|
7
|
+
chinadata-0.1.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
8
|
+
chinadata-0.1.1.dist-info/top_level.txt,sha256=Ptxvu9uzRHP4kVGRf413KuwSvsY2mk_KgQJ6ssWwisU,10
|
|
9
|
+
chinadata-0.1.1.dist-info/RECORD,,
|
chinadata-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
chinadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
chinadata/ca_data.py,sha256=-XyIk8CrlWLQmWhGEe2r-2HrkOOMvtmlgMCSBb4BeE0,34580
|
|
3
|
-
chinadata/example.py,sha256=Sx6pB8iXaO802iXqjxK7YG0djJ4-xfCeEyxJsEdbp2U,662
|
|
4
|
-
chinadata/__pycache__/__init__.cpython-39.pyc,sha256=lKHpULD0OJDbXwp5XGcechnIx0op6A2wVR3j91dTffw,145
|
|
5
|
-
chinadata/__pycache__/ca_data.cpython-39.pyc,sha256=muqYg-MFjQrzr9bNHaLH0ToPeaNwdeWJiDoPnYBpZNQ,37842
|
|
6
|
-
chinadata-0.1.0.dist-info/METADATA,sha256=NY9kbc9LgET_2WROJ_eOdF4ezqMOkhBickwA6M-DK0A,163
|
|
7
|
-
chinadata-0.1.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
8
|
-
chinadata-0.1.0.dist-info/top_level.txt,sha256=Ptxvu9uzRHP4kVGRf413KuwSvsY2mk_KgQJ6ssWwisU,10
|
|
9
|
-
chinadata-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|