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.2.0.tar.gz (31.4 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.2.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ks_shop_python_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e7e717b96ec68d7d218cdb9700a78112b46c69e9bcded991c038bc0b88471094
MD5 533d58b1b1a1d4518144b4b915079f23
BLAKE2b-256 63f18dcf8dc1d9c9cf107bbdc389fa795296b6c68c2b185e1c70a4bd70fb1c80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ks_shop_python_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a18715e003be07a64ea51d0f35a4b231f723ee8ec7fec26fbbea3322e5d1e6c8
MD5 72d3ed2557fb306e68d7576f83471098
BLAKE2b-256 6b07cc830515489356a64b1bfef42b97212c449e8e76dd73b51fe06f79e5255b

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