Skip to main content

suzhounumerals

Suzhou numerals (蘇州碼子) converter module for Python 3.7+.

Usage

Functions

  • suzhou(x, /): Returns the suzhou numeral string representation of a number x.
  • suzhou_to_type(s, /, type_=int): Returns the numeric value in type of the suzhou numeral string s.
  • suzhou_to_int(s, /): Returns the numeric value in int of the suzhou numeral string s.
  • suzhou_to_decimal_str(s, /): Returns the numeric value string of the suzhou numeral string s.
  • suzhou_digit(i, /, alt=False): Returns the suzhou numeral digit of an integer i.
  • suzhou_digit_value(c, /, alt=False): Returns the numeric value of a suzhou digit character c, where alt specifies whether to use alternate digits or not (for digits 1 to 3).

Constants

  • ZERO to NINE: 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)

Source distribution for suzhounumerals 1.1
File Size Uploaded
suzhounumerals-1.1.tar.gz 16.0 kB Details

Built distribution (wheel)

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

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

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.0

2 release files

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