Skip to main content

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.3.0.tar.gz (71.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ks_shop_python_sdk-0.3.0-py3-none-any.whl (92.0 kB view details)

Uploaded Python 3

File details

Details for the file ks_shop_python_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: ks_shop_python_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 71.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for ks_shop_python_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6a6cfa2333c2cc668fa91708dc6c72feb1f9ccd9f3aa95069751232bdadf43ca
MD5 0fac56f491e42854073639be2460864c
BLAKE2b-256 9b5d6c9ca8eb7a00fc383055b7a2e3b96ee006f9d1433a41c38f5731750b44ba

See more details on using hashes here.

File details

Details for the file ks_shop_python_sdk-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ks_shop_python_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 296f88468f6e54eb6d3b5a12bd59a0c2858c7acf98e2d1636cd3a3152ddca2e7
MD5 113df56fa21b516ca9e0be995d488690
BLAKE2b-256 c4c174de2af2c4fbdb03a3e9f09b90c96dac4d5867b731c6860a66fa3ee2572f

See more details on using hashes here.

Supported by

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