mundi-game-sdk
Python 3.10+ 可用本地或 HTTP(S) 的目录和 ZIP 运行可信的 Mundi 游戏包。pip 会安装执行 JavaScript 的 Deno。
python -m pip install mundi-game-sdk
from mundi import describe_game, run_match
# 指向单独下载的游戏包
source = "./courtyard.zip"
print(describe_game(source)["capabilities"])
player = {"role": "thrower", "controller": {"kind": "builtin", "ai": "duelist"}}
result = run_match(source, {"players": [player, player], "victoryConfig": {"scoreGoal": 1}})
print(result["end"])
安装 Gymnasium 扩展后,可以用本地或 HTTP(S) 游戏目录、ZIP 创建单智能体环境。
python -m pip install 'mundi-game-sdk[gym]'
from mundi import make_gym_env
with make_gym_env("./courtyard.zip", config={"victoryConfig": {"scoreGoal": 1}}) as env:
observation, info = env.reset(seed=42)
while True:
observation, reward, terminated, truncated, info = env.step(env.action_space.sample())
if terminated or truncated:
break
游戏包声明 headless 和 strategy。SDK 根据角色和内置电脑安排一个策略席位,根据 observationSchema 和 actionSchema 构造训练空间。可用 config["players"] 指定席位。枚举值映射为从 0 开始的 Gym 动作编号。复杂结构可传入 observation_space、encode_observation、action_space、decode_action。默认终局返回最后一次决策观察,按胜负计分,无胜负字段时为 0。可通过 reward(end, seat) 自定义终局奖励。
make_gym_env(game_path) 返回 gymnasium.Env,调用 reset() 开局,调用 step(action) 推进一步。SDK 在 Gymnasium 中用 Mundi/Game-v0 注册游戏包适配器。调用方只需传入实际游戏包的路径。
Metadata
Release files for mundi-game-sdk 0.1.4
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 |
|---|---|---|---|---|
| mundi_game_sdk-0.1.4.tar.gz | 22.9 kB | Without provenance | Details for mundi_game_sdk-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mundi_game_sdk-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for mundi_game_sdk-0.1.4-py3-none-any.whl |
Total release size: 48.3 kB
Release files / mundi_game_sdk-0.1.4.tar.gz
| Download URL | mundi_game_sdk-0.1.4.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e32dcbc4d03d692add5864e4df596bfa58894ad38925bb6137572fe988aab7cf
|
|
BLAKE2b-256 checksum How to use checksums |
1a22e2844b420bb5083fce4805a503381539ac29903f1798106a26d78940684f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mundi_game_sdk-0.1.4-py3-none-any.whl
| Download URL | mundi_game_sdk-0.1.4-py3-none-any.whl |
|---|---|
| Size | 25.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b764a050b0d24c499788d6ed2d70f5372302c83711a26c96dfd8a6810befa687
|
|
BLAKE2b-256 checksum How to use checksums |
3b1acaf2ea0d96f41b7f1c75a3cb239a8f7a029b0f7042108fa16705c0d66b87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for mundi-game-sdk 0.1.4
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.