Observed since 20 Oct, 16:54 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Anki Addon Dev ToolKit
Modern, AI-driven, focused on Anki new versions (2025.06+) add-on development and build toolkit with complete type safety and modern Python practices.
English | 中文
Install uv locally via curl -LsSf https://astral.sh/uv/install.sh | sh.
Use uvx to run the latest version of the init command to quickly initialize your project:
# Create directory
mkdir my-addon
cd my-addon
# Interactive setup
uvx aadt init
The default initialization creates a basic but complete add-on project, including:
After initialization, the project directory structure is as follows:
my_addon/
├── addon.json # Add-on configuration file
├── src/ # Source code
│ └── my_addon/ # Main module
│ └── __init__.py # Main module initialization file
├── ui/ # UI design
│ ├── designer/ # Qt Designer .ui files
│ └── resources/ # UI resources (icons, styles)
├── README.md # Project documentation
├── ANKI.md # Anki core library documentation
├── pyproject.toml # Project configuration
├── uv.lock # uv lock file
├── .python-version # Specify Python version
├── .git/ # Git repository
└── .gitignore # Ignore files
💡 Tip: After initialization, it's recommended to immediately run uv run aadt claude to generate the AI assistant memory file, which will provide complete modern Anki development guidance and help Claude AI better assist your add-on development work.
To improve Add-on development efficiency, it's strongly recommended to use AI-assisted programming during development. AADT provides the claude command to generate specialized Claude Code guidance files:
# Generate CLAUDE.md file
aadt claude
This command will generate a CLAUDE.md file in the root directory based on your project configuration, including core guidance for Anki 25.06+ Add-on development, helping Claude AI better understand your project and provide precise development suggestions.
Additionally, there's an ANKI.md file in the root directory containing detailed documentation of modern Anki 25.06+ source code analysis and best practices, helping human programmers better understand Anki's overall architecture and development approach.
For convenient testing in the development environment, AADT provides the test command for testing add-ons in Anki.
aadt test
Running the test command will first create a soft link from the src/ directory's project folder to Anki's add-on directory, then automatically start Anki and load the add-on.
AADT also provides the link command to manage operations for soft linking the project source code folder to Anki's add-on directory.
# Create soft link
aadt link
# Remove soft link
aadt link --unlink
AADT provides the build command for building add-ons.
aadt build
The build command depends on a git repository and will by default find the latest git tag and build the corresponding commit version, making it easy to distinguish between test versions and official versions.
The generated add-on package is stored in the dist directory and can be used for direct installation or upload to AnkiWeb for distribution.
init - Initialize Add-on Project# Initialize in current directory (interactive)
aadt init
# Initialize in specified directory
aadt init my-addon
# Use default values (non-interactive)
aadt init -y
Features:
ui - Compile User Interface# Compile all UI files
aadt ui
Features:
.ui files from ui/designer/ to src/module_name/gui/forms/qt6/ui/resources/ to src/module_name/gui/resources/__init__.py for resources package to support importlib.resourcestest - Launch Testing# Link add-on and start Anki testing
aadt test
Features:
aadt link to create soft linkslink - Development Environment Linking# Create soft link to Anki add-on directory
aadt link
# Remove soft link
aadt link --unlink
Features:
src/ to Anki's add-on directoryclaude - Generate Claude AI Assistant Memory File# Generate CLAUDE.md file
aadt claude
# Force overwrite existing file
aadt claude --force
Features:
CLAUDE.md file based on project addon.json configuration--force for forced overwritingbuild - Build and Package Add-on# Build latest tag version (default)
aadt build
# Build specific version
aadt build v1.2.0 # Specific git tag
aadt build dev # Working directory (including uncommitted changes)
aadt build current # Latest commit
aadt build release # Latest tag (default)
# Specify distribution type
aadt build -d local # Local development version
aadt build -d ankiweb # AnkiWeb submission version
aadt build -d all # Build both types simultaneously
# Combined usage
aadt build v1.2.0 -d local
Distribution Type Description:
local: Suitable for local development, retains debug informationankiweb: Suitable for AnkiWeb submission, optimized file sizeall: Generate both versions simultaneouslyFeatures:
manifest.json required by AnkiWeb based on addon.json configurationmanifest - Generate Manifest File# Generate manifest.json
aadt manifest
clean - Clean Build Files# Clean all build artifacts
aadt clean
Features:
dist/ directory and its contentsThese commands provide finer build control, suitable for automated build pipelines:
create_dist - Prepare Source Code Treeaadt create_dist [version]
Features:
dist/build directorybuild_dist - Build Source Codeaadt build_dist
Features:
dist/buildpackage_dist - Package Distributionaadt package_dist
Features:
.ankiaddon formatAADT provides seamless integration for Qt Designer UI development with intelligent PyQt6 to aqt.qt conversion functionality:
.ui files in ui/designer/ui/resources/ui/resources/ in Qt Designeraadt ui to automatically compile and copy resources# Your project structure
my-addon/
├── ui/
│ ├── designer/
│ │ └── dialog.ui # References ../resources/icon.png
│ └── resources/
│ └── icon.png # Your resource file
└── src/my_addon/
# After running 'aadt ui'
my-addon/
├── src/my_addon/
│ ├── gui/forms/qt6/
│ │ └── dialog.py # Compiled UI, using aqt.qt imports
│ └── gui/resources/
│ ├── __init__.py # Auto-generated, supports importlib.resources
│ └── icon.png # Automatically copied resource
During the conversion process, AADT automatically converts pyuic6 output to Anki-compatible format and provides precise type annotations:
Original Conversion (pyuic6 output):
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.label = QtWidgets.QLabel(Dialog)
# ...
Specialized Conversion (AADT intelligent conversion):
from aqt.qt import QDialog, QVBoxLayout, QLabel, QMetaObject
class Ui_Dialog(object):
def setupUi(self, Dialog: QDialog) -> None:
Dialog.setObjectName("Dialog")
self.verticalLayout = QVBoxLayout(Dialog)
self.label = QLabel(Dialog)
# ...
AADT analyzes your UI files and provides precise type annotations based on aqt.qt's actual type system:
Ui_Dialog → QDialog type annotationUi_MainWindow → QMainWindow type annotationUi_CustomWidget → QWidget type annotationUi_SettingsFrame → QFrame type annotationfrom aqt.qt import ... instead of from PyQt6 import ...AADT includes modern development tools, strongly recommended for use during development to improve code quality and type safety, providing complete type annotations:
# Use ruff for code checking
uv run ruff check src/aadt/
uv run ruff format src/aadt/
# Use ty for type checking
uv run ty check src/aadt/
# Run all checks
uv run ruff check src/aadt/ && uv run ty check src/aadt/
# Run tests
pytest
# Include coverage
pytest --cov=aadt
AADT is designed to work best in Git repositories, but Git is not required:
git archive for clean source extractionpyproject.toml, VERSION files, or generate timestamp-based versions.git, __pycache__, etc.)# In Git repository (auto-detection)
aadt build -d local
# In non-Git directory (auto-fallback)
aadt build -d local # Still works!
# Explicit version specification (works anywhere)
aadt build v1.2.0 -d local
The tool automatically detects your environment and chooses the appropriate method.
Check the tests/ directory for example configurations and usage patterns.
AADT follows these principles:
This project is licensed under the GNU AGPLv3 License. See the LICENSE file for details.
Built with ❤️ for the Anki Community
This project is inspired by the aab project, focusing on providing the best development experience for new version Anki add-on developers who are about to officially launch.
现代化的、AI 驱动的、专注于 Anki 新版本(2025.06+)的插件开发和构建工具包,具备完整类型安全和现代 Python 实践。
English | 中文
通过 curl -LsSf https://astral.sh/uv/install.sh | sh 在本地安装 uv。
使用 uvx 方式使用最新版本运行 init 命令快速初始化项目:
# 创建目录
mkdir my-addon
cd my-addon
# 交互式设置
uvx aadt init
默认的初始化会创建一个基础但完整的插件项目,包括:
初始化完成之后,项目的目录结构如下:
my_addon/
├── addon.json # Addon 配置文件
├── src/ # 源代码
│ └── my_addon/ # 主模块
│ └── __init__.py # 主模块初始化文件
├── ui/ # UI 设计
│ ├── designer/ # Qt Designer .ui 文件
│ └── resources/ # UI 资源(图标、样式)
├── README.md # 项目说明
├── ANKI.md # Anki 核心库详解
├── pyproject.toml # 项目配置
├── uv.lock # uv 锁定文件
├── .python-version # 指定Python版本
├── .git/ # Git仓库
└── .gitignore # 忽略文件
为提升 Addon 开发效率,强烈建议在开发过程中使用 AI 辅助编程。AADT 提供了 claude 命令来生成专门的 Claude Code 指引文件:
# 生成 CLAUDE.md 文件
aadt claude
这个命令会根据你的项目配置,在根目录下生成一个 CLAUDE.md 文件,其中包括了 Anki 25.06+ Addon 开发的核心指引,能帮助 Claude AI 更好地理解你的项目并提供精准的开发建议。
此外,还会在根目录下生成一个 ANKI.md 文件,其中包含现代 Anki 25.06+ 的源代码详细分析和最佳实践的详细文档,帮助 AI 和人类程序员更好地理解 Anki 的整体架构和开发方式。
为了方便开发环境下的测试,AADT 提供了 test 命令,用于在 Anki 中进行插件的测试。
aadt test
运行 test 命令会先将 src/ 目录下的项目文件夹软链接到 Anki 的插件目录,然后自动启动 Anki 并加载插件。
同时,AADT 还提供了 link 命令,用于手动管理项目源代码文件夹软链接到 Anki 插件目录的操作。
# 创建软链接
aadt link
# 删除软链接
aadt link --unlink
AADT 提供了 build 命令,用于构建插件。
aadt build
构建命令依赖于 git 仓库,默认会查找最新的 git tag 并构建对应的 commit 版本,便于将测试版本和正式版本区分。
生成的插件包会存储在 dist 目录下,可以用于直接安装或者上传到 AnkiWeb 进行分发。
init - 初始化插件项目# 在当前目录初始化(交互式)
aadt init
# 在指定目录初始化
aadt init my-addon
# 使用默认值(非交互式)
aadt init -y
功能:
ui - 编译用户界面# 编译所有 UI 文件
aadt ui
功能:
ui/designer/ 中的 .ui 文件到 src/模块名/gui/forms/qt6/ui/resources/ 中的资源文件到 src/模块名/gui/resources/,并进行路径初始化test - 启动测试# 链接插件并启动 Anki 测试
aadt test
功能:
aadt link 创建软链接link - 开发环境链接# 创建软链接到 Anki 插件目录
aadt link
# 删除软链接
aadt link --unlink
功能:
src/ 下的插件项目文件夹软链接到 Anki 插件目录claude - 生成 Claude AI 助手记忆文件# 生成 CLAUDE.md 文件
aadt claude
# 强制覆盖现有 CLAUDE.md 文件
aadt claude --force
功能:
addon.json 配置自动生成 CLAUDE.md 文件--force 强制覆盖build - 构建和打包插件# 构建最新标签版本(默认)
aadt build
# 构建特定版本
aadt build v1.2.0 # 特定 git 标签
aadt build dev # 工作目录(包含未提交更改)
aadt build current # 最新提交
aadt build release # 最新标签(默认)
# 指定分发类型
aadt build -d local # 本地开发版本
aadt build -d ankiweb # AnkiWeb 提交版本
aadt build -d all # 同时构建两种类型
# 组合使用
aadt build v1.2.0 -d local
分发类型说明:
local: 适用于本地开发,保留调试信息ankiweb: 适用于 AnkiWeb 提交,优化文件大小all: 同时生成两种版本功能:
addon.json 配置生成 AnkiWeb 所需的 manifest.jsonmanifest - 生成清单文件# 生成 manifest.json
aadt manifest
clean - 清理构建文件# 清理所有构建产物
aadt clean
功能:
dist/ 目录及其内容这些命令提供更精细的构建控制,适用于自动化构建流水线:
create_dist - 准备源代码树aadt create_dist [version]
功能:
dist/build 目录build_dist - 构建源代码aadt build_dist
功能:
dist/build 中的源代码package_dist - 打包分发aadt package_dist
功能:
.ankiaddon 格式AADT 为 Qt Designer UI 开发提供无缝集成,具备智能 PyQt6 到 aqt.qt 转换功能:
ui/designer/ 中创建 .ui 文件ui/resources/ 中ui/resources/ 中的文件aadt ui 自动编译并复制资源# 你的项目结构
my-addon/
├── ui/
│ ├── designer/
│ │ └── dialog.ui # 引用 ../resources/icon.png
│ └── resources/
│ └── icon.png # 你的资源文件
└── src/my_addon/
# 运行 'aadt ui' 后
my-addon/
├── src/my_addon/
│ ├── gui/forms/qt6/
│ │ └── dialog.py # 编译后的UI,使用aqt.qt导入
│ └── gui/resources/
│ ├── __init__.py # 自动生成,支持importlib.resources
│ └── icon.png # 自动复制的资源
在转化的过程中,AADT 使用 pyuic6 将 ui 文件输出转换为 Anki 兼容格式,并提供精确的类型注解:
原始转化 (pyuic6 输出):
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.label = QtWidgets.QLabel(Dialog)
# ...
专用转化 (AADT 智能转换):
from aqt.qt import QDialog, QVBoxLayout, QLabel, QMetaObject
class Ui_Dialog(object):
def setupUi(self, Dialog: QDialog) -> None:
Dialog.setObjectName("Dialog")
self.verticalLayout = QVBoxLayout(Dialog)
self.label = QLabel(Dialog)
# ...
AADT 分析你的 UI 文件,基于 aqt.qt 的实际类型系统提供精确的类型注解:
Ui_Dialog → QDialog 类型注解Ui_MainWindow → QMainWindow 类型注解Ui_CustomWidget → QWidget 类型注解Ui_SettingsFrame → QFrame 类型注解from aqt.qt import ... 替代 from PyQt6 import ...AADT 包含现代开发工具,强烈建议在开发过程中使用,提升代码质量和类型安全,并提供完整的类型注解:
# 使用ruff进行代码检查
uv run ruff check src/aadt/
uv run ruff format src/aadt/
# 使用ty进行类型检查
uv run ty check src/aadt/
# 运行所有检查
uv run ruff check src/aadt/ && uv run ty check src/aadt/
# 运行测试
pytest
# 包含覆盖率
pytest --cov=aadt
AADT 设计为在 Git 仓库中工作最佳,但不需要 Git:
git archive 进行干净的源码提取pyproject.toml、VERSION 文件读取,或生成基于时间戳的版本.git、__pycache__ 等)# 自动检测环境并构建
aadt build
# 在 Git 仓库中(自动检测)
aadt build -d local
# 在非 Git 目录中(自动降级)
aadt build -d local # 仍然可以工作!
# 显式版本指定(任何地方都可以工作)
aadt build v1.2.0 -d local
工具会自动检测你的环境并选择适当的方法。
查看 tests/ 目录获取示例配置和使用模式。
本项目基于GNU AGPLv3协议。详见LICENSE文件。
为Anki社区用❤️构建
本项目受 aab 项目启发,专注于为即将正式上线的新版 Anki 插件开发者提供最佳的开发体验。
pypistats · 78 observations shown. Missing days are unknown. Source category: overall: without mirrors.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-19 – 2026-10-19 | 4 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-18 – 2026-10-18 | 4 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-17 – 2026-10-17 | 7 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-16 – 2026-10-16 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-15 – 2026-10-15 | 9 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-14 – 2026-10-14 | 6 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-13 – 2026-10-13 | 9 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-12 – 2026-10-12 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-11 – 2026-10-11 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-10 – 2026-10-10 | 13 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-09 – 2026-10-09 | 123 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-08 – 2026-10-08 | 41 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-07 – 2026-10-07 | 23 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-06 – 2026-10-06 | 5 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-05 – 2026-10-05 | 21 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-04 – 2026-10-04 | 2 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-03 – 2026-10-03 | 36 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-02 – 2026-10-02 | 20 | 2026-10-20T17:46:58.4525896Z |
| 2026-10-01 – 2026-10-01 | 26 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-30 – 2026-09-30 | 38 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-29 – 2026-09-29 | 33 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-28 – 2026-09-28 | 6 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-27 – 2026-09-27 | 28 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-26 – 2026-09-26 | 30 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-25 – 2026-09-25 | 40 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-24 – 2026-09-24 | 71 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-23 – 2026-09-23 | 49 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-22 – 2026-09-22 | 16 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-21 – 2026-09-21 | 6 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-19 – 2026-09-19 | 2 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-18 – 2026-09-18 | 61 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-17 – 2026-09-17 | 28 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-16 – 2026-09-16 | 16 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-15 – 2026-09-15 | 8 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-14 – 2026-09-14 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-12 – 2026-09-12 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-11 – 2026-09-11 | 8 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-10 – 2026-09-10 | 32 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-09 – 2026-09-09 | 74 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-08 – 2026-09-08 | 59 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-07 – 2026-09-07 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-05 – 2026-09-05 | 15 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-04 – 2026-09-04 | 31 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-03 – 2026-09-03 | 79 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-02 – 2026-09-02 | 36 | 2026-10-20T17:46:58.4525896Z |
| 2026-09-01 – 2026-09-01 | 16 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-31 – 2026-08-31 | 41 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-29 – 2026-08-29 | 9 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-28 – 2026-08-28 | 61 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-27 – 2026-08-27 | 38 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-26 – 2026-08-26 | 33 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-25 – 2026-08-25 | 34 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-24 – 2026-08-24 | 10 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-23 – 2026-08-23 | 4 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-22 – 2026-08-22 | 2 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-21 – 2026-08-21 | 20 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-20 – 2026-08-20 | 32 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-19 – 2026-08-19 | 60 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-18 – 2026-08-18 | 125 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-17 – 2026-08-17 | 94 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-15 – 2026-08-15 | 9 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-14 – 2026-08-14 | 176 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-13 – 2026-08-13 | 97 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-12 – 2026-08-12 | 51 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-11 – 2026-08-11 | 72 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-10 – 2026-08-10 | 133 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-09 – 2026-08-09 | 4 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-08 – 2026-08-08 | 36 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-07 – 2026-08-07 | 9 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-06 – 2026-08-06 | 16 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-04 – 2026-08-04 | 8 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-03 – 2026-08-03 | 16 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-02 – 2026-08-02 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-08-01 – 2026-08-01 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-07-29 – 2026-07-29 | 13 | 2026-10-20T17:46:58.4525896Z |
| 2026-07-27 – 2026-07-27 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-07-25 – 2026-07-25 | 1 | 2026-10-20T17:46:58.4525896Z |
| 2026-07-23 – 2026-07-23 | 3 | 2026-10-20T17:46:58.4525896Z |
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.7.0 | 24 Jul 2025 | 3 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 16:54 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:1cc190e6b60a46e15444e9061ecc37a9b195e5b2295b8e735e95bbd7ff57ef01