chinadata 0.0.1__py3-none-any.whl → 0.0.2__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/example.py +16 -6
- chinadata/pp.py +2 -2
- chinadata/qq.py +1 -1
- {chinadata-0.0.1.dist-info → chinadata-0.0.2.dist-info}/METADATA +1 -1
- chinadata-0.0.2.dist-info/RECORD +8 -0
- chinadata-0.0.1.dist-info/RECORD +0 -8
- {chinadata-0.0.1.dist-info → chinadata-0.0.2.dist-info}/WHEEL +0 -0
- {chinadata-0.0.1.dist-info → chinadata-0.0.2.dist-info}/top_level.txt +0 -0
chinadata/example.py
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
#d
|
|
2
|
+
"""
|
|
3
|
+
1、安装对应库
|
|
4
|
+
pip install chinadata
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
"""
|
|
7
|
+
#2、如果使用通用行情接口,
|
|
8
|
+
from chinadata.pp import get_bar_data
|
|
9
|
+
df = get_bar_data(token='9e84ed87f29cf43fc70b5198b1e4cd4093',ts_code='150018.SZ', start_date='20180101', end_date='20181029',asset='FD')
|
|
10
|
+
print(df)
|
|
11
|
+
#3、如果使用其他接口(例如接口名称为stock_basic),其他参数一致,请填写参数api_name='stock_basic'
|
|
12
|
+
from chinadata.qq import get_query_data
|
|
13
|
+
#基础信息
|
|
14
|
+
df = get_query_data(token='9e84ed87f29cf43fc70b5198b1e4cd4093',api_name='stock_basic',fields='ts_code,symbol,name,area,industry,list_date',exchange='', )
|
|
5
15
|
print(df)
|
|
6
16
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
df = fetch_stock_data(token='41aed146ecf59f5b7628bc6fcacf675104',api_name='stock_basic',fields='ts_code,symbol,name,area,industry,list_date',exchange='', list_status='L', )
|
|
17
|
+
#日线接口
|
|
18
|
+
df = get_query_data(api_name='daily',token='9e84ed87f29cf43fc70b5198b1e4cd4093', ts_code='000001.SZ', start_date='20180701', end_date='20180718')
|
|
10
19
|
print(df)
|
|
20
|
+
|
chinadata/pp.py
CHANGED
|
@@ -6,7 +6,7 @@ warnings.simplefilter(action='ignore', category=FutureWarning)#消除告警
|
|
|
6
6
|
import requests
|
|
7
7
|
import pandas as pd
|
|
8
8
|
|
|
9
|
-
def
|
|
9
|
+
def get_bar_data(token,ts_code='', api=None, start_date='', end_date='', freq='D', asset='E',
|
|
10
10
|
exchange='',
|
|
11
11
|
adj = None,
|
|
12
12
|
ma = [],
|
|
@@ -19,7 +19,7 @@ def get_stock_data(token,ts_code='', api=None, start_date='', end_date='', freq=
|
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
"""
|
|
22
|
-
# url = "http://127.0.
|
|
22
|
+
# url = "http://127.0.0.1:9002/tp"
|
|
23
23
|
url = "http://152.136.171.135:9002/tp"
|
|
24
24
|
params = {
|
|
25
25
|
'token':token,
|
chinadata/qq.py
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
chinadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
chinadata/example.py,sha256=tQx3-Nq4iBnzNmGOy42m7WhUh-Zgkp2IelO80RWJvaM,816
|
|
3
|
+
chinadata/pp.py,sha256=bOQk0M3MVJuFi8nS6j-YKOFL4-ye4xXZgGT1aQMbR9Y,1662
|
|
4
|
+
chinadata/qq.py,sha256=JVrJYdgln2GEWx0s86rK89hQrSmq2Afjuddu3j-X-pQ,1952
|
|
5
|
+
chinadata-0.0.2.dist-info/METADATA,sha256=JZcPi047CaCdGkkX_DqcWrlesihZTM8MlWJjEWL7L0I,163
|
|
6
|
+
chinadata-0.0.2.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
7
|
+
chinadata-0.0.2.dist-info/top_level.txt,sha256=Ptxvu9uzRHP4kVGRf413KuwSvsY2mk_KgQJ6ssWwisU,10
|
|
8
|
+
chinadata-0.0.2.dist-info/RECORD,,
|
chinadata-0.0.1.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
chinadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
chinadata/example.py,sha256=ebiZrMrz3eCln1FHamHERnd-ZoBjTlCInNNTLQpI11A,453
|
|
3
|
-
chinadata/pp.py,sha256=BYvI9cMFXPl3PyfBWJXMAuiW_g1MXvhYE50oUyf7CNY,1663
|
|
4
|
-
chinadata/qq.py,sha256=rVAlpYx_6YxPq2X60EhJBeWKjPmJWBYRTQR12V6Bi9Y,1954
|
|
5
|
-
chinadata-0.0.1.dist-info/METADATA,sha256=16jbxy5vNdFZ2PrTPEj3RF6yDW_E3pFUz_Pl7jL8Ktg,163
|
|
6
|
-
chinadata-0.0.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
7
|
-
chinadata-0.0.1.dist-info/top_level.txt,sha256=Ptxvu9uzRHP4kVGRf413KuwSvsY2mk_KgQJ6ssWwisU,10
|
|
8
|
-
chinadata-0.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|