Kuaishou Shop Python SDK
Project description
安装
pip install ks-shop-python-sdk
获取access_token
from ks_shop_api.utils import get_access_token_by_code, refresh_access_token
app_id = "xxxx" # 应用ID
app_secret = "xxxx" # 应用密钥
code = "xxxx" # 首次授权通过回调地址中的code
first_res = get_access_token_by_code(app_id, app_secret, code)
print(first_res)
refresh_token = "xxxxx" # 刷新令牌
refresh_res = refresh_access_token(app_id, app_secret, refresh_token)
print(refresh_res)
使用
from ks_shop_api.funds.request import OpenFundsCenterAccountInfoRequest
from ks_shop_api.funds.schema import OpenFundsCenterAccountInfoSchema
from ks_shop_api.schema import baseAppInfoSchema
access_token = 'xxxx'
base_app_info = baseAppInfoSchema()
base_app_info.app_key = "xxxx"
base_app_info.secret = "xxxx"
base_app_info.sign_secret = "xxxx"
print(base_app_info)
ks_obj = OpenFundsCenterAccountInfoRequest(**base_app_info.model_dump())
ks_schema = OpenFundsCenterAccountInfoSchema()
print(ks_schema)
print(ks_schema.model_dump())
res = ks_obj.getResponse(access_token, params=ks_schema)
print(res)
######或者 dict########
access_token = 'xxxx'
app_info = {
"app_key": "xxxx",
"secret": "xxxx",
"sign_secret": "xxxx"
}
ks_obj: RestApi = OpenFundsCenterAccountInfoRequest(**app_info)
params = {}
res = ks_obj.getResponse(access_token, params=params)
print(res)
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
ks_shop_python_sdk-0.2.1.tar.gz
(58.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ks_shop_python_sdk-0.2.1.tar.gz.
File metadata
- Download URL: ks_shop_python_sdk-0.2.1.tar.gz
- Upload date:
- Size: 58.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fe065f37116d325e94803685cc0f22f6a1b01512f31528e76246b7a42aa0201
|
|
| MD5 |
0007c23a923b878e7267c6facc78a6a3
|
|
| BLAKE2b-256 |
93a6d68e33af97a82cafc88f2862a4a95459e6d743e064373e23e0641c797d55
|
File details
Details for the file ks_shop_python_sdk-0.2.1-py3-none-any.whl.
File metadata
- Download URL: ks_shop_python_sdk-0.2.1-py3-none-any.whl
- Upload date:
- Size: 71.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22c3733322d2c0af3869f54af0e31aa5d4805ac723d08fedb5489f05a122bb6f
|
|
| MD5 |
329abe6523269b0f1ca039c793c3b4d8
|
|
| BLAKE2b-256 |
e4f6f68ee1d8b80e6877ae40465e76de563beef359cc3364f3b1139677f43866
|