keruyun-sdk-python
Python SDK for the Keruyun (客如云) restaurant POS open platform API.
Disclaimer: This is an unofficial, community-maintained SDK. 客如云 is a trademark of Beijing Keruyun Technology Co., Ltd. This project is not affiliated with or endorsed by Keruyun.
Features
- Report — daily revenue, menu sales, payment breakdown, shop-level flow
- Shop — store list and detail queries
- Order — order list and detail lookups
- Supply — inventory, BOM, procurement prediction, and more (8 endpoints)
- Automatic token management and caching
- SHA256 request signing per Keruyun spec
Installation
pip install keruyun-sdk
For development:
git clone https://github.com/Horacehxw/keruyun-sdk-python.git
cd keruyun-sdk-python
pip install -e ".[dev]"
Quick Start
from keruyun import KeruyunClient
client = KeruyunClient(
app_key="your_app_key",
app_secret="your_app_secret",
)
# Brand-level daily report
result = client.report.get_daily_flow(brand_id=YOUR_BRAND_ID, date="2026-03-15")
# Shop-level data
result = client.report.get_shop_flow(shop_id=YOUR_SHOP_ID, date="2026-03-15")
# Store list
shops = client.shop.get_shop_list(brand_id=YOUR_BRAND_ID)
# Supply chain - inventory
inventory = client.supply.get_inventory(brand_id=YOUR_BRAND_ID, shop_id=YOUR_SHOP_ID)
You'll need API credentials from the Keruyun Open Platform.
API Modules
| Module | Endpoints | Description |
|---|---|---|
report |
5 | Revenue, menu sales, payment stats |
shop |
2 | Store list and detail |
order |
2 | Order list and detail |
supply |
8 | Inventory, BOM, procurement |
Testing
# Unit tests (no API key needed)
pytest -v
# Integration tests (requires real credentials)
pytest -v -m integration
License
中文说明
客如云开放平台 Python SDK,支持报表、门店、订单、供应链等 17 个 API 接口。
安装:
pip install keruyun-sdk
特性:
- 自动 token 管理和缓存
- SHA256 签名(符合客如云规范)
- 37 个单元测试,100% mock,无需真实凭据即可运行
- 支持品牌级和门店级数据查询
使用前需要: 在客如云开放平台注册并获取 app_key 和 app_secret。
Metadata
Release files for keruyun-sdk 0.1.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 |
|---|---|---|---|---|
| keruyun_sdk-0.1.0.tar.gz | 19.0 kB | Without provenance | Details for keruyun_sdk-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| keruyun_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for keruyun_sdk-0.1.0-py3-none-any.whl |
Total release size: 33.5 kB
Release files / keruyun_sdk-0.1.0.tar.gz
| Download URL | keruyun_sdk-0.1.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b176d36a2607d506268b18030a0ea7382b298113dd42c40b397e2de8cbdb627c
|
|
BLAKE2b-256 checksum How to use checksums |
6a047588daddfc1b02e3225ddc5b2be8335e9fbde313310db5ff95fafdd29ad0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / keruyun_sdk-0.1.0-py3-none-any.whl
| Download URL | keruyun_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bedef7040b752a9c67bb90b66ad9a024155e2de54c6fccf1e23d7ab4c93e34d5
|
|
BLAKE2b-256 checksum How to use checksums |
0146d20752bb6d3d35f1dc95c477fc456666ad6c4f2aec1ac6cc925cbcd094fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Security for keruyun-sdk 0.1.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.