调用 DIRestPlus 接口,实现Wind、iFinD、Choice接口调用
Project description
# DIRestInvoker
调用 [DIRestPlus](https://github.com/DataIntegrationAlliance/DIRestPlus) 接口,实现Wind、iFinD、Choice接口调用
## iFinD接口调用举例
```python
from direstinvoker.ifind import IFinDInvoker, APIError
url_str = "http://localhost:5000/iFind/"
invoker = IFinDInvoker(url_str)
```
### THS_DateQuery
```python
try:
data_df = invoker.THS_DateQuery('SSE', 'dateType:0,period:D,dateFormat:0', '2018-06-15', '2018-06-21')
print(data_df)
except APIError as exp:
if exp.status == 500:
print('APIError.status:', exp.status, exp.ret_dic['message'])
else:
print(exp.ret_dic.setdefault('error_code', ''), exp.ret_dic['message'])
```
调用 [DIRestPlus](https://github.com/DataIntegrationAlliance/DIRestPlus) 接口,实现Wind、iFinD、Choice接口调用
## iFinD接口调用举例
```python
from direstinvoker.ifind import IFinDInvoker, APIError
url_str = "http://localhost:5000/iFind/"
invoker = IFinDInvoker(url_str)
```
### THS_DateQuery
```python
try:
data_df = invoker.THS_DateQuery('SSE', 'dateType:0,period:D,dateFormat:0', '2018-06-15', '2018-06-21')
print(data_df)
except APIError as exp:
if exp.status == 500:
print('APIError.status:', exp.status, exp.ret_dic['message'])
else:
print(exp.ret_dic.setdefault('error_code', ''), exp.ret_dic['message'])
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
DIRestInvoker-0.0.1.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for DIRestInvoker-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f036292bf0745041aca2ec48eaa57a118c3b749c074df0a7932937f5fd822e9a |
|
MD5 | a5195896ee5e948d8d8a55c39b4bc328 |
|
BLAKE2b-256 | 908877fb0cf2c5317d32997f077988038baaac78d25d6fcf3c7b58cf69473d7d |