Skip to main content

Read and write numbers in alphabetic numeral systems

Project description

Omninumeric

PyPI - Python Version PyPI - Wheel Codecov

PyPI - License Code style: black

🌏 English Русский

Omninumeric provides support for number reading and writing in alphabetic numeral systems.

Supported numeral systems

  • Cyrillic
  • Roman - numbers up to 3999
  • Byzantian Greek - WIP
  • Modern Greek - planned
  • Hebrew - planned

Background

See Introduction to learn about Cyrillic numeral system.

Installation

pip install omninumeric

Usage

#   Convert a number into Roman numeral system
#   Requires non-zero int, returns str
from omninumeric import roman

a = roman.write(1)

#   Convert a Cyrillic number to Arabic numeral system
#   Requires non-empty str, returns int
from omninumeric import cyrillic

b = cyrillic.read("а҃")

For Greek-type numeral systems, "Delimiter" and "plain" style numbers are supported both for reading and writing. "Plain" style is used by default for writing.

For Cyrillic numeral system, several falgs can be used for writing:

#   DELIM flag sets conversion to "delimeter" style

c = cyrillic.write(111111, cyrillic.DELIM)

#   NOTITLO flag omits "titlo" decorator

d = cyrillic.write(11000, cyrillic.DELIM | cyrillic.NOTITLO)

#   Following flags control dot styling:
#
#   ENDDOT - append dot at the end
#   WRAPDOT - append dot at both ends
#   DELIMDOT - add dot separator between digit groups. Sets conversion to "delim" style
#   ALLDOT - combine WRAPDOT and DELIMDOT

Contributing

Create an issue describing a bug or suggestion, then create a pull request mentioning the issue.

Feedback

Drop me a line: amshoor@gmail.com

Changelog

See Changelog.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omninumeric-2.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

omninumeric-2.1.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file omninumeric-2.1.0.tar.gz.

File metadata

  • Download URL: omninumeric-2.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for omninumeric-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f8ebce891694ea3179df17b8253b4e42c58245b5ce8f90f505ebe413d1482288
MD5 2cd62b8f538944f190b48d8646bfcbc9
BLAKE2b-256 1075c84199f34108127719e3b27a87269fdec4ab441225389cc82ec2463edf8b

See more details on using hashes here.

File details

Details for the file omninumeric-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: omninumeric-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for omninumeric-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72e2b0aa8cf755b0b391cff4630040a0ceb879a75b5bf9b14c0bd209c17ea89f
MD5 4aafb63f4a44a30c1ecc4c41e7aa80ff
BLAKE2b-256 ee8af0f23797f031b79e38bb85448c135c0bd123ba3025c538480f9f357c3a0a

See more details on using hashes here.

Supported by

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