{"id":49318612,"url":"https://github.com/yaoyhu/anki_packager","last_synced_at":"2026-04-26T17:00:23.520Z","repository":{"id":273207844,"uuid":"915914488","full_name":"yaoyhu/anki_packager","owner":"yaoyhu","description":"An intelligent, automatic Anki flashcard generator designed for Chinese speakers learning English.","archived":false,"fork":false,"pushed_at":"2025-11-13T10:46:02.000Z","size":5787,"stargazers_count":154,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-13T11:27:37.527Z","etag":null,"topics":["anki","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaoyhu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-13T05:01:28.000Z","updated_at":"2025-11-13T10:49:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"2327063b-b4c3-4dd1-b45a-acf1ebe6239b","html_url":"https://github.com/yaoyhu/anki_packager","commit_stats":null,"previous_names":["yaoyhu/anki_packager"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yaoyhu/anki_packager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyhu%2Fanki_packager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyhu%2Fanki_packager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyhu%2Fanki_packager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyhu%2Fanki_packager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaoyhu","download_url":"https://codeload.github.com/yaoyhu/anki_packager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyhu%2Fanki_packager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32305039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anki","python"],"created_at":"2026-04-26T17:00:17.691Z","updated_at":"2026-04-26T17:00:23.505Z","avatar_url":"https://github.com/yaoyhu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- LOGO --\u003e\n\u003ch1\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./images/apkg.png\" alt=\"Logo\" width=\"200\"\u003e\n  \u003cbr\u003eanki_packager\n\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    自动化 Anki 英语单词高质量卡片牌组生成工具\n    \u003cbr /\u003e\n    \u003ca href=\"#关于项目\"\u003e关于项目\u003c/a\u003e\n    ·\n    \u003ca href=\"#使用\"\u003e使用指南\u003c/a\u003e\n    ·\n    \u003ca href=\"#todo\"\u003e开发计划\u003c/a\u003e\n    ·\n    \u003ca href=\"#thanks\"\u003e致谢\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## 关于项目\n\n`anki_packager` 是一款自动化的 Anki 单词卡片生成工具，能够自动创建高质量的 `.apkg` 牌组。本项目致力于为英语学习者提供一个高效、智能的记忆辅助工具。\n\n### 核心特性\n\n- 多源精选词典整合：[ECDICT](https://github.com/skywind3000/ECDICT)、[《有道词语辨析》加强版](https://skywind.me/blog/archives/2941)、[单词释义比例词典](https://skywind.me/blog/archives/2938)\n- 智能化学习体验：\n  - 自动抓取有道词典优质例句和常用短语\n  - 支持谷歌 TTS 发音、中英双解、考纲标记等功能\n  - 支持流行 AI 模型（需要 API-KEY）对单词进行总结、助记及和情境故事生成\n- 便捷的数据导入：支持欧路词典生词本一键导入并批量处理单词列表，自动生成卡片\n- 优良的命令行体验：显示处理进度，支持记录错误、支持丰富的命令行参数\n- 支持 Docker 运行、支持 PyPI 安装\n\n### 卡片预览\n\n每张单词卡片包含丰富的学习资源，结构清晰，内容全面：\n\n- 正面：词头、发音、音标 + 考试大纲标签（如 中高考、CET4、CET6、GRE 等）\n- 背面：\n  - 释义：中文（ECDICT）、时态（AI）、释义和词性比例（[单词释义比例词典-带词性](https://mdx.mdict.org/按词典语种来分类/词频/单词释义比例词典/单词释义比例词典-带词性.mdx)） \n  - AI 生成词根 + 辅助记忆（联想记忆 + 谐音记忆）\n  - 短语 + 例句（有道爬虫）\n  - 单词辨析（[《有道词语辨析》加强版](https://pan.baidu.com/s/1gff2tdp)）\n  - 英文释义（目前来自 ECDICT）+ AI 生成故事\n\n\u003cimg src=\"./images/卡片预览.png\" alt=\"背面 \" style=\"zoom:50%;\" /\u003e\n\n## 使用\n\n### 快速开始\n\n```bash\n# 直接使用 pip 安装\npip install apkger\n```\n\n在使用 apkger 之前，你需要先在 `config/config.toml` 文件中填写相关配置信息：\n\n本项目使用 [litellm](https://github.com/BerriAI/litellm) 统一调用 LLM 服务。关于 `MODEL_PARAM` 的详细配置方法，请参考 [LiteLLM Providers 文档](https://docs.litellm.ai/docs/providers)。\n\n```toml\nPROXY = \"\"\nEUDIC_TOKEN = \"\"\nEUDIC_ID = \"0\"\nDECK_NAME = \"anki_packager\"\n\n[[MODEL_PARAM]]\nmodel = \"gemini/gemini-2.5-flash\"\napi_key = \"GEMINI_API_KEY\"\nrpm = 10                          # 每分钟请求次数\n\n### OpenAI-Compatible Endpoints 示例\n# [[MODEL_PARAM]]\n# model = \"openai/gpt-4o\"\n# api_key = \"OPENAI_API_KEY\"\n# api_base = \"YOUR_API_BASE\"\n# rpm = 200\n```\n\n下面是关于配置文件中各参数的详细说明：\n\n- `MODEL_PARAM`:\n  - `model`: Provider Route on LiteLLM + Model ID\n  - `api_key`: 对应模型的 API 密钥。\n  - `api_base`: (可选) 仅在模型为 OpenAI-Compatible Endpoints 时需要填写\n  - `rpm`: (可选) 每分钟的请求次数限制，用于控制 API 调用频率。\n- `PROXY`: 如果你无法直接连接到 AI 服务提供商，可以在这里设置代理服务器地址\n\n- 如果需要使用欧路词典生词本：先按照[欧陆官方获取](https://my.eudic.net/OpenAPI/Authorization) TOKEN，然后使用`apkger --eudicid` 选择 ID 写入配置文件\n\n### 下载字典\n\n下载字典到配置目录中（注意名称不要错）:\n\n- Linux/MacOS: `~/.config/anki_packager/dicts/`\n- Windows: `C:\\Users\\\u003c用户名\u003e\\AppData\\Roaming\\anki_packager\\dicts\\`\n\n字典数据（感谢 [skywind）](https://github.com/skywind3000)下载地址:\n\n- [stardict.7z](https://github.com/skywind3000/ECDICT/raw/refs/heads/master/stardict.7z)\n- [单词释义比例词典-带词性](https://mdx.mdict.org/按词典语种来分类/词频/单词释义比例词典/单词释义比例词典-带词性.mdx)\n- [有道词语辨析](https://pan.baidu.com/s/1gff2tdp)：**需要手动解压**放入 `config/dicts`\n\n字典下载完毕后，解压和处理交给 anki_packager 即可。\n\n### 运行\n\n目前软件没有 UI 界面，只支持命令行运行，下面给出一些参考：\n\n```bash\n# 查看帮助信息\napkger -h\n\n# 从默认生词本读词生成卡片\napkger\n\n### 关闭 AI 功能\napkger --disable_ai\n\n### 从欧路词典生词本导出单词，生成卡片（需要先配置)\n## 先查看 ID 写入配置文件\napkger --eudicid\n## 生成卡片\napkger --eudic\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e方式一：Conda 环境\u003c/summary\u003e\n\n```bash\n# 创建并激活一个名为 apkg 的 Python 3.9 虚拟环境\nconda create -n apkg python=3.9\nconda activate apkg\n\n# 安装项目依赖\npip install -r requirements.txt\n\n# 查看帮助信息\npython -m anki_packager -h\n\n# 从欧路词典生词本导出单词，生成卡片（需要先配置)\npython -m anki_packager --eudic\n\n# 关闭 AI 功能\npython -m anki_packager --disable_ai\n\n# 从生词本读词生成卡片\npython -m anki_packager\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e方式二：Docker 容器\u003c/summary\u003e\n\n如果你希望避免污染本地环境，可以使用 Docker 运行 anki_packager，可以配合 `Makefile` 使用：\n\n```shell\n# 构建 Docker 镜像 和 创建持久化卷\nmake build\n\n# 第一次运行容器下载词典（需要一点时间）\nmake run\n\n# 进入容器（注意！需要在主机先配置 config/config.toml）\n# 在容器中运行 anki_packager，生成的牌组会保存在当前目录中\nmake shell\n```\n\n\u003c/details\u003e\n\n## TODO\n\n- [x] ~~集成单词释义比例词典~~\n- [x] ~~近一步优化单词卡片 UI~~\n- [x] ~~从欧路词典导入生词~~\n- [x] ~~支持 SiliconFlow、Gemini~~\n- [x] ~~重新支持 Docker~~\n- [x] ~~发布到 PyPI~~\n- [x] ~~训练现成的数据包发布 release~~ @Initsnow\n- [ ] 支持更多软件生词导出\n- [ ] 支持 Longman 词典\n- [ ] 开发 GUI\n\n## Thanks\n\n本项目得到了众多开源项目和社区的支持：\n\n- 感谢 [skywind](https://github.com/skywind3000) 开源的 [ECDICT](https://github.com/skywind3000/ECDICT) 以及其他词典项目，为本项目提供了丰富的词典资源。\n- 感谢 [yihong0618](https://github.com/yihong0618) 开源的众多优秀 Python 项目，从中获益良多。\n\n---\n\n\u003cp align=\"center\"\u003e如果这个项目对你有帮助，欢迎 Star ⭐️\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaoyhu%2Fanki_packager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaoyhu%2Fanki_packager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaoyhu%2Fanki_packager/lists"}