PyCNNUM
Convert numbers in Chinese string to/from int/float/str for Python3.8+.
1. Install from PyPI
pip install pycnnum
2. Install from Source
# git is required
git clone https://github.com/zcold/pycnnum.git
cd pycnnum
python -m pip install .
3. Examples
>>> from pycnnum import cn2num, num2cn
>>> cn2num("一百二十三")
123
>>> num2cn(123)
'一百二十三'
>>> cn2num("一兆零四十五", numbering_type="mid")
1000000000045
>>> num2cn(2400, alt_2=True)
'两千四'
>>> num2cn(3.4)
'三点四'
4. Install Development Packages
# example for working under Ubuntu 22.4
# git and python3.8-venv are required
git clone https://github.com/zcold/pycnnum.git pycnnum_dev
cd pycnnum_dev
python3.8 -m venv .venv
source .venv/bin/activate
python -m pip install .[dev] -U
Release files for pycnnum 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pycnnum-2.1.1.tar.gz | 160.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycnnum-2.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 171.4 kB
Release files / pycnnum-2.1.1.tar.gz
| Download URL | pycnnum-2.1.1.tar.gz |
|---|---|
| Size | 160.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
472edd86e2c886ae9be0ae0052ddd125094aca6b9200e21e5d15ba1974698edf
|
|
BLAKE2b-256 checksum How to use checksums |
6de92366b7a393ef2c8c662e9fdf4f8af9ca3cd6fdafbe199f077b4fc2e19063
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Release files / pycnnum-2.1.1-py3-none-any.whl
| Download URL | pycnnum-2.1.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a1d3f2da75293e11c50cb1dedeb582aaf478f864a602ef29313ff31c8992034
|
|
BLAKE2b-256 checksum How to use checksums |
9ab45c8fdc83523de02e10610a265a01d51b9aead6da75ef122e1c68772c1845
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|