可用于调用 BGE 开放平台的相关接口。
Project description
安装
推荐使用 pip 进行安装
$ pip install bgesdk
或者
$ cd <BGE_PYTHON_SDK>/
$ make install
运行单元测试
$ pip install pytest
$ cd <BGE_PYTHON_SDK>/
$ make test
生成本地文档
$ pip install sphinx sphinx_rtd_theme
$ cd <BGE_PYTHON_SDK>/
$ make apidoc
快速开始
BGE 开放平台支持 OAuth2 的两种模式,分别是用户授权模式、客户端模式。
详情请参考开放平台文档 https://api.bge.genomics.cn/doc。
用户授权模式
from bgesdk import OAuth2
code = '???????' # 用户确认授权后平台返回的授权码
client_id = 'demo'
client_secret = 'demo'
redirect_uri = 'http://test.cn'
oauth2 = OAuth2(client_id, client_secret)
token = oauth2.exchange_authorization_code(code, redirect_uri)
api = oauth2.get_api(token.access_token)
print(api.get_user())
客户端模式
from bgesdk import OAuth2
client_id = 'demo'
client_secret = 'demo'
oauth2 = OAuth2(client_id, client_secret)
token = oauth2.get_credentials_token()
api = oauth2.get_api(token.access_token)
print(api.get_variants('E-B1243433', 'rs333'))
Contributors
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
bge-python-sdk-0.1a1.tar.gz
(12.4 kB
view hashes)
Built Distributions
Close
Hashes for bge_python_sdk-0.1a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b62201996c9fa8cb3f2ede317bb50d813021cb89e13c01814d32f71b9cf646fe |
|
MD5 | 5ba893a1579b091972085da0e7e1af50 |
|
BLAKE2b-256 | 677d58cfe2280579478276832eb5f702be9c831491356bcb552a99796d45b805 |
Close
Hashes for bge_python_sdk-0.1a1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38a5efd4476c947ad33e581ff8ca5db64889fa6dbb8d90c2309ffac616879c98 |
|
MD5 | 9e19700e3a3f5a1e568515695080c788 |
|
BLAKE2b-256 | 1d9fd8a6cd8c8d3bc5c23edf2c000f877cbc823c6191a05acba81c9c34889969 |