(Translated by https://www.hiragana.jp/)
GitHub - zcold/pycnnum
Skip to content

zcold/pycnnum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyCNNUM

Convert numbers in Chinese string to/from int/float/str for Python3.8+.

API document



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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages