Skip to main content

可用于调用 BGE 开放平台的相关接口。

Project description

BGE 开放平台 SDK - Python 版

GitHub forks GitHub forks GitHub forks

GitHub release (latest by date) GitHub top language GitHub code size in bytes GitHub commit activity PyPI - Downloads

安装

推荐使用 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


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 details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bge_python_sdk-0.1a1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

bge_python_sdk-0.1a1-py2-none-any.whl (16.1 kB view details)

Uploaded Python 2

File details

Details for the file bge-python-sdk-0.1a1.tar.gz.

File metadata

  • Download URL: bge-python-sdk-0.1a1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.5

File hashes

Hashes for bge-python-sdk-0.1a1.tar.gz
Algorithm Hash digest
SHA256 0ab4bfa0ebe753c42dd45c1936329b422f3bf206fbd00a6b75de09580c72ed38
MD5 5d400b3fa44d1952b4e39db161a93de6
BLAKE2b-256 a2e16f1286fd1b02a32b4fc7b3e56be18809f823f984c73915c7dce8347ec02b

See more details on using hashes here.

File details

Details for the file bge_python_sdk-0.1a1-py3-none-any.whl.

File metadata

  • Download URL: bge_python_sdk-0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.5

File hashes

Hashes for bge_python_sdk-0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 b62201996c9fa8cb3f2ede317bb50d813021cb89e13c01814d32f71b9cf646fe
MD5 5ba893a1579b091972085da0e7e1af50
BLAKE2b-256 677d58cfe2280579478276832eb5f702be9c831491356bcb552a99796d45b805

See more details on using hashes here.

File details

Details for the file bge_python_sdk-0.1a1-py2-none-any.whl.

File metadata

  • Download URL: bge_python_sdk-0.1a1-py2-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.5

File hashes

Hashes for bge_python_sdk-0.1a1-py2-none-any.whl
Algorithm Hash digest
SHA256 38a5efd4476c947ad33e581ff8ca5db64889fa6dbb8d90c2309ffac616879c98
MD5 9e19700e3a3f5a1e568515695080c788
BLAKE2b-256 1d9fd8a6cd8c8d3bc5c23edf2c000f877cbc823c6191a05acba81c9c34889969

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page