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.1.tar.gz (5.7 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.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for num_word_converter-1.0.1.tar.gz
Algorithm Hash digest
SHA256 58ddcd6beb46a5ec442995af45acd6de94105289a624cb6ac001c80d1c05f1b4
MD5 b3723ba4f197667e27540b080bad42ed
BLAKE2b-256 4f6b664ad57fcee8b4695ad4b6b5f1b430019479e163b5dd2a382e66fe9207a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for num_word_converter-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ee11a24256c944171ee84e54a63fb49dc69612d4b617dbc10c4dcc130a3e5ab
MD5 26fc9f49c73a50081394f93fd16499bf
BLAKE2b-256 c6a5ad7ba491834051cb73a417d2c5a73728a443caad1d9f2f72fdf2955a4fe8

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