zhon
Zhon provides constants used in Chinese text processing.
What it is and what it does
Zhon is a reference library of constants for Chinese language processing. It exports pre-defined character sets (CJK characters, radicals, punctuation), Pinyin validation patterns (vowels, consonants, syllable/word/sentence regex), Zhuyin marks, and CC-CEDICT character references. The package has no runtime dependencies and is designed to be imported and used with Python's re module or other text processing tools.
Typical use is to extract or validate Chinese text components: finding all hanzi characters in a mixed-language string, matching Pinyin syllables or words with regex, or validating sentence structure. It's a data reference, not an algorithm library—you provide the processing logic (usually regex) and zhon provides the character classes and patterns.
Use it for:
- Extract all CJK characters from mixed-language text using zhon.hanzi.characters with regex
- Validate and extract Pinyin syllables or words from romanized Chinese using zhon.pinyin patterns
- Build Chinese text segmentation or tokenization tools that rely on character class definitions
- Identify Chinese punctuation marks in text for parsing or cleaning tasks
- Validate Zhuyin (bopomofo) syllables in phonetic Chinese text processing
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Zhon provides character constants and regular expression patterns for processing Chinese text, including CJK characters, Pinyin syllables, and Zhuyin marks.
Yes. Zhon is a stable, dependency-free reference library for Chinese text processing with no known vulnerabilities. Install it if you're building tools that need to identify, validate, or extract Chinese characters, Pinyin, or Zhuyin. The dormant maintenance status is not a concern for a constants-only package—the character sets it exports are unlikely to change frequently.
Install
zhon on PyPI
pip
pip install zhonuv
uv add zhonpoetry
poetry add zhonInstalling zhon
Before you install
Low install friction with no runtime dependencies. Dormant maintenance status (last release 2024-11-20, last commit 2024-12-11) but stable and widely used; no active development but no signs of abandonment.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
import re
import zhon.hanzi
# Find CJK characters in a string
re.findall('[{}]'.format(zhon.hanzi.characters), 'I broke a plate: 我打破了一个盘子.')
# Returns: ['我', '打', '破', '了', '一', '个', '盘', '子']
Verify before relying
- Whether the package's character sets and patterns are current with Unicode standards for modern Chinese text
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 632 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 571,763/month — #5,949 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zhon-2.1.1-py3-none-any.whl
Keywords: cc-cedict, cedict, characters, chinese, cjk, han, hanzi, mandarin, pinyin, punctuation, radicals, segmentation, simplified, tokenization, traditional, unicode, zhuyin
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
hanzidentifierIdentifies whether a string contains Simplified…
permissive · top 15,000 on PyPI
nameparserParses human names into seven structured…
copyleft · top 5,000 on PyPI
pypinyinConverts Chinese characters to pinyin…
permissive · top 5,000 on PyPI
xpinyinConverts Chinese characters (hanzi) to their…
permissive · top 15,000 on PyPI
pypinyin-dictProvides alternative pinyin (romanized Chinese)…
permissive · top 15,000 on PyPI
pinyinConverts Chinese characters to pinyin…
permissive · top 15,000 on PyPI
jamoJamo decomposes and synthesizes Hangul…
permissive · top 15,000 on PyPI
jiebaJieba segments Chinese text into words using…
permissive · top 5,000 on PyPI
OpenCCConverts text between Traditional Chinese,…
permissive · top 15,000 on PyPI
mplfontsManages Matplotlib fonts and solves CJK…
permissive · top 15,000 on PyPI