pypinyin-dict
使用 pinyin-data 和 phrase-pinyin-data 中的拼音数据文件覆盖 pypinyin 中的自带拼音数据,实现只使用某个或某些拼音数据文件中的拼音数据的需求
What it is and what it does
pypinyin-dict is a data-loading companion to pypinyin that lets you swap in alternative pinyin (romanized Chinese pronunciation) datasets from the pinyin-data and phrase-pinyin-data projects. Instead of relying on pypinyin's built-in pronunciation mappings, you can load specific datasets—such as cc_cedict, kXHC1983, or others—to get different or more accurate pronunciations for Chinese characters and phrases.
The package exposes multiple modules, each corresponding to a different pronunciation data file, with a simple `load()` function to activate each one. This is useful when you need pronunciations from a particular standard or source, or when you want to override pypinyin's defaults with more specialized or up-to-date data. It depends only on pypinyin itself and installs as a pure-Python wheel with no compiled dependencies.
Use it for:
- Override pypinyin's default pronunciations with CC-CEDICT data for more linguistically accurate phrase-level pinyin
- Load historical or specialized pronunciation standards (e.g., kXHC1983, kTGHZ2013) for academic or archival text processing
- Provide heteronym (multiple pronunciation) support by switching to datasets that include variant pronunciations for ambiguous characters
- Build custom Chinese text-to-speech or romanization pipelines that require specific pronunciation sources
- Integrate alternative pinyin datasets into NLP or language-learning applications without forking pypinyin
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides alternative pinyin (romanized Chinese) data sources to override the default pronunciation mappings in pypinyin, allowing selection of specific pronunciation datasets.
Yes, if you need pypinyin with alternative pronunciation data sources. The package is straightforward to install and use, carries no security vulnerabilities, and has a permissive license. However, dormant maintenance (579 days since last release) means you should verify compatibility with your pypinyin version before relying on it in production, and monitor for any breaking changes in pypinyin that this package may not immediately address.
Install
pypinyin-dict on PyPI
pip
pip install pypinyin-dictuv
uv add pypinyin-dictpoetry
poetry add pypinyin-dictInstalling pypinyin-dict
Before you install
Low install friction with a single pure-Python dependency. Maintenance is dormant—last release was 579 days ago, though the repository remains active with a recent commit on 2025-01-12.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install pypinyin-dict
from pypinyin import pinyin
from pypinyin_dict.phrase_pinyin_data import cc_cedict
cc_cedict.load()
result = pinyin('枯萎')
print(result)
Verify before relying
- Whether dormant status (579 days since last release) poses a risk for future compatibility with pypinyin updates
- Performance impact of loading alternative datasets on typical workloads
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,<4,>=2.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pypinyin |
| Maintenance | dormant — 579 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,268/month — #12,710 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pypinyin_dict-0.9.0-py2.py3-none-any.whl
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
pypinyinConverts Chinese characters to pinyin…
permissive · top 5,000 on PyPI
pinyinConverts Chinese characters to pinyin…
permissive · top 15,000 on PyPI
xpinyinConverts Chinese characters (hanzi) to their…
permissive · top 15,000 on PyPI
zhonZhon provides character constants and regular…
permissive · top 15,000 on PyPI
hangul-romanizeConverts Korean Hangul text to romanized (Latin…
unclear · top 15,000 on PyPI
g2p-enConverts English text to phoneme sequences…
permissive · top 5,000 on PyPI
sea-g2pConverts text to phonemes for Vietnamese, Thai,…
permissive · top 15,000 on PyPI
pronouncingProvides a simple Python interface to query the…
permissive · top 15,000 on PyPI
misakiConverts written text to phonetic…
permissive · top 15,000 on PyPI
UnidecodeConverts Unicode text to ASCII-safe…
copyleft · top 1,000 on PyPI