|travis_pic| |codecov_pic|
============== Word to Number (Es)
This is a Python module to convert number words (eg. veintiuno) to numeric digits (21). It works for positive numbers upto the range of 999,999,999,999 (i.e. billions).
++++++++++++ Installation ++++++++++++ Please ensure that you have updated pip to the latest version before installing word2number_es.
You can install the module using Python Package Index using the below command.
.. code-block:: python
pip install word2number_es
Make sure you install all requirements given in requirements.txt
.. code-block:: python
pip install -r requirements.txt
+++++ Usage +++++ First you have to import the module using the below code. .. code-block:: python
from word2number_es import w2n
Then you can use the word_to_num method to convert a number-word to numeric digits, as shown below.
.. code-block:: python
>>> print(w2n.word_to_num('dos punto tres'))
2.3
>>> print(w2n.word_to_num('112'))
112
>>> print(w2n.word_to_num('punto cinco'))
0.5
>>> print(w2n.word_to_num('dosmil veintitres'))
2023
>>> print(w2n.word_to_num('millon millon'))
Error: Redundant number! Please enter a valid number word (eg. two million twenty three thousand and forty nine)
None
>>> print(w2n.word_to_num('blah'))
Error: No valid number words found! Please enter a valid number word (eg. two million twenty three thousand and forty nine)
None
You can also use the numwords_in_sentence to convert all number words in a sentence to numeric digits, as shown below.
.. code-block:: python
>>> print(w2n.numwords_in_sentence("el reloj me costo diez mil pesos"))
el reloj me costo 10000 pesos
++++++++++++ Contributors ++++++++++++
- Ben Batorsky (
bpben <https://github.com/bpben>__) - Alex (
ledovsky <https://github.com/ledovsky>__) - Tal Yarkoni (
tyarkoni <https://github.com/tyarkoni>__) - ButteredGroove (
ButteredGroove <https://github.com/ButteredGroove>__) - TurqW (
TurqW <https://github.com/TurqW>__)
Metadata
Release files for word2number-es 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| word2number_es-1.0.1.tar.gz | 7.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| word2number_es-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.0 kB
Release files / word2number_es-1.0.1.tar.gz
| Download URL | word2number_es-1.0.1.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fc29970d6cefd0e3b1b0d329fe1e15a007c3acc314d5ac730bcd8496a9e6205
|
|
BLAKE2b-256 checksum How to use checksums |
a59f587a6c4657d6c4b9fb571d7872129fd8700dc670a5b8b780004bc2627b14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Release files / word2number_es-1.0.1-py3-none-any.whl
| Download URL | word2number_es-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce09434e1fe942259e5f8e32eeba9903ace7beb369a73aad2c95bbe71f54a0bd
|
|
BLAKE2b-256 checksum How to use checksums |
5ebdcd9747907d43bd2ba418eae897d0c45a92d269d15680eb7860eb42810415
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|