yop-python-sdk
本软件是易宝开放平台(YOP)的 Python 语言 SDK,力争同时支持 Python2/3。
Installation 安装方法
Minimum Requirements 最小系统要求
- Python 3.5+
- Python 2.7+ (不能保证停止维护的Python版本有效,请参考https://www.python.org/doc/sunset-python-2/)
Install from PyPI 从 PyPI 安装
生成虚拟环境
以 virtualenv 为例
pip install virtualenv
For python3
# rm -rf ~/python3
/usr/bin/env /usr/bin/python3 -m virtualenv ~/python3
source ~/python3/bin/activate
安装 yop-python-sdk
从仓库安装最新版本
python -m pip install yop-python-sdk
# crypto 相关的报错如何解决
python -m pip uninstall crypto pycrypto pycryptodome yop-python-sdk
python -m pip install pycryptodome
从指定仓库安装指定的版本
python -m pip install --upgrade --index-url https://pypi.org/simple yop-python-sdk==4.3.0
Install from source 从源码安装(不推荐)
python -m pip install git+https://github.com/yop-platform/yop-python-sdk.git
或者
git clone git@github.com:yop-platform/yop-python-sdk.git --depth=1
python setup.py install
Samples 示例
How to use 如何初始化 YopClient
采用默认配置文件:
from client.yopclient import YopClient
client = YopClient()
采用指定的配置文件:
from client.yopclient import YopClient
from client.yop_client_config import YopClientConfig
client = YopClient(YopClientConfig('config/yop_sdk_config_yours.json'))
Configure file Configure YopCredentials 采用配置文件中指定的 appKey 和私钥发起请求:
api = '/rest/v1.0/pay/bank-limit/query'
params = {
'merchantNo': '10000470992'
}
res = client.get(api=api, params=params)
Programmatically Configure YopCredentials 编码指定的 appKey 和私钥发起请求:
api = '/rest/v1.0/pay/bank-limit/query'
params = {
'merchantNo': '10000470992'
}
credentials = YopCredentials(appKey='<appKey>', cert_type='SM2|RSA2048', priKey='<私钥>')
res = client.get(api=api, params=params, credentials=credentials)
更多用法,请参考 test 目录下面的单元测试。
ImportError: bad magic number in 'xxx'
rm -Rf **/*.pyc
Contributing
Contributions are welcome! Check out the Contribution Guide.
License 协议
The code in this project is released under the Apache 2.0.
Metadata
Release files for yop-python-sdk 4.3.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 | Provenance | Actions |
|---|---|---|---|---|
| yop_python_sdk-4.3.0.tar.gz | 52.3 kB | Without provenance | Details for yop_python_sdk-4.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yop_python_sdk-4.3.0-py3-none-any.whl | Python 3 | none | any | Details for yop_python_sdk-4.3.0-py3-none-any.whl |
Total release size: 122.4 kB
Release files / yop_python_sdk-4.3.0.tar.gz
| Download URL | yop_python_sdk-4.3.0.tar.gz |
|---|---|
| Size | 52.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14ca1cc1176a32baadd5c0572c1a90f921b4eecf7a26fcd3d284a7e3507fb4c1
|
|
BLAKE2b-256 checksum How to use checksums |
668c01e957a503028ea879d8d93000910c8c17e8e29c771c20e43822afa635a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / yop_python_sdk-4.3.0-py3-none-any.whl
| Download URL | yop_python_sdk-4.3.0-py3-none-any.whl |
|---|---|
| Size | 70.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c464dedf8fa6fc4e1c56e9f83f993def4f2b5c9cdcc9350b77c0f4dcf2165d8b
|
|
BLAKE2b-256 checksum How to use checksums |
ac2996f6ec04c552e88774dd97aee38acbcff700a3551732909a8f49257a0a3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for yop-python-sdk 4.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.