Skip to main content

moore_num

A Python library for converting numbers to Mooré (Mossi) language text and vice versa.

🚀 Try the interactive demo: num2text-playground.vercel.app

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: Counts amounts below one million in wakirs (1 wakir = 5 FCFA), as is common in Burkina Faso. Millions and billions stay absolute FCFA values, and leftover francs are read as "tãmb a ...".
  • Support for Large Numbers: Handles units, tens, hundreds, thousands, millions, and billions (up to 999 999 999 999).
  • Negative Numbers: Prefixed with "- " in both directions.
  • Strict Parsing: Unknown words raise a ValueError instead of being silently ignored.

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: "koabg la pisi la a nu"

# Each digit of a thousands/millions/billions multiplier gets its own scale word
print(convert_to_text(46000))
# Output: "tus pis-naase la tus a yoobe"   (40 000 + 6 000)
print(convert_to_text(40006))
# Output: "tus pis-naase la a yoobe"       (40 000 + 6)

# Money mode (1 wakir = 5 FCFA)
print(convert_to_text(500, is_money=True))
# Output: "koabga"
print(convert_to_text(7, is_money=True))
# Output: "ye la tãmb a yiibu"             (1 wakir + 2 francs)

Reverse Conversion (Text to Number)

from moore_num import text_to_num

# Standard reverse
print(text_to_num("piig la a yi"))
# Output: 12

# Money mode reverse
print(text_to_num("koabga", is_money=True))
# Output: 500

# Unknown words raise an error
text_to_num("pisi la a bonjour")
# ValueError: Unknown Mooré number word: 'bonjour'

Command Line Interface

# Forward
num2moore 125

# Reverse
num2moore "piig la a yi" --reverse

# Money mode
num2moore 500 --money

Breaking changes in 0.2.2 (from 0.1.x)

  • Thousands, millions and billions: each digit of the multiplier now gets its own scale word, so every number has a single, unambiguous text. For example, 46 000 is now tus pis-naase la tus a yoobe and 145 500 is tus koabga la tus pis-naase la tus a nu la kobs-nu. Text written in the old form (tus koabg la pis-naase la a nu) is now read differently.
  • text_to_num raises ValueError on unknown words or empty input, instead of returning 0.

License

MIT

Citation

If you use this software in your research, please cite it using the following BibTeX format:

@software{moore_num,
  author = {Ouily, Hamed Joseph},
  title = {moore\_num: A Python library for converting numbers to Mooré text},
  url = {https://github.com/ohamjoseph/moore_num},
  year = {2026}
}

Metadata

Release files for moore-num 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moore-num 0.2.2
File Size Uploaded Provenance Actions
moore_num-0.2.2.tar.gz 7.2 kB Without provenance Details for moore_num-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for moore-num 0.2.2
File Interpreter ABI Platform Actions
moore_num-0.2.2-py3-none-any.whl Python 3 none any Details for moore_num-0.2.2-py3-none-any.whl

Total release size: 13.8 kB

Release files / moore_num-0.2.2.tar.gz

Download URL moore_num-0.2.2.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c49082254e71ce5e7dd88bc3773b301af2acd9759c015c942c27df1b26cc1848
BLAKE2b-256 checksum
How to use checksums
ab7f6ea9eed545f9e3b43b622aebed8c0d3d50adf3af7e29677e499d2fc7e243
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / moore_num-0.2.2-py3-none-any.whl

Download URL moore_num-0.2.2-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56b298c459f17c6a8aed0f50f85372a075b4c3b98fde609ec5da74a0c01bc51c
BLAKE2b-256 checksum
How to use checksums
7ad586c31b7d77533a120aeb23c344fdfa0a8afc0679dae9df05906f949ce851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for moore-num 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page