Read and write numbers in alphabetic numeral systems
Project description
Omninumeric
🌏 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
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
omninumeric-2.1.0a0.tar.gz
(10.5 kB
view hashes)
Built Distribution
Close
Hashes for omninumeric-2.1.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6ee862e50807863ea07f4c368387a56bf769b1f7c6f1c7806dcc73216b9a062 |
|
MD5 | 2908b3e1e392159bf36d920f7b895a83 |
|
BLAKE2b-256 | 13f88137ead440aba3f738e3b2fea066632bbeabd0f498cf25154105e0e0d23e |