Metadata-Version: 2.5
Name: liuxiaojing
Version: 0.0.2
Summary: Convert between Chinese numerals and integers.
Project-URL: Homepage, https://pypi.org/project/liuxiaojing/
Author-email: lqxnjk <lqxnjk@qq.com>
License: MIT
License-File: LICENSE
Keywords: chinese,cjk,convert,number,numeral
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# liuxiaojing

[English](#english) | 中文

中文数字与整数互转。

## 安装

```console
pip install liuxiaojing
```

## 用法

```python
from liuxiaojing import to_chinese, to_int

to_int("三千零五")      # 3005
to_int("一百零二")      # 102
to_int("两万")          # 20000

to_chinese(3005)       # '三千零五'
to_chinese(0)          # '零'
```

## 说明

支持 0 到 99999999 的整数。解析容忍「〇」「两」「廿」等常见写法；超出范围、出现无法识别的字符、或「零」位置非法时抛 `ValueError`。输出统一用简化字，不加「壹贰」等大写形式。

## 许可证

MIT

---

<a id="english"></a>
## English

Convert between Chinese numerals and integers.

## Install

```console
pip install liuxiaojing
```

## Usage

```python
from liuxiaojing import to_chinese, to_int

to_int("三千零五")      # 3005
to_int("一百零二")      # 102
to_int("两万")          # 20000

to_chinese(3005)       # '三千零五'
to_chinese(0)          # '零'
```

## Notes

Handles integers from 0 to 99,999,999. Parsing accepts common variants such as 〇, 两 and 廿; out-of-range values, unknown characters or misplaced 零 raise `ValueError`. Output always uses the plain simplified forms.

## License

MIT
