Skip to main content

Yunpian Python SDK

Project description

云片 SDK

快速开始

  • 安装SDK

    pip install yunpian-python-sdk

    : master是最新稳定版,发布版本见PyPI

  • 使用YunpianClient

    from yunpian_python_sdk.model import constant as YC
    from yunpian_python_sdk.ypclient import YunpianClient
    # 初始化client,apikey作为所有请求的默认值
    clnt = YunpianClient('apikey')
    param = {YC.MOBILE:'18616020***',YC.TEXT:'【云片网】您的验证码是1234'}
    r = clnt.sms().single_send(param)
    # 获取返回结果, 返回码:r.code(),返回码描述:r.msg(),API结果:r.data(),其他说明:r.detail(),调用异常:r.exception()
    # 短信:clnt.sms() 账户:clnt.user() 签名:clnt.sign() 模版:clnt.tpl() 语音:clnt.voice() 流量:clnt.flow()

: v1.0.0不兼容之前版本0.0.8

配置说明 (默认配置就行)

  • 构造器配置

    • YunpianClient('apikey')

    • YunpianClient('apikey',conf), conf字典key详见model.constant.YP_*

  • apikey的优先级:接口的param[APIKEY] > 构造器的apikey > 构造器的conf[YP_APIKEY]

源码说明

  • 接口方法参数的apikey默认传入`YunpianClient`构造时的apikey

  • 接口默认使用v2版本,可以在调用时指定版本,如clnt.sms().version('v1').single_send(param)

  • API单元测试目录tests,支持tox.ini

  • 分支说明: master是最新发布版本,develop是待发布的分支(开源贡献可以pull request到develop分支)

联系我们

云片支持 QQ

SDK开源QQ群: 106469530

docs/sdk_qq.jpeg

文档链接

其他SDK

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

yunpian-python-sdk-0.1.3.tar.gz (63.4 kB view details)

Uploaded Source

Built Distribution

yunpian_python_sdk-0.1.3-py2.py3-none-any.whl (28.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file yunpian-python-sdk-0.1.3.tar.gz.

File metadata

File hashes

Hashes for yunpian-python-sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 01a8d9c54b235562d5706c122a8f55a57af1c6ee234f03616d2b87ddd81797e0
MD5 7027c7b3445cb94f8db3550e0fb7e5bb
BLAKE2b-256 7cb4bb6ce043d3163cad20bb60374c6275eb20b87721852f07a2c70b852a6ea2

See more details on using hashes here.

File details

Details for the file yunpian_python_sdk-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for yunpian_python_sdk-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 673592ab92d1774b09e54d42a764bb2121b18589dc0f7ebf896b7feba9426d3a
MD5 bade12819b080e84654e24a40a01d712
BLAKE2b-256 3f3fda45043602557fe6d1e2d48054a8d9533c7e57e3d3a9855c8f5f0dbb90a2

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