Skip to main content

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 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 digit of a 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 .

Project details


Release history Release notifications | RSS feed

This version

1.0

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

suzhounumerals-1.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

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

Hashes for suzhounumerals-1.0.tar.gz
Algorithm Hash digest
SHA256 5e956963c343644a6eebe03df54b7d35b95750096f0097799d3718694a469b4a
MD5 27dd77c3176e0aed81da74585a2ef8d6
BLAKE2b-256 2cdec9e36f142d2ff20f0305195d24e2bdb844ca7c3702c55cd59bfd634e6e5d

See more details on using hashes here.

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

Hashes for suzhounumerals-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 773ea5724415226ca8e96d6cade30a0ad2b95df7129e3784e70fc05a57fc34e1
MD5 e1dd2688ca8e649edc6257192ded2104
BLAKE2b-256 1c07c72c2959022df2edf7026c267c42cb20071e01d599b733bf8bff9c1e94ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page