{"id":18273993,"url":"https://github.com/longcw/youdao","last_synced_at":"2025-09-04T19:13:11.409Z","repository":{"id":27217885,"uuid":"30688965","full_name":"longcw/youdao","owner":"longcw","description":"基于python 的命令行下查词工具，使用有道api","archived":false,"fork":false,"pushed_at":"2020-03-15T08:45:06.000Z","size":332,"stargazers_count":202,"open_issues_count":9,"forks_count":46,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-29T23:44:49.722Z","etag":null,"topics":["python","stardict","youdao"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/youdao","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/longcw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-12T06:23:41.000Z","updated_at":"2025-08-26T10:24:02.000Z","dependencies_parsed_at":"2022-09-01T02:41:22.214Z","dependency_job_id":null,"html_url":"https://github.com/longcw/youdao","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/longcw/youdao","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longcw%2Fyoudao","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longcw%2Fyoudao/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longcw%2Fyoudao/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longcw%2Fyoudao/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/longcw","download_url":"https://codeload.github.com/longcw/youdao/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longcw%2Fyoudao/sbom","scorecard":{"id":598029,"data":{"date":"2025-08-11","repo":{"name":"github.com/longcw/youdao","commit":"afb518ff792ae12477081d11cf6384d3eff1ae23"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 6/24 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-55x5-fj6c-h6m8","Warn: Project is vulnerable to: PYSEC-2014-9 / GHSA-57qw-cc2g-pv5p","Warn: Project is vulnerable to: PYSEC-2021-19 / GHSA-jq4v-f5q6-mjqq","Warn: Project is vulnerable to: GHSA-pgww-xf46-h92r","Warn: Project is vulnerable to: PYSEC-2022-230 / GHSA-wrxv-2j5q-m38w","Warn: Project is vulnerable to: PYSEC-2018-12 / GHSA-xp26-p53h-6h2p","Warn: Project is vulnerable to: PYSEC-2014-14 / GHSA-652x-xj99-gmcc","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2014-13 / GHSA-cfj3-7x9c-4p3h","Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T23:40:07.660Z","repository_id":27217885,"created_at":"2025-08-20T23:40:07.660Z","updated_at":"2025-08-20T23:40:07.660Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273658030,"owners_count":25145206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["python","stardict","youdao"],"created_at":"2024-11-05T12:08:17.715Z","updated_at":"2025-09-04T19:13:06.392Z","avatar_url":"https://github.com/longcw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# youdao\n### 简介\n这是一个基于Python 在控制台下查单词的小工具。\n\n这个小程序是受\u003chttps://github.com/Flowerowl/ici\u003e 启发， 用requests 库和有道的API 重新实现的，后期加上了数据库、有道Web版、有道翻译、单词发音、Stardict 的支持。  \n__从0.3.0开始添加了对Stardict 的支持__（使用pystardict + C扩展加快查询速度）。默认情况下使用Stardict查询单词，如果没有找到则使用web版有道词典。  \n支持 __单词发音__（须要联网从有道获取，会缓存已经获取的mp3文件）；支持 __有道翻译__，支持使用有道API查词；自动使用sqlite 数据库保存已经查询过的单词数据。\n\n### 使用 Stardict\n1. __下载词典__   \n\tStardict 是一个跨平台的国际词典软件，提供大量词库使用（可以去  \u003chttp://pan.baidu.com/s/1dD1mIRJ\u003e 下载，推荐21世纪双语词典，当然也可以从网上找，但是不要下太多不然查询速度是个问题= =）\n2. __解压__  \n\t新建一个文件夹比如`/home/chenlong/.dict_youdao/stardict`，将下载的词典解压到该目录下（如下图）。  \n    ![词典解压目录](./dict.png)\n3. __在程序中设置：__  \n\t使用命令 `yd -s \"/home/chenlong/.dict_youdao/stardict\"`  \n    成功后输出 `stardict 路径设置成功： /home/chenlong/.dict_youdao/stardict`\n4. 尽情使用stardict 吧  \n\t![使用 Stardict](./stardict.png)\n\n### 使用有道词典\n可能你不喜欢stardict（版权问题、颜色单一），那么可以按照上面的方法将stardict 的目录设置为空或者一个没有词典的空目录（一定是 __空目录__）。此时，程序将默认使用有道Web 版获取单词解释，对于没有解释的单词将自动使用有道翻译。  \n设置完成后使用`yd keyword`查词。  \n![web版查询](./webyoudao.png)\n\n### 单词发音\n使用命令 `yd -v keyword`会在查询单词后获取单词发音，下载的单词发音保存在`~/.dict_youdao/voice`下，采用系统默认播放器播放。  \n在Linux 下推荐使用Clementine 播放器，播放时不会弹出新窗口。另外，查询单词后，使用`yd -v` 会自动获取上一个查询单词的发音。  \n![单词发音](./pic3.png)  \n\n### 管理缓存单词\n查询过的单词都使用sqlite 数据库保存，数据库文件在`~/.dict_youdao`  \n`yd -l` ：列出数据库中的单词以及查询次数。  \n`yd -c` ：清空数据库以及保存的发音。  \n`yd -d keyword` ：删除某个单词  \n\n### 使用帮助\n``` \nyd [-a] [-n] [-l] [-c] [-v] [-d word] [-y] [-s path] [--help] word\n[-a] 使用API 而不是解析网页获取结果\n[-n] 强制重新获取, 不管数据库中是否已经保存\n[-l] 列出数据库中保存的所有单词\n[-c] 清空数据库\n[-v] 获取单词发音, 单独使用 yd -v 可以获取上一个查询单词的发音\n[-d word] 删除数据库中某个单词\n[-y] 优先使用有道词典\n[-s path] 设置stardict词典路径\n[--help] 显示帮助信息\n```\n    \n### 安装\n由于使用了C扩展，安装过程中需要vc 或gcc\n#### Ubuntu（Linux）：  \n`sudo python setup.py install`  \n或者  \n`sudo pip install youdao`\n\n#### Windows：\n由于Windows 下控制台下的编码问题，推荐使用[cmder](http://gooseberrycreative.com/cmder/)，并在`cmder/vendor/init.bat` 的最后加上\n```\n@chcp 65001 \u003e nul\n@set PYTHONIOENCODING=utf-8\n```\n\n\n### 更新历史\n+ 0.3.6 upload to python3 and use pybind11 for the stardict lib\n+ 0.3.1 bug fixed\n+ 0.3.0 增加对stardict 的支持，使用[pystardict](https://github.com/lig/pystardict)，为加速查询编写了查询索引部分的C 扩展\n+ 0.2.3 修复了使用api无法显示新单词结果的问题\n+ 0.2.1 修复了无法显示已查询的单词的bug\n+ 0.2.0 重新组织了代码结构以及数据库字段, 所以将丢失以前保存的单词\n+ 0.1.5 添加获取单词发音的功能\n+ 0.1.4 添加删除数据库中保存的单词的功能, 添加帮助说明\n+ 0.1.3 抓取过的单词使用sqlite保存\n+ 0.1.2 增加抓取web版有道词典页面的方法查词, 并默认使用这种方法. 可以通过 -a 选项使用api查词.\n+ 0.1.1 改变查词方法为 yd keyword\n+ 0.1.0 完成基本功能, 使用命令 youdao keyword 查词.\n\n\n### 常见问题\n+ Can't install on arch - unable to initialize decompress status for section: https://github.com/mrjbq7/ta-lib/issues/268#issuecomment-497979600","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongcw%2Fyoudao","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flongcw%2Fyoudao","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongcw%2Fyoudao/lists"}