Skip to main content

A multi-language library to convert numbers to words and words to numbers.

Project description

Word Number Converter

A lightweight, multi-language Python library for converting numbers to words and words back to numbers.
It supports multiple human languages, Chinese numeral systems, and Roman numerals, all through a simple API.


✨ Features

  • Convert integers to words in multiple languages
  • Convert words back to integers (where supported)
  • Chinese number systems:
    • Simplified
    • Traditional
    • Financial
  • Roman numeral conversion
  • Handles negative numbers
  • No external dependencies

🌍 Supported Languages

Number → Words

  • English (en)
  • Chinese (zh)
  • Spanish (es)
  • French (fr)
  • German (de)
  • Swahili (sw)
  • Japanese (ja)
  • Arabic (ar)
  • Roman numerals

Words → Number

  • English (en)
  • Chinese (zh)
  • Roman numerals (roman)

⚠️ Reverse conversion is not yet implemented for all languages.


📦 Installation

pip install word-number-converter

🚀 Quick Start

from word_number_converter import WordNumberConverter

converter = WordNumberConverter()

Number to Words

converter.number_to_words(123)
# "one hundred twenty-three"

converter.number_to_words(456, lang="es")
# "cuatrocientos cincuenta y seis"

converter.number_to_words(789, lang="fr")
# "sept cent quatre-vingt-neuf"

converter.number_to_words(2024, lang="zh", system="simplified")
# "二千零二十四"

converter.number_to_words(-15, lang="de")
# "minus fünfzehn"

Words to Number

converter.words_to_number("one hundred twenty three")
# 123

converter.words_to_number("一百二十三", lang="zh")
# 123

converter.words_to_number("MCMXCIV", lang="roman")
# 1994

Roman Numerals

converter.number_to_roman(1994)
# "MCMXCIV"

converter.roman_to_number("XLII")
# 42

🀄 Chinese Number Systems

converter.number_to_words(1024, lang="zh", system="simplified")
# 一千零二十四

converter.number_to_words(1024, lang="zh", system="traditional")
# 一千零二十四

converter.number_to_words(1024, lang="zh", system="financial")
# 壹仟零贰拾肆

Supported systems:

  • simplified
  • traditional
  • financial

🧠 Design Notes

  • Focused on correctness and readability over linguistic edge cases
  • Designed for NLP preprocessing, localization, and educational use
  • No third-party dependencies
  • Python ≥ 3.7

📄 License

MIT License


👤 Author

Ricardo 📧 ricardo.devstudio@gmail.com


🔗 Links

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

word_number_converter-0.1.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

word_number_converter-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file word_number_converter-0.1.0.tar.gz.

File metadata

  • Download URL: word_number_converter-0.1.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for word_number_converter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0addd806327ecd18d1d1be569e919f4d68541acea604482190d9368c495c4a62
MD5 90e8665c30580aef9c0ec4ad0810e3bb
BLAKE2b-256 636473161fcf01e3bfd519dc4bb37fb7ec3c187a721e29b4f45f0a14119e4480

See more details on using hashes here.

File details

Details for the file word_number_converter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for word_number_converter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af40abe218624137eec5006a0e5f3f0591dc87054237ead4535fa3ee1284ab06
MD5 bbef5a7830a582a4ba229ab70ff257b8
BLAKE2b-256 8b267c4ee0067efc81bac7f5e9f30e988a95ffc708c879e862001b237967d316

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