{"id":6675,"library":"indic-numtowords","title":"Indic Num To Words","description":"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.","status":"active","version":"1.1.0","language":"en","source_language":"en","source_url":"https://github.com/AI4Bharat/indic-numtowords","tags":["natural-language-processing","indian-languages","number-to-words","text-normalization"],"install":[{"cmd":"pip install indic-numtowords","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required to run the library.","package":"Python","optional":false}],"imports":[{"note":"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.","wrong":"from num_to_words import num_to_word","symbol":"num2words","correct":"from indic_numtowords import num2words"}],"quickstart":{"code":"from indic_numtowords import num2words\n\n# Convert a number to words in Hindi\nhindi_words = num2words(36, lang='hi')\nprint(f\"36 in Hindi: {hindi_words}\")\n\n# Convert a number to words in English (India)\nenglish_words = num2words(150, lang='en')\nprint(f\"150 in English: {english_words}\")\n\n# Convert with variations (if available for language and number)\n# Note: The 'variations' parameter might not yield different results for all numbers/languages.\nhindi_variations = num2words(150, lang='hi', variations=True)\nprint(f\"150 in Hindi with variations: {hindi_variations}\")\n\n# Convert each digit separately\nsplit_digits = num2words(123, lang='en', split=True)\nprint(f\"123 (split) in English: {split_digits}\")","lang":"python","description":"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."},"warnings":[{"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`.","message":"There 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}