{"id":13400407,"url":"https://github.com/savoirfairelinux/num2words","last_synced_at":"2025-05-14T02:05:23.285Z","repository":{"id":8680958,"uuid":"10340514","full_name":"savoirfairelinux/num2words","owner":"savoirfairelinux","description":"Modules to convert numbers to words. 42 --\u003e forty-two","archived":false,"fork":false,"pushed_at":"2025-04-08T18:01:46.000Z","size":1012,"stargazers_count":864,"open_issues_count":207,"forks_count":519,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-04-11T00:42:42.864Z","etag":null,"topics":["hacktoberfest","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/savoirfairelinux.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-05-28T16:54:31.000Z","updated_at":"2025-04-10T06:39:52.000Z","dependencies_parsed_at":"2024-06-18T11:14:41.043Z","dependency_job_id":"c3b3dd5c-36aa-44c7-a356-ee1bb9056d97","html_url":"https://github.com/savoirfairelinux/num2words","commit_stats":{"total_commits":574,"total_committers":138,"mean_commits":4.159420289855072,"dds":0.9512195121951219,"last_synced_commit":"921258d0ce4e93a6b550b007b99c582dee060968"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savoirfairelinux%2Fnum2words","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savoirfairelinux%2Fnum2words/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savoirfairelinux%2Fnum2words/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savoirfairelinux%2Fnum2words/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savoirfairelinux","download_url":"https://codeload.github.com/savoirfairelinux/num2words/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052692,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","python"],"created_at":"2024-07-30T19:00:51.702Z","updated_at":"2025-05-14T02:05:18.245Z","avatar_url":"https://github.com/savoirfairelinux.png","language":"Python","readme":"num2words library - Convert numbers to words in multiple languages\n==================================================================\n\n.. image:: https://img.shields.io/pypi/v/num2words.svg\n   :target: https://pypi.python.org/pypi/num2words\n\n.. image:: https://travis-ci.org/savoirfairelinux/num2words.svg?branch=master\n    :target: https://travis-ci.org/savoirfairelinux/num2words\n\n.. image:: https://coveralls.io/repos/github/savoirfairelinux/num2words/badge.svg?branch=master\n    :target: https://coveralls.io/github/savoirfairelinux/num2words?branch=master\n\n\n``num2words`` is a library that converts numbers like ``42`` to words like ``forty-two``.\nIt supports multiple languages (see the list below for full list\nof languages) and can even generate ordinal numbers like ``forty-second``\n(although this last feature is a bit buggy for some languages at the moment).\n\nThe project is hosted on GitHub_. Contributions are welcome.\n\n.. _GitHub: https://github.com/savoirfairelinux/num2words\n\nInstallation\n------------\n\nThe easiest way to install ``num2words`` is to use pip::\n\n    pip install num2words\n\nOtherwise, you can download the source package and then execute::\n\n    python setup.py install\n\nThe test suite in this library is new, so it's rather thin, but it can be run with::\n\n    python setup.py test\n\nTo run the full CI test suite which includes linting and multiple python environments::\n\n    pip install tox\n    tox\n\nUsage\n-----\nCommand line::\n\n    $ num2words 10001\n    ten thousand and one\n    $ num2words 24,120.10\n    twenty-four thousand, one hundred and twenty point one\n    $ num2words 24,120.10 -l es\n    veinticuatro mil ciento veinte punto uno\n    $num2words 2.14 -l es --to currency\n    dos euros con catorce céntimos\n\nIn code there's only one function to use::\n\n    \u003e\u003e\u003e from num2words import num2words\n    \u003e\u003e\u003e num2words(42)\n    forty-two\n    \u003e\u003e\u003e num2words(42, to='ordinal')\n    forty-second\n    \u003e\u003e\u003e num2words(42, lang='fr')\n    quarante-deux\n\nBesides the numerical argument, there are two main optional arguments, ``to:`` and ``lang:``\n\n**to:** The converter to use. Supported values are:\n\n* ``cardinal`` (default)\n* ``ordinal``\n* ``ordinal_num``\n* ``year``\n* ``currency``\n\n**lang:** The language in which to convert the number. Supported values are:\n\n* ``en`` (English, default)\n* ``am`` (Amharic)\n* ``ar`` (Arabic)\n* ``az`` (Azerbaijani)\n* ``be`` (Belarusian)\n* ``bn`` (Bangladeshi)\n* ``ca`` (Catalan)\n* ``ce`` (Chechen)\n* ``cs`` (Czech)\n* ``cy`` (Welsh)\n* ``da`` (Danish)\n* ``de`` (German)\n* ``en_GB`` (English - Great Britain)\n* ``en_IN`` (English - India)\n* ``en_NG`` (English - Nigeria)\n* ``es`` (Spanish)\n* ``es_CO`` (Spanish - Colombia)\n* ``es_CR`` (Spanish - Costa Rica)\n* ``es_GT`` (Spanish - Guatemala)\n* ``es_VE`` (Spanish - Venezuela)\n* ``eu`` (EURO)\n* ``fa`` (Farsi)\n* ``fi`` (Finnish)\n* ``fr`` (French)\n* ``fr_BE`` (French - Belgium)\n* ``fr_CH`` (French - Switzerland)\n* ``fr_DZ`` (French - Algeria)\n* ``he`` (Hebrew)\n* ``hi`` (Hindi)\n* ``hu`` (Hungarian)\n* ``id`` (Indonesian)\n* ``is`` (Icelandic)\n* ``it`` (Italian)\n* ``ja`` (Japanese)\n* ``kn`` (Kannada)\n* ``ko`` (Korean)\n* ``kz`` (Kazakh)\n* ``mn`` (Mongolian)\n* ``lt`` (Lithuanian)\n* ``lv`` (Latvian)\n* ``nl`` (Dutch)\n* ``no`` (Norwegian)\n* ``pl`` (Polish)\n* ``pt`` (Portuguese)\n* ``pt_BR`` (Portuguese - Brazilian)\n* ``ro`` (Romanian)\n* ``ru`` (Russian)\n* ``sl`` (Slovene)\n* ``sk`` (Slovak)\n* ``sr`` (Serbian)\n* ``sv`` (Swedish)\n* ``te`` (Telugu)\n* ``tet`` (Tetum)\n* ``tg`` (Tajik)\n* ``tr`` (Turkish)\n* ``th`` (Thai)\n* ``uk`` (Ukrainian)\n* ``vi`` (Vietnamese)\n* ``zh`` (Chinese - Traditional)\n* ``zh_CN`` (Chinese - Simplified / Mainland China)\n* ``zh_TW`` (Chinese - Traditional / Taiwan)\n* ``zh_HK`` (Chinese - Traditional / Hong Kong)\n\nYou can supply values like ``fr_FR``; if the country doesn't exist but the\nlanguage does, the code will fall back to the base language (i.e. ``fr``). If\nyou supply an unsupported language, ``NotImplementedError`` is raised.\nTherefore, if you want to call ``num2words`` with a fallback, you can do::\n\n    try:\n        return num2words(42, lang=mylang)\n    except NotImplementedError:\n        return num2words(42, lang='en')\n\nAdditionally, some converters and languages support other optional arguments\nthat are needed to make the converter useful in practice.\n\nWiki\n----\nFor additional information on some localization please check the Wiki_.\nAnd feel free to propose wiki enhancement.\n\n.. _Wiki: https://github.com/savoirfairelinux/num2words/wiki\n\nHistory\n-------\n\n``num2words`` is based on an old library, ``pynum2word``, created by Taro Ogawa\nin 2003. Unfortunately, the library stopped being maintained and the author\ncan't be reached. There was another developer, Marius Grigaitis, who in 2011\nadded Lithuanian support, but didn't take over maintenance of the project.\n\nI am thus basing myself on Marius Grigaitis' improvements and re-publishing\n``pynum2word`` as ``num2words``.\n\nVirgil Dupras, Savoir-faire Linux\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavoirfairelinux%2Fnum2words","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavoirfairelinux%2Fnum2words","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavoirfairelinux%2Fnum2words/lists"}