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.1.tar.gz (6.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: yubiconvert-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0fd7081e0c64fd5aec1b23d9f0817bb6275b5edb677a913bf8e20e469eaaa9d5
MD5 e112d24696222b19d32667ff5076fa44
BLAKE2b-256 bab6258f99b65c00ef0f390dc7561a3f37c98a0d8f8bf9e130f2d576f8364f07

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