Skip to main content

liuxiaojing

English | 中文

中文数字与整数互转。

安装

pip install liuxiaojing

用法

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


English

Convert between Chinese numerals and integers.

Install

pip install liuxiaojing

Usage

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

Metadata

Release files for liuxiaojing 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for liuxiaojing 0.0.3
File Size Uploaded Provenance Actions
liuxiaojing-0.0.3.tar.gz 3.7 kB Without provenance Details for liuxiaojing-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for liuxiaojing 0.0.3
File Interpreter ABI Platform Actions
liuxiaojing-0.0.3-py3-none-any.whl Python 3 none any Details for liuxiaojing-0.0.3-py3-none-any.whl

Total release size: 7.8 kB

Release files / liuxiaojing-0.0.3.tar.gz

Download URL liuxiaojing-0.0.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5fbd75e25462800f0145138f91a8ea9fbf15bb944e89b88fa824a69c79d23fec
BLAKE2b-256 checksum
How to use checksums
034a8079660753e741e3bbd992375d34e5c1c4b5cb97dac89506449387af2ab1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / liuxiaojing-0.0.3-py3-none-any.whl

Download URL liuxiaojing-0.0.3-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16ed8fa9d8179c25db10bcfe16146043f1cc7a682032815c7bcdd4372e3f3e03
BLAKE2b-256 checksum
How to use checksums
8658c4caef4f7c3c032fcc711798745a8ca784274f67e9238e3e67e4a712c062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Security for liuxiaojing 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page