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 - WIP
- Byzantian Greek - WIP
- Modern Greek - planned
- Hebrew - planned
Background
See Introduction to learn about Cyrillic numeral system.
Installation
pip install omninumeric
Usage
import omninumeric.cyrillic as CU
# Convert a number into Cyrillic
# Requires non-zero int, returns str
a = CU.ArabicNumber(1).convert()
# Convert a Cyrillic number to Arabic
# Requires non-empty str, returns int
b = CU.CyrillicNumber("а҃").convert()
"Delimiter" and "plain" style numbers are supported both for reading and writing, "plain" style is used by default for writing.
When writing into Cyrillic, several falgs can be used:
# CU_DELIM flag sets conversion to "delimeter" style
c = cu.to_alphabetic(111111, CU_DELIM)
# CU_NOTITLO flag omits "titlo" decorator
d = cu.to_alphabetic(11000, CU_DELIM | CU_NOTITLO)
# Following flags control dot styling:
#
# CU_ENDDOT - append dot at the end
# CU_WRAPDOT - append dot at both ends
# CU_DELIMDOT - add dot separator between digit groups. Sets conversion to "delim" style
# CU_ALLDOT - combine CU_WRAPDOT and CU_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-1.0.0.tar.gz
(9.3 kB
view hashes)
Built Distribution
Close
Hashes for omninumeric-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66fdb0fef6040b9ed2141e3ef9f53806952810173a15e92d0de7ae7618c88028 |
|
MD5 | 6b9b083ef904d1eb8a5c9cd577083c9e |
|
BLAKE2b-256 | 7e28037d927340ebbfeb59afe1983b13a18e32005de1678f5f5c40b164ad372d |