suzhounumerals
Suzhou numerals (蘇州碼子) converter module for Python 3.7+.
Usage
Functions
suzhou(x, /): Returns the suzhou numeral string representation of a numberx.suzhou_to_type(s, /, type_=int): Returns the numeric value intypeof the suzhou numeral strings.suzhou_to_int(s, /): Returns the numeric value inintof the suzhou numeral strings.suzhou_to_decimal_str(s, /): Returns the numeric value string of the suzhou numeral strings.suzhou_digit(i, /, alt=False): Returns the suzhou numeral digit of an integeri.suzhou_digit_value(c, /, alt=False): Returns the numeric value of a suzhou digit characterc, wherealtspecifies whether to use alternate digits or not (for digits 1 to 3).
Constants
ZEROtoNINE: Suzhou digits for 0 to 9 respectively.ONE_ALT,TWO_ALT,THREE_ALT: Alternate Suzhou digits for 1 to 3 respectively, due to the digits one, two, and three are all represented by vertical bars, causing confusion when they appear next to each other.TEN,TWENTY,THIRTY: Suzhou digits for 10, 20 and 30 respectively.
Example
>>> from decimal import Decimal
>>> from suzhou import *
>>> i = suzhou(5201314)
>>> print(i)
〥〢〇〡三〡〤
>>> f = suzhou(round(Decimal(11053406) / 96524333, 13))
>>> print(f)
〇.〡一〤〥〡〤〡〩〡〩〨〡〇
>>> suzhou_to_int(i)
5201314
>>> _ + suzhou_to_type(f, Decimal)
Decimal('5201314.1145141919810')
Download & Installation
The module requires Python 3.7 or up.
The module is available on PyPI (https://pypi.org/project/suzhounumerals). To install the latest release with pip, simply run
pip install suzhounumerals
or from the source tree
pip install .
Metadata
Release files for suzhounumerals 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 | Provenance | Actions |
|---|---|---|---|---|
| suzhounumerals-1.1.tar.gz | 16.0 kB | Without provenance | Details for suzhounumerals-1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| suzhounumerals-1.1-py3-none-any.whl | Python 3 | none | any | Details for suzhounumerals-1.1-py3-none-any.whl |
Total release size: 32.2 kB
Release files / suzhounumerals-1.1.tar.gz
| Download URL | suzhounumerals-1.1.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f80857e0e8a5043e194243d96aa562d9e7eb2987b9d0128b81f92b51165a1da
|
|
BLAKE2b-256 checksum How to use checksums |
c74059f5674070f1e922ea9358f5697f633bdfbc1617f57b300c2887944296bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / suzhounumerals-1.1-py3-none-any.whl
| Download URL | suzhounumerals-1.1-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0da6cd87c853120e890ff731710bf8e356a5ded4d8b965e26017cc41a7ec2e39
|
|
BLAKE2b-256 checksum How to use checksums |
9659110450ae14ad33fed30be11099ec1c2650d846f544187c9821caeab7eb3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for suzhounumerals 1.1
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.