Skip to main content

畅捷通开放平台python版sdk

Project description

chanjet-open-sdk

欢迎使用 Chanjet Open SDK for Python

环境要求

  1. Chanjet Open SDK for Python 需要配合Python 3.8或其以上版本。

  2. 使用 Chanjet Open SDK for Python 之前 ,您需要先前往畅捷通-开发者中心完成开发者接入的一些准备工作,包括创建应用、获取应用的appKey和appSecret。

安装依赖

推荐通过pip下载

pip install chanjet-openapi-python-sdk

快速使用

import logging

from chanjet_openapi_python_sdk.chanjet_client import ChanjetClient
from chanjet_openapi_python_sdk.request.tplus.query_inventory_request import QueryInventoryRequest
from chanjet_openapi_python_sdk.response.tplus.query_inventory_response import QueryInventoryResponse
from chanjet_openapi_python_sdk.content.tplus.query_inventory_content import QueryInventoryContent
from chanjet_openapi_python_sdk.utils.chanjet_logger import ChanjetLogger


def query_inventory_demo():
    req = QueryInventoryRequest()
    req.request_uri = '/tplus/api/v2/inventory/Query'
    # 推荐使用字典传值方式,直接传实体实例会有一定的性能损耗
    # req.content = {'param': {'Code': '123'}}
    req.content = QueryInventoryContent('124', '123', False, True)
    # 支持将返回值解析成实体类属性,如果不传入实体类名,则按照json的格式进行转换成字典、列表、字符串等
    result = client.execute(req, QueryInventoryResponse)
    return result

if __name__ == '__main__':
    # 设置自定义日志配置
    ChanjetLogger(logging.INFO)

    client = ChanjetClient('https://openapi.chanjet.com')
    # 请填入您从开放平台申请下来的appKey
    client.app_key = 'A******8'
    # 请填入您从开放平台申请下来的appSecret
    client.app_secret = '9****************8'
    # 请填入您的开放平台openToken
    client.open_token = """e****************************************************************************k"""

    # 查询存货
    res = query_inventory_demo()

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

chanjet-openapi-python-sdk-1.0.2.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

chanjet_openapi_python_sdk-1.0.2-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

Details for the file chanjet-openapi-python-sdk-1.0.2.tar.gz.

File metadata

  • Download URL: chanjet-openapi-python-sdk-1.0.2.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.7

File hashes

Hashes for chanjet-openapi-python-sdk-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d459087b3a8cfae477c4d142df00f829a393f81a499275a41655a923f415d6de
MD5 5f87ffef8bd59ca4a932879dafacff4d
BLAKE2b-256 96afb131f8968bdf77d8619a9423a48ae9fa7abf13a369b0c1ac665a4555d11a

See more details on using hashes here.

File details

Details for the file chanjet_openapi_python_sdk-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: chanjet_openapi_python_sdk-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.7

File hashes

Hashes for chanjet_openapi_python_sdk-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a869ed28b7bfbde4a30ca5394592ff44911c34d2264803362bb081d51262963
MD5 5fbb040c5a715823363f25c90553fc80
BLAKE2b-256 0b1f7972a4a6fd1f3b841614c6c8184fbafea49941e4ef6620bfe6dd7c45747c

See more details on using hashes here.

Supported by

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