Skip to main content

A package to convert numbers to words and vice-versa

Project description

num-word-converter

num-word-converter is a Python package that provides functionality to convert numbers to words and words to numbers.

Features

  • Convert integer and float numbers to English words
  • Convert English words of numbers back to integer or float
  • Error handling for non-numeric and complex inputs

Usage

from num_word_converter import num_to_word, word_to_num

print(num_to_word(123))
# one hundred and twenty-three

print(word_to_num("one hundred and twenty-three"))
# 123

Running the tests

Tests are run using tox, which also builds a coverage report.

If you haven't installed tox, install it using pip:

pip install tox

Then to run the tests, simply run tox from the project root:

tox

This will run the tests in each environment specified in tox.ini, and generate a coverage report. Note that tox handles setting up the virtual environments and installing dependencies, so it's not necessary to activate a virtual environment or install dependencies manually.

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

num_word_converter-1.0.4.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

num_word_converter-1.0.4-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file num_word_converter-1.0.4.tar.gz.

File metadata

  • Download URL: num_word_converter-1.0.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for num_word_converter-1.0.4.tar.gz
Algorithm Hash digest
SHA256 cd5293968e2041e1b730d8c8bdd36da97785c58e9c9cafef804d1bb41f59aa73
MD5 d46f40b4b0ba9a2ebc3040b282ecb914
BLAKE2b-256 6fd14d8b70e9dad3f09d39b70dba820da1524c319cb121dfcb0865e9b0f955ee

See more details on using hashes here.

File details

Details for the file num_word_converter-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for num_word_converter-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 956835cc73883c84f0f6d31e3be99709a1bbf1b3efa7f360c49e8fe25ff9cee6
MD5 97c8cc730add168e508008043ebca195
BLAKE2b-256 ded63222cd73973ec3d002fa8c53840ec4a345b797b09651f46221e9c319af1f

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