--- id: cn2an version: "0.5.24" license: MIT License license_treatment: permissive maintenance: active --- # cn2an — Convert Chinese numerals and Arabic numerals. License: permissive · Maintenance: active · Downloads: 304.2K/mo ## What it is and what it does cn2an is a bidirectional converter between Chinese numerals and Arabic numerals. It handles standard conversions across multiple parsing modes: strict mode enforces proper numeral syntax, normal mode accepts informal sequences, smart mode handles mixed notation, and direct mode performs character-by-character translation. Beyond simple numbers, it transforms dates, fractions, percentages, and temperatures within sentences, supporting negative numbers and decimals up to 10**16 magnitude in both directions. The package offers three output styles for Arabic-to-Chinese conversion: lowercase Chinese numerals, uppercase formal numerals, and RMB currency notation. It includes an HTTP API for non-Python environments. The library depends on proces for data preprocessing and is actively maintained with recent bug fixes for numeral parsing edge cases. Use it for: - Parse Chinese financial documents or invoices that use written numerals into machine-readable integers - Generate human-readable Chinese numeral output for financial reports, receipts, or formal RMB amounts - Extract and normalize dates from Chinese text for data cleaning pipelines - Convert mixed-notation numbers in Chinese text for standardization - Build multilingual number handling for applications serving Chinese-speaking users ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts between Chinese numerals and Arabic numerals in multiple modes, supporting integers, decimals, negatives, and sentence-level transformations including dates, fractions, and percentages. Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and solves a specific problem with low install friction. It is well-suited for applications that need bidirectional Chinese-Arabic numeral conversion. The experimental sentence-level transformation feature adds value for text processing but should be tested for your specific use cases. ## Install pip install cn2an uv add cn2an poetry add cn2an ## Installing cn2an Before you install: Low install friction with a pure Python wheel. The package is actively maintained with recent commits and no known vulnerabilities. Supports Python 3.7 and later versions across Windows, macOS, and Ubuntu. License in practice: MIT License permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install cn2an import cn2an # Chinese to Arabic result = cn2an.cn2an("一百二十三") print(result) # 123 # Arabic to Chinese result = cn2an.an2cn("123") print(result) # 一百二十三 Requires Python 3.7 or later. The sentence-level transformation feature is marked experimental and may produce unexpected results in edge cases. Verify before relying: - Whether the proces dependency is a required runtime or only used for internal data preprocessing - Performance characteristics for very large batch conversions or real-time API usage - Accuracy of the experimental sentence-level transformation feature across edge cases ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 304.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags chinese numerals to arabic, convert chinese numbers, cn2an number conversion, chinese text to digits, chinese number parser, sentence numeral transform, chinese numeral parsing, chinese-nlp, number-conversion, text-normalization [View on SkillFed](https://skillfed.io/packages/cn2an) · [View on PyPI](https://pypi.org/project/cn2an/)