Registry / data / indic-numtowords

indic-numtowords

JSON →
library1.1.0pypypi✓ verified 84d ago

Indic-numtowords is a Python module developed by AI4Bharat that converts numbers into their word representations for various Indian languages and English (India). It supports languages such as Hindi, Nepali, Gujarati, Marathi, Bengali, Telugu, Tamil, Kannada, Oriya, Punjabi, and Malayalam. The library is currently at version 1.1.0, with an irregular release cadence.

pip install indic-numtowords
INSTALL
IMPORT
SIG · INDIC-NUMTOWORDS
I
indic-numtowords
datapythonv1.1.0
Install
1.6s avg
Import
58ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.050s · 19.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.043s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

num2words
from indic_numtowords import num2words
from num_to_words import num_to_word
This library (AI4Bharat/indic-numtowords) uses `num2words`. There is a similarly named library (`indic-num2words` by raj-sutariya) that uses `num_to_word` and has a different import path.

This quickstart demonstrates how to import the `num2words` function and use it to convert numbers into words for various supported languages. It also shows the usage of `lang`, `variations`, and `split` parameters.

from indic_numtowords import num2words # Convert a number to words in Hindi hindi_words = num2words(36, lang='hi') print(f"36 in Hindi: {hindi_words}") # Convert a number to words in English (India) english_words = num2words(150, lang='en') print(f"150 in English: {english_words}") # Convert with variations (if available for language and number) # Note: The 'variations' parameter might not yield different results for all numbers/languages. hindi_variations = num2words(150, lang='hi', variations=True) print(f"150 in Hindi with variations: {hindi_variations}") # Convert each digit separately split_digits = num2words(123, lang='en', split=True) print(f"123 (split) in English: {split_digits}")
Debug
Known issues
gotchaThere are two distinct Python libraries with very similar names: `indic-numtowords` (from AI4Bharat) and `indic-num2words` (from raj-sutariya). They have different import paths and function names (`num2words` vs `num_to_word`). Ensure you install and import the correct library based on your intended use.
fix
Double-check your `pip install` command and `from ... import ...` statement. For this library (AI4Bharat/indic-numtowords), use `pip install indic-numtowords` and `from indic_numtowords import num2words`.
affects: All versions
gotchaThe `lang` parameter requires specific ISO language codes (e.g., 'hi' for Hindi, 'en' for English-India, 'ta' for Tamil). Providing an unsupported or incorrect language code will result in an error or unexpected output.
fix
Refer to the official documentation or the `README.md` for a comprehensive list of supported language codes before use. For example, `en` refers to English-India.
affects: All versions
gotchaThe primary `num2words` function is designed for converting non-negative integers. While it accepts `int` or `str` input, explicit support for converting decimals (e.g., 'forty-two point one') or currency formats is not directly documented as a core feature of the main conversion function, though there is discussion about adding it.
fix
For decimal or currency conversions, you may need to implement custom pre-processing or post-processing logic to handle fractional parts separately. Check the latest documentation for any new features.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'indic_numtowords'
The 'indic_numtowords' library is not installed in your Python environment or there is a typo in the import statement.
fix
Ensure the package is installed using pip: `pip install indic-numtowords`
AttributeError: module 'indic_numtowords' has no attribute 'num2word'
You are trying to import or call a function named 'num2word' (singular) which does not exist in the 'indic_numtowords' module; the correct function name is 'num2words' (plural).
fix
Use the correct function name: `from indic_numtowords import num2words` and then `words = num2words(...)`
KeyError: 'xx' (where 'xx' is an unsupported language code)
The language code provided to the `lang` parameter of the `num2words` function is not supported by the library.
fix
Provide a supported ISO 639-1 language code, such as 'hi' for Hindi, 'ta' for Tamil, or 'en' for English (India). Refer to the library's documentation for a complete list of supported languages.
Upgrade
Version history
1.1.0latest on PyPI · released Aug 18, 2025
Audit
Dependencies
PythonrequiredRequired to run the library.
Agent activity
4 hits · last 30 days
node
4
Resources
indic-numtowords — pip install indic-numtowords · libregistry