Skip to main content

DMP SDK

饥荒管理平台 (DST Management Platform) Python SDK。

PyPI - Downloads PyPI - Version PyPI - License PyPI - Status PyPI - Format

安装

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.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dmp-sdk-python 3.1.6
File Size Uploaded Provenance Actions
dmp_sdk_python-3.1.6.tar.gz 15.1 kB Without provenance Details for dmp_sdk_python-3.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dmp-sdk-python 3.1.6
File Interpreter ABI Platform Actions
dmp_sdk_python-3.1.6-py3-none-any.whl Python 3 none any Details for dmp_sdk_python-3.1.6-py3-none-any.whl

Total release size: 34.3 kB

Release files / dmp_sdk_python-3.1.6.tar.gz

Download URL dmp_sdk_python-3.1.6.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2a960211274d7db67c43f89f88db8ecb761a47f6d449f08044757f0c29e5ff50
BLAKE2b-256 checksum
How to use checksums
9bc9e47d9c00f26f85ac8ff328c73f5d241a95fbf35bc1aedb305db0e3dedc35
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.6-py3-none-any.whl

Download URL dmp_sdk_python-3.1.6-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f50b28360a4269125baf78c5f7fd16a432c2aca4946fe3e667486c9d18ed1d55
BLAKE2b-256 checksum
How to use checksums
488fead665988c6d06f61a1b833738a23ea30000db282a38beef706edd5196c4
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.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page