Skip to main content

AI4Bharat num2words

A module to convert numbers to words for Indian languages and English.

Installation

To install the module, run the following command:

pip install indic-numtowords

Import

To use the library, import it using the following command:

from indic_numtowords import num2words 

Usage

  1. Converts numbers into words in various languages:
words = num2words(38, lang='ta')
#output: 'முப்பத்து எட்டு'
  1. Returns variations for numbers:
words = num2words(150, lang='hi', variations=True)
#output: ['एक सौ पचास', 'डेढ़ सौ'] 
  1. Converts each digit separately:
words = num2words(420, lang='doi', split=True)
#output: 'चार दो सिफर'

Parameters

The num2words function accepts the following parameters:

  • number: (int) The non-negative integer to convert into words.
  • lang: (str) The ISO code for the target language. Defaults to English (en).
  • variations: (bool, optional) If set to True, returns variations of the number.
  • split: (bool, optional) If True, converts each digit separately into its word form.

Supported Languages

The following languages are supported by the num2words module:

  • as: Assamese
  • bn: Bengali
  • brx: Bodo
  • doi: Dogri
  • en: English
  • gu: Gujarati
  • hi: Hindi
  • kn: Kannada
  • ks: Kashmiri
  • kok: Konkani
  • mai: Maithili
  • ml: Malayalam
  • mr: Marathi
  • mni: Manipuri
  • ne: Nepali
  • or: Odia
  • pa: Punjabi
  • sa: Sanskrit
  • sat: Santali
  • sd: Sindhi
  • ta: Tamil
  • te: Telugu
  • ur: Urdu

Release Notes

This package contains work on converting numbers to words. The contents of this package can also be downloaded from our GitHub repo.

Meta

Distributed under the MIT license. See LICENSE for more information.

Metadata

Release files for indic-numtowords 1.1.0

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

Source distribution (sdist)

Source distribution for indic-numtowords 1.1.0
File Size Uploaded
indic_numtowords-1.1.0.tar.gz 44.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for indic-numtowords 1.1.0
File Interpreter ABI Platform
indic_numtowords-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 115.9 kB

Release files / indic_numtowords-1.1.0.tar.gz

Download URL indic_numtowords-1.1.0.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d1addc21444c332e05bfd8726af427960c096c2a16776d98bee4fbc36ade5d25
BLAKE2b-256 checksum
How to use checksums
aa46683e92580d9c1752917d2f9ec2a44d2adc21cdfe4deeaa0fe87fc23dbea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / indic_numtowords-1.1.0-py3-none-any.whl

Download URL indic_numtowords-1.1.0-py3-none-any.whl
Size 71.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf4b7b9e539323d9b00bc868caa2d9369170b8f3ac4d19619bf9c6cdc6f89572
BLAKE2b-256 checksum
How to use checksums
1e16b2b6491d95a15bda712163b4e27428f2cb1ac3a1b4fb59b140dbc76f6ce5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.2

1 release file

1.0.1

2 release files

1.0.0

1 release file

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