skillfed

pypinyin-dict

使用 pinyin-data 和 phrase-pinyin-data 中的拼音数据文件覆盖 pypinyin 中的自带拼音数据,实现只使用某个或某些拼音数据文件中的拼音数据的需求

pypinyin-dict v0.9.0 105.3K downloads/30d#12,710 on PyPI66
Permissive license DORMANT released

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-dict

uv

uv add pypinyin-dict

poetry

poetry add pypinyin-dict

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 3

Tags

pinyin data overridechinese character pronunciationpinyin dictionary dataalternative pinyin sourceschinese romanization datapinyin dataset loadercharacter pronunciation mapping
chinese-nlppinyin-datatext-processing

More Linguistic packages