skillfed

text2num

Parse and convert numbers written in French, Spanish, English, Portuguese, German, Dutch or Italian into their digit representation.

text2num v3.0.2 685.2K downloads/30d#5,355 on PyPI119
Permissive license Active released

What it is and what it does

text2num is a parser library that recognizes and converts numbers written as natural language words into their integer or decimal digit equivalents. It supports seven languages: Dutch, English, French, German, Italian, Portuguese, and Spanish. The library handles cardinal numbers (e.g., 'ninety-five'), ordinals (e.g., 'fifth'), and decimal numbers (e.g., 'twelve point five'). The implementation is based on a Rust algorithm, providing low resource and energy consumption with small latency, and precompiled wheels are provided so you don't need to compile Rust yourself.

The package offers two main functions: direct conversion of word strings to numbers, and finding and transcribing all numbers within larger text passages. It operates in a relaxed parsing mode by default, tolerating punctuation and spacing variations in the input. There are no external runtime dependencies, making it lightweight and suitable for embedded or resource-constrained environments.

Use it for:

  • Convert spoken or transcribed numbers in customer service or voice-to-text workflows into standardized digit format.
  • Parse invoice or contract text to extract numerical amounts written in words for data entry or validation.
  • Process multilingual documents to normalize number representations for downstream analysis or database storage.
  • Build chatbots or voice assistants that need to understand number words in multiple languages.
  • Validate or clean datasets containing mixed text and number formats across international sources.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts natural language number words into their digit representations across seven languages, and detects ordinal, cardinal, and decimal numbers in text streams.

Yes. The package is actively maintained, has no known vulnerabilities, supports current Python versions, and solves a specific multilingual parsing problem with zero runtime dependencies. Install friction is moderate but manageable via precompiled wheels. The permissive license and stable API make it suitable for production use.

Install

text2num on PyPI

pip

pip install text2num

uv

uv add text2num

poetry

poetry add text2num

Installing text2num

Before you install

Medium install friction due to compiled wheels, but precompiled binaries are provided for Linux, macOS, and Windows across multiple architectures and Python versions (3.8–3.13), making installation straightforward on supported platforms. Repository is actively maintained with recent commits.

License in practice

Permissive license allows use in commercial and open-source projects without restriction.

Quickstart

pip install text2num

from text2num import text2num
result = text2num('ninety-five', 'en')
print(result)  # 95

Requires Python 3.8 or later; macOS support begins at Python 3.11.

Verify before relying

  • Whether the Rust implementation provides measurable performance gains over the retired 2.X pure-Python version.
  • Whether speech-to-text token stream processing is production-ready or experimental.
  • Exact license identifier (MIT indicated by classifier but not confirmed in metadata).

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 79 days since the last release
Last repo commit
First released
Downloads 685,181/month — #5,355 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: text2num-3.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; text2num-3.0.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; text2num-3.0.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; text2num-3.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; text2num-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; text2num-3.0.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; text2num-3.0.2-cp310-cp310-musllinux_1_2_aarch64.whl; text2num-3.0.2-cp310-cp310-musllinux_1_2_armv7l.whl; text2num-3.0.2-cp310-cp310-musllinux_1_2_i686.whl; text2num-3.0.2-cp310-cp310-musllinux_1_2_x86_64.whl; text2num-3.0.2-cp310-cp310-win_amd64.whl; text2num-3.0.2-cp311-cp311-macosx_11_0_arm64.whl; text2num-3.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; text2num-3.0.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; text2num-3.0.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; text2num-3.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl; text2num-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; text2num-3.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl; text2num-3.0.2-cp311-cp311-musllinux_1_2_aarch64.whl; text2num-3.0.2-cp311-cp311-musllinux_1_2_armv7l.whl

Keywords: French, Spanish, English, Portuguese, German, Italian, Dutch, NLP, words-to-numbers

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseNatural Language :: DutchNatural Language :: EnglishNatural Language :: FrenchNatural Language :: GermanNatural Language :: ItalianNatural Language :: PortugueseNatural Language :: SpanishProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: RustTopic :: Text Processing :: FiltersTopic :: Text Processing :: Linguistic

Tags

text to number conversionnatural language number parsingwords to digits multilingualordinal cardinal decimal detectionnumber word recognitiontext number transcriptionlanguage number parsing
multilingual-nlpnumber-parsingrust-backed

More Linguistic packages