调用 DIRestPlus 接口,实现Wind、iFinD、Choice接口调用
Project description
# DIRestInvoker
[![Build Status](https://travis-ci.org/DataIntegrationAlliance/DIRestInvoker.svg?branch=master)](https://travis-ci.org/DataIntegrationAlliance/DIRestInvoker)
[![GitHub issues](https://img.shields.io/github/issues/DataIntegrationAlliance/DIRestInvoker.svg)](https://github.com/DataIntegrationAlliance/DIRestInvoker/issues)
[![GitHub forks](https://img.shields.io/github/forks/DataIntegrationAlliance/DIRestInvoker.svg)](https://github.com/DataIntegrationAlliance/DIRestInvoker/network)
[![GitHub stars](https://img.shields.io/github/stars/DataIntegrationAlliance/DIRestInvoker.svg)](https://github.com/DataIntegrationAlliance/DIRestInvoker/stargazers)
[![GitHub license](https://img.shields.io/github/license/DataIntegrationAlliance/DIRestInvoker.svg)](https://github.com/DataIntegrationAlliance/DIRestInvoker/blob/master/LICENSE)
[![HitCount](http://hits.dwyl.io/DataIntegrationAlliance/https://github.com/DataIntegrationAlliance/DIRestInvoker.svg)](http://hits.dwyl.io/DataIntegrationAlliance/https://github.com/DataIntegrationAlliance/DIRestInvoker)
[![Twitter](https://img.shields.io/twitter/url/https/github.com/DataIntegrationAlliance/DIRestInvoker.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FDataIntegrationAlliance%2FDIRestInvoker)
Data Integration RESTPlus Invoker,调用 [DIRestPlus](https://github.com/DataIntegrationAlliance/DIRestPlus) 接口,实现Wind、iFinD、Choice接口调用
## 安装
```commandline
pip install DIRestInvoker
```
## 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'])
```
## 修改历史
* version 0.1.4
> THS_BasicData 支持 list 作为 thsCode 参数,并且支持按一定数量自动分割发送(解决大批量数据请求的情况下,20W数字限制,可能引发-205错误的问题)
----
项目地址:[DIRestInvoker](https://github.com/DataIntegrationAlliance/DIRestInvoker)
[![Build Status](https://travis-ci.org/DataIntegrationAlliance/DIRestInvoker.svg?branch=master)](https://travis-ci.org/DataIntegrationAlliance/DIRestInvoker)
[![GitHub issues](https://img.shields.io/github/issues/DataIntegrationAlliance/DIRestInvoker.svg)](https://github.com/DataIntegrationAlliance/DIRestInvoker/issues)
[![GitHub forks](https://img.shields.io/github/forks/DataIntegrationAlliance/DIRestInvoker.svg)](https://github.com/DataIntegrationAlliance/DIRestInvoker/network)
[![GitHub stars](https://img.shields.io/github/stars/DataIntegrationAlliance/DIRestInvoker.svg)](https://github.com/DataIntegrationAlliance/DIRestInvoker/stargazers)
[![GitHub license](https://img.shields.io/github/license/DataIntegrationAlliance/DIRestInvoker.svg)](https://github.com/DataIntegrationAlliance/DIRestInvoker/blob/master/LICENSE)
[![HitCount](http://hits.dwyl.io/DataIntegrationAlliance/https://github.com/DataIntegrationAlliance/DIRestInvoker.svg)](http://hits.dwyl.io/DataIntegrationAlliance/https://github.com/DataIntegrationAlliance/DIRestInvoker)
[![Twitter](https://img.shields.io/twitter/url/https/github.com/DataIntegrationAlliance/DIRestInvoker.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FDataIntegrationAlliance%2FDIRestInvoker)
Data Integration RESTPlus Invoker,调用 [DIRestPlus](https://github.com/DataIntegrationAlliance/DIRestPlus) 接口,实现Wind、iFinD、Choice接口调用
## 安装
```commandline
pip install DIRestInvoker
```
## 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'])
```
## 修改历史
* version 0.1.4
> THS_BasicData 支持 list 作为 thsCode 参数,并且支持按一定数量自动分割发送(解决大批量数据请求的情况下,20W数字限制,可能引发-205错误的问题)
----
项目地址:[DIRestInvoker](https://github.com/DataIntegrationAlliance/DIRestInvoker)
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.2.2.tar.gz
(17.0 kB
view details)
Built Distribution
File details
Details for the file DIRestInvoker-0.2.2.tar.gz
.
File metadata
- Download URL: DIRestInvoker-0.2.2.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79d55085bdaae91b32c50d7c635ecb95732748987670f954dd124c29414ba410 |
|
MD5 | 68edc3f084622d31373a90bba6ce36dd |
|
BLAKE2b-256 | ee1bedcc2961683a31b218c105f323d9bf1edb32dd984d95da25f19a64420eae |
File details
Details for the file DIRestInvoker-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: DIRestInvoker-0.2.2-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 965f0acc1af868c45fbb0382e4a0c8ae4011697faf530e6c9ba8b671d3e21575 |
|
MD5 | ac7a0ef1a147d3ac3c5646a4853c4835 |
|
BLAKE2b-256 | 35abc49f1d245e23ba56737241ddde3bde8e904274bb57c717881f7dbc015045 |