Skip to main content

DMP Python SDK — 饥荒管理平台 Python SDK

Project description

DMP SDK

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

安装

pip install dmp-sdk-python

快速开始

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 面板 游戏控制、信息、连接码、大厅检测
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 平台管理 系统概览、版本、WebSSH、全局设置

特性

  • 链式调用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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmp_sdk_python-3.1.4.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dmp_sdk_python-3.1.4-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file dmp_sdk_python-3.1.4.tar.gz.

File metadata

  • Download URL: dmp_sdk_python-3.1.4.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dmp_sdk_python-3.1.4.tar.gz
Algorithm Hash digest
SHA256 643d86f718bdae3ea59026ec5e7f0af121d39eba0e7823cde43ba466f6f6faa1
MD5 bd364520d1de206a35f111b1e338c797
BLAKE2b-256 70f693a83f2f6b17638f11b0e7e4e91230637a476242955539482844dbb4b7e9

See more details on using hashes here.

File details

Details for the file dmp_sdk_python-3.1.4-py3-none-any.whl.

File metadata

  • Download URL: dmp_sdk_python-3.1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dmp_sdk_python-3.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5703ef2ef02d87cd06a2b500e0cf252f6d3d6d3073bd77920a53b89d663feb33
MD5 5dd92e384a841216a9d621ac1402df4e
BLAKE2b-256 0183ffb99f2e793d215ab6de66e5701e5d3709fbde3edb6bd0090adfff118bf0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page