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.0.tar.gz
(4.9 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.0.tar.gz.
File metadata
- Download URL: moore_num-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce3cb6d57396bd0f39ea9d4ab7a6129e923bc7da61a3664cfc79ef203f3695f0
|
|
| MD5 |
7c6d1eb980a46a9036663d25d00762e1
|
|
| BLAKE2b-256 |
05eb56cbd62d32118cc330302cd0dc51d33af28f71277481c38e4cb2e84ee6d9
|
File details
Details for the file moore_num-0.1.0-py3-none-any.whl.
File metadata
- Download URL: moore_num-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 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 |
4c023eff80c3afc3e74ae28809f887f5fec7901265f9a5a50857629a052d7ee7
|
|
| MD5 |
661d3c46e0272ac47709a0118860996a
|
|
| BLAKE2b-256 |
b7788370465f549b044a4c9bce8fc9e27d1f6022cd246a1ff584c2f5fdbff5c5
|