word2number-es


Nameword2number-es JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/Neuri-ai/w2n_es
SummaryConvert number words (eg. veintiuno) to numeric digits (spanish)
upload_time2023-01-13 22:41:29
maintainer
docs_urlNone
authorNeuri
requires_python
licenseThe MIT License (MIT) Copyright (c) 2016 Akshay Nagpal (https://github.com/akshaynagpal) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords numbers convert words spanish
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |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>`__)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Neuri-ai/w2n_es",
    "name": "word2number-es",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "numbers,convert,words,spanish",
    "author": "Neuri",
    "author_email": "support@neuri.ai",
    "download_url": "https://files.pythonhosted.org/packages/a5/9f/587a6c4657d6c4b9fb571d7872129fd8700dc670a5b8b780004bc2627b14/word2number_es-1.0.1.tar.gz",
    "platform": null,
    "description": "|travis_pic| |codecov_pic|\r\n\r\n==============\r\nWord to Number (Es)\r\n==============\r\nThis 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).\r\n\r\n++++++++++++\r\nInstallation\r\n++++++++++++\r\nPlease ensure that you have **updated pip** to the latest version before installing word2number_es.\r\n\r\nYou can install the module using Python Package Index using the below command.\r\n\r\n.. code-block:: python\r\n\r\n  pip install word2number_es\r\n\r\nMake sure you install all requirements given in requirements.txt\r\n\r\n.. code-block:: python\r\n\r\n  pip install -r requirements.txt\r\n\r\n+++++\r\nUsage\r\n+++++\r\nFirst you have to import the module using the below code.\r\n.. code-block:: python\r\n\r\n    from word2number_es import w2n\r\n\r\nThen you can use the **word_to_num** method to convert a number-word to numeric digits, as shown below.\r\n\r\n.. code-block:: python\r\n\r\n    >>> print(w2n.word_to_num('dos punto tres'))\r\n    2.3\r\n\r\n    >>> print(w2n.word_to_num('112'))\r\n    112\r\n\r\n    >>> print(w2n.word_to_num('punto cinco')) \r\n    0.5\r\n\r\n    >>> print(w2n.word_to_num('dosmil veintitres')) \r\n    2023\r\n\r\n    >>> print(w2n.word_to_num('millon millon'))\r\n    Error: Redundant number! Please enter a valid number word (eg. two million twenty three thousand and forty nine)\r\n    None\r\n\r\n    >>> print(w2n.word_to_num('blah'))\r\n    Error: No valid number words found! Please enter a valid number word (eg. two million twenty three thousand and forty nine)\r\n    None\r\n\r\nYou can also use the **numwords_in_sentence** to convert all number words in a sentence to numeric digits, as shown below.\r\n\r\n.. code-block:: python\r\n\r\n    >>> print(w2n.numwords_in_sentence(\"el reloj me costo diez mil pesos\"))\r\n    el reloj me costo 10000 pesos\r\n\r\n++++++++++++\r\nContributors\r\n++++++++++++\r\n- Ben Batorsky (`bpben <https://github.com/bpben>`__)\r\n- Alex (`ledovsky <https://github.com/ledovsky>`__)\r\n- Tal Yarkoni (`tyarkoni <https://github.com/tyarkoni>`__)\r\n- ButteredGroove (`ButteredGroove <https://github.com/ButteredGroove>`__)\r\n- TurqW (`TurqW <https://github.com/TurqW>`__)\r\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2016 Akshay Nagpal (https://github.com/akshaynagpal)  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Convert number words (eg. veintiuno) to numeric digits (spanish)",
    "version": "1.0.1",
    "split_keywords": [
        "numbers",
        "convert",
        "words",
        "spanish"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ebdcd9747907d43bd2ba418eae897d0c45a92d269d15680eb7860eb42810415",
                "md5": "284976bd7a183a292db24a1fb308540b",
                "sha256": "ce09434e1fe942259e5f8e32eeba9903ace7beb369a73aad2c95bbe71f54a0bd"
            },
            "downloads": -1,
            "filename": "word2number_es-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "284976bd7a183a292db24a1fb308540b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6039,
            "upload_time": "2023-01-13T22:41:27",
            "upload_time_iso_8601": "2023-01-13T22:41:27.989988Z",
            "url": "https://files.pythonhosted.org/packages/5e/bd/cd9747907d43bd2ba418eae897d0c45a92d269d15680eb7860eb42810415/word2number_es-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a59f587a6c4657d6c4b9fb571d7872129fd8700dc670a5b8b780004bc2627b14",
                "md5": "b9b424e270d727f85b7bedaf4c03a85d",
                "sha256": "6fc29970d6cefd0e3b1b0d329fe1e15a007c3acc314d5ac730bcd8496a9e6205"
            },
            "downloads": -1,
            "filename": "word2number_es-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b9b424e270d727f85b7bedaf4c03a85d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6999,
            "upload_time": "2023-01-13T22:41:29",
            "upload_time_iso_8601": "2023-01-13T22:41:29.985800Z",
            "url": "https://files.pythonhosted.org/packages/a5/9f/587a6c4657d6c4b9fb571d7872129fd8700dc670a5b8b780004bc2627b14/word2number_es-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-13 22:41:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Neuri-ai",
    "github_project": "w2n_es",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "word2number-es"
}
        
Elapsed time: 0.02815s