A library to convert numbers to Mooré text and vice versa
Project description
moore_num
A Python library for converting numbers to Mooré (Mossi) language text and vice versa.
Features
- Number to Mooré Text: Convert integers to their textual representation in Mooré.
- Mooré Text to Number: Parse Mooré number phrases back into integers.
- Money Mode: Special scaling factor (x5) for currency calculations common in Burkina Faso.
- Support for Large Numbers: Handles units, tens, hundreds, thousands, millions, and billions.
Installation
pip install moore_num
Usage
Forward Conversion (Number to Text)
from moore_num import convert_to_text
# Standard conversion
print(convert_to_text(125))
# Output: "Koabga la pisi la a nu"
# Money mode (5 CFA = 1 unit in common counting)
print(convert_to_text(500, is_money=True))
# Output: "Koabga"
Reverse Conversion (Text to Number)
from moore_num import text_to_num
# Standard reverse
print(text_to_num("Piig la a yii"))
# Output: 12
# Money mode reverse
print(text_to_num("Koabga", is_money=True))
# Output: 500
Command Line Interface
# Forward
num2moore 125
# Reverse
num2moore "Piig la a yii" --reverse
# Money mode
num2moore 500 --money
License
MIT
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
moore_num-0.1.1.tar.gz
(4.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moore_num-0.1.1.tar.gz.
File metadata
- Download URL: moore_num-0.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c4066e3783c625ac3d09815fd74eccf3e112ce33c32e94b2dde222b0ce708a8
|
|
| MD5 |
9d21c542c7f5dd18d5ccc3a07a6e2368
|
|
| BLAKE2b-256 |
8582b3480aff3e0fed6c7a55bfcd93ef0ed47ec89153443bc85ed521d050a913
|
File details
Details for the file moore_num-0.1.1-py3-none-any.whl.
File metadata
- Download URL: moore_num-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7d2ae0b3cc1d91932f4cc59b2967418dd90791d98208906e8233e476b2c3bcd
|
|
| MD5 |
c17c43d4118e10f85c163f378a44c6ce
|
|
| BLAKE2b-256 |
a72f05ede4532b9342a1cbca7b8fd9267d9d837b55bd6b09306a0e9834d1dea8
|