skillfed

number-parser

parse numbers written in natural language

number-parser v0.3.2 680.8K downloads/30d#5,365 on PyPI129
Permissive license DORMANT released

What it is and what it does

number-parser is a text-to-number converter that identifies and transforms written numbers in natural language into their numeric equivalents. It handles cardinal numbers ("twenty three" → 23), ordinal numbers ("twenty third" → 23), and fractions ("one over two" → "1/2") in English, and cardinal numbers in Hindi, Spanish, Ukrainian, and Russian. The library provides three main functions: parse() to convert numbers in-place within a text string, parse_number() to convert a single written number, and parse_ordinal() and parse_fraction() for specialized cases.

The package depends only on attrs and installs as a pure Python wheel with low friction. It is marked Production/Stable and supports Python 3.7 through 3.11. Maintenance is dormant (no releases since March 2023), though the repository remains active. The library handles ambiguous cases and language-specific nuances, making it suitable for data extraction, form processing, and NLP pipelines where written numbers must be normalized to numeric form.

Use it for:

  • Extract and normalize written numbers from unstructured text or user input in multilingual documents.
  • Convert ordinal text ("first", "second", "twenty third") to integers for ranking or ordering tasks.
  • Parse fractional expressions written in words for mathematical or scientific data processing.
  • Preprocess text data for NLP or machine learning pipelines that require numeric normalization.
  • Build chatbots or voice assistants that accept spoken/written numbers and need to convert them to machine-readable form.

Worth the install?

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

Converts numbers written in natural language (e.g., "twenty three") to their numeric equivalents, supporting cardinal numbers in English, Hindi, Spanish, Ukrainian, and Russian, plus English ordinals and fractions.

Yes—if you need to parse written numbers in English, Hindi, Spanish, Ukrainian, or Russian. The library is stable, has no security vulnerabilities, and installs with minimal friction. Dormant maintenance is a minor concern for long-term support, but the code is straightforward and unlikely to break with Python updates. Not worth installing if you only need English and have simpler regex-based solutions in place, or if you need ordinal/fraction support in languages other than English.

Install

number-parser on PyPI

pip

pip install number-parser

uv

uv add number-parser

poetry

poetry add number-parser

Installing number-parser

Before you install

Low friction—pure Python wheel with a single dependency (attrs). Dormant maintenance since March 2023, but the repository is not archived and the last commit is recent (October 2024), suggesting occasional updates. Stable for production use if your language and number-type needs align with what's supported.

License in practice

Permissive BSD license; no restrictions on commercial or proprietary use.

Quickstart

pip install number-parser

from number_parser import parse, parse_number
parse("I have two hats and thirty seven coats")
# 'I have 2 hats and 37 coats'
parse_number("two thousand and twenty")
# 2020

Verify before relying

  • Whether the library handles edge cases in languages other than English (e.g., grammatical variations, regional dialects) as robustly as English.
  • Performance characteristics on very long texts or texts with many embedded numbers.
  • Whether ordinal and fraction parsing work reliably for all supported number ranges.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — attrs
Maintenance dormant — 1,235 days since the last release
Last repo commit
First released
Downloads 680,804/month — #5,365 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: number_parser-0.3.2-py2.py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

natural language number parsingconvert words to numberstext to numeric conversionordinal number parsingmultilingual number recognitionfraction parsing from textcardinal number extraction
nlpmultilingualtext-parsing

More Linguistic packages