fa45d8aa5f
- health_checklist.json: 192.168.1.122→node122
- ocr_client.py: docstring IP→node122
- docs/market-data-requirements.md: IP→node122
- 所有API调用通过ProxyHandler({})绕过系统代理
Privoxy对node122:18003返回500,直连正常
31 lines
831 B
Python
31 lines
831 B
Python
#!/usr/bin/env python
|
|
# -*- coding:utf-8 -*-
|
|
"""
|
|
Date: 2019/11/10 22:52
|
|
Desc: 数据接口初始化
|
|
"""
|
|
|
|
from akshare.pro import client
|
|
from akshare.utils import token_process
|
|
|
|
|
|
def pro_api(token=""):
|
|
"""
|
|
初始化 pro API,第一次可以通过ak.set_token('your token')来记录自己的token凭证,临时token可以通过本参数传入
|
|
"""
|
|
if token == "" or token is None:
|
|
token = token_process.get_token()
|
|
if token is not None and token != "":
|
|
pro = client.DataApi(token)
|
|
return pro
|
|
else:
|
|
raise Exception("api init error.")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
pro_test = pro_api()
|
|
variety_all_df = pro_test.variety_all()
|
|
print(variety_all_df)
|
|
variety_no_futures_df = pro_test.variety_no_futures(symbol="RB", date="2018-08-08")
|
|
print(variety_no_futures_df)
|