Python SDK for the Keruyun (客如云) restaurant POS open platform API
Project description
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。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 keruyun_sdk-0.1.0.tar.gz.
File metadata
- Download URL: keruyun_sdk-0.1.0.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b176d36a2607d506268b18030a0ea7382b298113dd42c40b397e2de8cbdb627c
|
|
| MD5 |
4b54d11f4661426eb588204b5f0f1ad0
|
|
| BLAKE2b-256 |
6a047588daddfc1b02e3225ddc5b2be8335e9fbde313310db5ff95fafdd29ad0
|
File details
Details for the file keruyun_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: keruyun_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bedef7040b752a9c67bb90b66ad9a024155e2de54c6fccf1e23d7ab4c93e34d5
|
|
| MD5 |
830b960568edb77c92e87d25d580a153
|
|
| BLAKE2b-256 |
0146d20752bb6d3d35f1dc95c477fc456666ad6c4f2aec1ac6cc925cbcd094fe
|