--- id: hanzidentifier version: "1.3.0" license: MIT license_treatment: permissive maintenance: dormant --- # hanzidentifier — Python module that identifies Chinese text as Simplified or Traditional. License: permissive · Maintenance: dormant · Downloads: 549.2K/mo ## What it is and what it does Hanzidentifier is a lightweight Python module that classifies Chinese text by script system. It examines strings for Simplified characters, Traditional characters, or a mix of both, returning one of five classification constants: UNKNOWN (no Chinese), SIMPLIFIED, TRADITIONAL, BOTH (characters valid in both systems), or MIXED (both script-exclusive characters present). The package relies on zhon's CC-CEDICT dictionary to recognize Chinese characters; characters not in that dictionary are ignored during classification. The module is designed for straightforward text-processing tasks where you need to know what kind of Chinese characters are present. It offers both high-level helper functions (has_chinese, is_simplified, is_traditional) and a lower-level identify() function for more granular control. It has no external system dependencies and installs as a pure Python wheel. Use it for: - Validate user input in a form to ensure it uses the expected Chinese script variant. - Route Chinese text to appropriate downstream processing pipelines based on script type. - Filter or categorize documents in a corpus by their Chinese character system. - Detect mixed-script content that may indicate encoding errors or intentional code-switching. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Identifies whether a string contains Simplified Chinese, Traditional Chinese, both, or mixed character sets using CC-CEDICT data. Yes, if you need to classify Chinese text by script system. The package is stable, has no known vulnerabilities, and installs with minimal friction. Maintenance is dormant but the codebase is mature and the task it solves is well-defined. The single dependency (zhon) is also lightweight. Consider it a solid choice for text processing pipelines that must distinguish Simplified from Traditional Chinese. ## Install pip install hanzidentifier uv add hanzidentifier poetry add hanzidentifier ## Installing hanzidentifier Before you install: Low friction: pure Python wheel with a single dependency (zhon). Maintenance is dormant—last release was 632 days ago and no recent commits—but the package is marked stable and the repository is not archived. License in practice: MIT license permits commercial and private use with minimal restrictions; attribution required. Quickstart: pip install hanzidentifier import hanzidentifier result = hanzidentifier.identify('你好') if result is hanzidentifier.SIMPLIFIED: print('Simplified Chinese') Requires Python 3.9 or later. Verify before relying: - Whether the CC-CEDICT data bundled via zhon is current enough for modern Chinese text. - Performance characteristics on very long strings or bulk processing workloads. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 549.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags chinese character classification, simplified vs traditional chinese, detect chinese text type, hanzi identification, chinese script detection, chinese-nlp, text-classification [View on SkillFed](https://skillfed.io/packages/hanzidentifier) · [View on PyPI](https://pypi.org/project/hanzidentifier/)