Skip to main content

Python Tests PyPI PyPI Downloads License Python

SkillUNO

一个基于 Python 的 UNO 卡牌游戏框架,支持 Mod 化技能、赛季、成就、回放、热座模式、CLI 商店与网页版商店。

(部分代码由 AI 辅助生成)


目录


游戏截图

游戏界面 1

游戏界面 2


特性

特性 说明
事件驱动技能系统 技能通过订阅游戏事件(GAME_START / TURN_START / BEING_ADDED_CARDS 等)触发
混合技能 (HYBRID) 原生支持“主动+被动”混合技能,如既能主动点按发动,又能被动拦截加牌
赛季系统 内置 S1 经典 / S2 被动觉醒 / S3 同盟 / S4 补丁 四个官方赛季,含 30+ 技能
Mod 化扩展 支持社区作者发布自定义赛季与技能,通过 CLI 商店或网页商店安装
自动发现机制 每天自动检索带有 skilluno-mod 标签的 GitHub 仓库,校验并自动提 PR 入库
成就系统 内置成就 + 隐藏成就,记录在存档中,跨局累计
完整对局回放 每局可录制,支持交互式回放,逐事件查看
热座模式 2~4 人本地轮流同屏操作
统计面板 玩家胜率排行、技能使用次数、牌型频率、对局统计
可选彩色 UI 基于 rich 库,未安装时自动降级为纯文本

快速开始

方式一:PyPI 安装(最推荐)

pip install skilluno
skilluno

彩色界面(可选):pip install skilluno[rich] 安装 rich 依赖。未安装时自动降级为纯文本界面。

方式二:可编辑安装

git clone https://github.com/zhuyiming0208/SkillUNO.git
cd SkillUNO
pip install -e .
skilluno

方式三:不安装,直接运行

git clone https://github.com/zhuyiming0208/SkillUNO.git
cd SkillUNO
PYTHONPATH=src python -m uno.main

方式四:Termux(Android)

pkg install python git
git clone https://github.com/zhuyiming0208/SkillUNO.git
cd SkillUNO
pip install -e .
skilluno

Termux 提示:软键盘没有方向键,商店内使用 u/d/l/r 代替上下左右,~ 代替 Esc。


使用方式

交互式菜单

skilluno

进入主菜单:

SkillUNO vX.Y.Z
1. 新游戏
2. 回放录像
3. 统计面板
4. 模组商店
0. 退出
  • 新游戏:选择赛季组合、房间规则、是否录制
  • 回放:从 src/uno/records/ 里选择录像播放
  • 统计面板:读取存档与回放,显示胜率排行、技能使用、牌型频率
  • 模组商店:浏览、搜索、安装、卸载、启用/禁用模组(按 W 打开网页版)

CLI 子命令

skilluno mod list                       # 列出全部模组
skilluno mod search <关键词>             # 模糊搜索
skilluno mod info <ID>                  # 查看模组详情
skilluno mod install <ID>               # 下载 + 验证 + 启用
skilluno mod uninstall <ID>             # 卸载
skilluno mod list-collections           # 列出模组集
skilluno mod install-collection <ID>    # 一键安装模组集
skilluno mod --help                     # 查看帮助

模组系统

安装社区模组

方式一:CLI 商店

skilluno
# 选 4 进入商店
# 按 S 搜索、Enter 查看详情、I 安装

方式二:命令行

skilluno mod install LOD

方式三:网页版商店 访问 https://zhuyiming0208.github.io/SkillUNO/ ,复制一键安装命令。

安全机制

下载的模组经过多重验证:

  1. URL 白名单:只允许 raw.githubusercontent.com 和 cdn.jsdelivr.net。
  2. 大小限制:单文件 ≤ 5MB。
  3. 静态验证:用 ast.parse 解析 SEASON_ID,绝不 import 执行。
  4. 隔离区:下载到 mods/_pending/,用户显式确认后才启用。
  5. 备份:覆盖已安装模组前先备份 .bak。

制作自己的模组

详见 模组制作指南。在你的 GitHub 仓库打上 skilluno-mod Topic,即可被本项目的自动发现脚本抓取。


网页版商店

网址:https://zhuyiming0208.github.io/SkillUNO/

纯静态 HTML/CSS/JS,无构建依赖。包含:

  • 首页:官方模组 + 精选模组 + 模组集
  • 列表页:全部模组 + 搜索 + 标签联动筛选
  • 详情页:模组信息、依赖、权限声明、一键复制安装命令
  • 模组集:浏览和批量安装

源码位于 web/ 目录。

项目结构

SkillUNO/
├── CHANGELOG.md           版本历史与更新日志
├── docs/                  项目文档 (指南/FAQ/截图)
├── mods/                  模组元数据与索引
├── src/uno/               核心代码
├── tests/                 测试(760+ 用例,覆盖率 82%)
├── web/                   网页版商店
├── tools/
│   ├── bump.py            版本号升级工具 (setver)
│   └── discover_mods.py   社区模组自动发现脚本
└── .github/workflows/     CI

开发

运行测试

python -m pytest tests/ -v

贡献

欢迎提交 Issue 或 PR。添加新功能时请:

  1. 保持测试覆盖率。
  2. 更新 CHANGELOG.md。
  3. 用 setver X.Y.Z 升级版本号。

版本号工具

setver 1.17.0 "新功能说明" "- 详情 1\n- 详情 2" --git

发版流程

  1. 升级版本号并提交(推 main 不触发 PyPI 发布):
setver X.Y.Z "功能说明" "- 详情" --git
  1. 打 tag 并推送(触发 PyPI 发布):
git tag -a vX.Y.Z -m "vX.Y.Z: 功能说明"
git push origin vX.Y.Z

PyPI 发布由 .github/workflows/publish.yml 自动完成,触发条件是 tag 推送(v*)。

兼容性

项 支持
Python 3.10 / 3.11 / 3.12 / 3.14
平台 Linux / macOS / Android (Termux) / Windows
可选依赖 rich(彩色 UI)

文档


许可证

MIT

Metadata

Release files for skilluno 1.21.0

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

Source distribution (sdist)

Source distribution for skilluno 1.21.0
File Size Uploaded Provenance Actions
skilluno-1.21.0.tar.gz 121.6 kB With provenance Details for skilluno-1.21.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for skilluno 1.21.0
File Interpreter ABI Platform Actions
skilluno-1.21.0-py3-none-any.whl Python 3 none any Details for skilluno-1.21.0-py3-none-any.whl

Total release size: 213.9 kB

Release files / skilluno-1.21.0.tar.gz

Download URL skilluno-1.21.0.tar.gz
Size 121.6 kB
Tags Source
SHA-256 checksum
How to use checksums
012a0331f05856d2b31ccdb6543fec1426b1faf6fe3f944d0099dae7ee5e1fba
BLAKE2b-256 checksum
How to use checksums
8964b54bbe63fa17e2db21abbdafae4e3fa789775bf0103ace4b15115b5f3428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / skilluno-1.21.0-py3-none-any.whl

Download URL skilluno-1.21.0-py3-none-any.whl
Size 92.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a9a46b7e648a1cb3ecde1168919f0f386c2fd02950904208d4d39b626c9d51b
BLAKE2b-256 checksum
How to use checksums
895ae2633525f381cfb139fae09228f33c838981a23bd90e78d60daee159d266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for skilluno 1.21.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for skilluno-1.21.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

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