云片 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
分支说明: master是最新发布版本,develop是待发布的分支(开源贡献可以pull request到develop分支)
联系我们
SDK开源QQ群: 106469530
文档链接
其他SDK
Metadata
Release files for yunpian-python-sdk 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yunpian-python-sdk-1.0.0.tar.gz | 63.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yunpian_python_sdk-1.0.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 91.7 kB
Release files / yunpian-python-sdk-1.0.0.tar.gz
| Download URL | yunpian-python-sdk-1.0.0.tar.gz |
|---|---|
| Size | 63.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94a2d7af51683e1c75f4b15d06348f08aab0bcc50b5d7bd1ac8e9bb8c1fbbbf6
|
|
BLAKE2b-256 checksum How to use checksums |
e7f58069a90bc119cd7830c8cd47cf4e7b10f012179554d3677d9bf4aa1e8c51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / yunpian_python_sdk-1.0.0-py2.py3-none-any.whl
| Download URL | yunpian_python_sdk-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 28.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c2e55a9634d596dc7684a6abcb0c74b5683e4b85d4d51989f1c701bc0e45c244
|
|
BLAKE2b-256 checksum How to use checksums |
450e97a4a1f85b2082837e87f6d4e9ad2310ec8a2c4662bf907403690ed68e42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |