
Croupier Python SDK
Python SDK for Croupier Game Backend Platform
简单易用
Pythonic API 设计
异步支持
基于 asyncio 的异步处理
类型提示
完整的类型注解
简介
Croupier Python SDK 是 Croupier 的 Python 客户端实现。
安装
pip install croupier-sdk
快速开始
from croupier_sdk import CroupierClient, ClientConfig
config = ClientConfig(
agent_addr="localhost:19090",
game_id="my-game",
env="development",
insecure=True,
)
client = CroupierClient(config)
def hello_handler(ctx, payload):
return {"message": "Hello from Python!"}
client.register_function({
"id": "hello.world",
"version": "0.1.0",
}, hello_handler)
client.serve()