DMP SDK
饥荒管理平台 (DST Management Platform) Python SDK。
安装
pip install dmp-sdk-python
注意:SDK 版本必须与服务端版本保持一致。 接口定义随版本同步更新,版本不匹配可能导致请求失败。
快速开始
from dmp_sdk_python import DMPClient
# 初始化客户端(通过 token 认证)
client = DMPClient("http://your-server:80", "your-jwt-token")
# 链式调用: client.模块.方法()
users = client.user.list_users()
print(users.rows)
rooms = client.room.list()
print(rooms.rows)
room_info = client.rm.get(room_id=8)
print(room_info)
mods = client.mod.get_enabled(roomID=8, worldID=24)
print(mods)
sys_info = client.pt.os_info()
print(sys_info)
cpu_usage = client.dashboard.get_sys_info()['cpu']
print(cpu_usage)
模块一览
| 属性 | 简写 | 模块 | 说明 |
|---|---|---|---|
client.user |
client.u |
用户管理 | 用户CRUD、个人信息、菜单 |
client.dashboard |
client.db |
dashboard | 游戏控制、信息、连接码、大厅检测 |
client.room |
client.rm |
房间管理 | 房间CRUD、激活/停用、上传存档 |
client.mod |
client.md |
模组管理 | 搜索、下载、启用/禁用、配置 |
client.player |
client.pl |
玩家管理 | 在线玩家、名单、统计、聊天日志 |
client.tools |
client.tl |
工具 | 备份、公告、地图、令牌、快照 |
client.logs |
client.lg |
日志管理 | 日志查看、历史、清理、下载 |
client.platform |
client.pt |
平台管理 | 系统概览、版本、全局设置 |
特性
- 链式调用 —
client.模块.方法()风格,IDE 友好 - 错误处理 — 非 200 状态码抛出
DMPError异常 - 分页支持 — 列表接口返回
PaginatedResult对象,支持迭代和下标访问 - 文件下载 — 备份和日志支持保存到本地或返回原始 bytes
- 便捷方法 —
dashboard.startup_all()、player.add_admin()等语义化封装
切换语言
client.set_lang("en") # 英文
client.set_lang("zh") # 中文(默认)
切换令牌
client.set_token("new-jwt-token")
依赖
- Python >= 3.9
- requests >= 2.28
Metadata
Release files for dmp-sdk-python 3.1.5
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 |
|---|---|---|---|---|
| dmp_sdk_python-3.1.5.tar.gz | 15.0 kB | Without provenance | Details for dmp_sdk_python-3.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dmp_sdk_python-3.1.5-py3-none-any.whl | Python 3 | none | any | Details for dmp_sdk_python-3.1.5-py3-none-any.whl |
Total release size: 33.9 kB
Release files / dmp_sdk_python-3.1.5.tar.gz
| Download URL | dmp_sdk_python-3.1.5.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79f003730e7f440417b32cb18ffa398123c42a1a7d83e198548739812408eaff
|
|
BLAKE2b-256 checksum How to use checksums |
29e9b9b6193820806e0bcb6945e4e33e60327ea82f27c9f508d291001dabb2a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / dmp_sdk_python-3.1.5-py3-none-any.whl
| Download URL | dmp_sdk_python-3.1.5-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19524d181039ca2fbc1ad20e818fc2969eb378c18e87751388a8f0202360d78a
|
|
BLAKE2b-256 checksum How to use checksums |
b40cd83e3366eb9edabff2fc82017f90da8844e8629c08a23e3a501d9037374d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for dmp-sdk-python 3.1.5
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.