No project description provided
Project description
suzhounumerals
Suzhou numerals (蘇州碼子) converter module for Python 3.7+.
Usage
Functions
suzhou(x, /): Returns the suzhou numeral string 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 digit of a 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 .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
suzhounumerals-1.0.tar.gz
(15.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file suzhounumerals-1.0.tar.gz.
File metadata
- Download URL: suzhounumerals-1.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e956963c343644a6eebe03df54b7d35b95750096f0097799d3718694a469b4a
|
|
| MD5 |
27dd77c3176e0aed81da74585a2ef8d6
|
|
| BLAKE2b-256 |
2cdec9e36f142d2ff20f0305195d24e2bdb844ca7c3702c55cd59bfd634e6e5d
|
File details
Details for the file suzhounumerals-1.0-py3-none-any.whl.
File metadata
- Download URL: suzhounumerals-1.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
773ea5724415226ca8e96d6cade30a0ad2b95df7129e3784e70fc05a57fc34e1
|
|
| MD5 |
e1dd2688ca8e649edc6257192ded2104
|
|
| BLAKE2b-256 |
1c07c72c2959022df2edf7026c267c42cb20071e01d599b733bf8bff9c1e94ab
|