icu_rbnf
A Python library for spelling out numbers into words using ICU's Rule-Based Number Format (RBNF).
Installation
pip install icu_rbnf
Usage
import icu_rbnf
# Spell out numbers in words
icu_rbnf.spellout(123, "en_US") # "one hundred twenty-three"
icu_rbnf.spellout(123.7, "en_US") # "one hundred twenty-three point seven"
icu_rbnf.spellout(123, "fr_FR") # "cent vingt-trois"
# Get ordinal form (e.g., "1st", "2nd")
icu_rbnf.ordinal(21, "en_US") # "21st"
# Get word-based ordinal (e.g., "first", "twenty-first")
icu_rbnf.spellout_ordinal(21, "en_US") # "twenty-first"
# Check if a locale is supported
icu_rbnf.is_locale_supported("en_US") # True
API
spellout(number: int | float, locale: str) -> str
Spell out a number into words for the given locale. Supports both integers and floats.
ordinal(number: int | float, locale: str) -> str
Get the ordinal form of a number for the given locale (e.g., "1st", "2nd"). Floats are truncated to integers.
spellout_ordinal(number: int | float, locale: str) -> str
Spell out ordinal form of a number for the given locale (e.g., "first", "twenty-first"). Floats are truncated to integers. Note: Not all locales support word-based ordinals; some may fall back to numeric format.
is_locale_supported(locale: str) -> bool
Check if a locale is supported by ICU RBNF.
error
Exception class raised when ICU RBNF operations fail.
Requirements
- Python 3.9+
- ICU library (dynamically linked, no separate installation required)
Metadata
Release files for icu-rbnf 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| icu_rbnf-0.2.0.tar.gz | 8.4 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| icu_rbnf-0.2.0-cp39-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| icu_rbnf-0.2.0-cp39-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 | Details |
Total release size: 31.0 MB
Release files / icu_rbnf-0.2.0.tar.gz
| Download URL | icu_rbnf-0.2.0.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1615f91fcc498406cf469227fc332dd4611b50dd9d1b8660c4d0bbe7f7df9575
|
|
BLAKE2b-256 checksum How to use checksums |
0aa8f6d838195474d3f39f849c27cb60cf27c8c53ece5314b65ca3e32f2a2d3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logRelease files / icu_rbnf-0.2.0-cp39-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | icu_rbnf-0.2.0-cp39-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.6 MB |
| Tags | CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
030e7ee05bb6d47054707ec003a78d045e588fce1a3bf78a9b207650698d31b6
|
|
BLAKE2b-256 checksum How to use checksums |
ad0bc23b45a5ecb58abfcebabec8a33b35db1531ed82bc852ab6e2b2aaa83d99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logRelease files / icu_rbnf-0.2.0-cp39-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | icu_rbnf-0.2.0-cp39-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 15.4 MB |
| Tags | CPython 3.9 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
93d829d2676a83a54bb0a380e9d2517eda990253b1a10ef3b7eb8f7b06743859
|
|
BLAKE2b-256 checksum How to use checksums |
666c91d646d3510c86f9365eb69ba4227658254def6c84b659ee5bf9d3df978c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency log