Skip to main content

Python module that can convert numeric words to their numerical form effortlessly

Project description

YubiConvert

YubiConvert - a Python module that can convert numeric words to their numerical form effortlessly. What's more, it supports both Western and Indian currency standards, making it the ultimate solution for all your numerical conversion needs.

Installation

To install the YubiConvert module, it is recommended to first ensure that you have updated the pip to the latest version. Then, you can use pip to install the module from the Python Package Index with the following command:

pip install yubiconvert

Usage

Once the module is installed, you can import it into your Python code using the following line:

from yubiconvert import yubiconvert as w2n

Then you can use the word_to_num method to convert a number-word to numeric digits, as shown below.

print(w2n.word_to_num("twenty lakh three thousand nineteen Rupees"))
2003019
print(w2n.word_to_num('two point three')) 
2.3
print(w2n.word_to_num('112')) 
112
print(w2n.word_to_num('point one')) 
0.1
print(w2n.word_to_num('one hundred thirty-five')) 
135
print(w2n.word_to_num("there was a group of ten friends who went to the restaurant for a party, ordered thirty two dishes including ten drinks and bill came out as ten thousand five hundred and thirty paisa")) 
there was a group of 10 friends who went to the restaurant for a party, ordered 32 dishes including 10 drinks and bill came out as 10500.3

Credits

This repo is a forked of w2n library and the same has been used as a base to extend it further to support indian currency standards.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yubiconvert-1.0.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file yubiconvert-1.0.tar.gz.

File metadata

  • Download URL: yubiconvert-1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for yubiconvert-1.0.tar.gz
Algorithm Hash digest
SHA256 d717845a3ae0e9ed04d434441c4f844cf845edb21c01b457f0b5bc26fccc7326
MD5 e9fc79407b08b1a7d591f65ef64e142e
BLAKE2b-256 64dcec6f84a4ad0ef0af7f4e23aa93a7ba91afdbbaa425fc6cf8f0b051ebc77e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page