number-parser
parse numbers written in natural language
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-parseruv
uv add number-parserpoetry
poetry add number-parserInstalling 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
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
num2wordsConverts numbers to their word representations…
copyleft · top 5,000 on PyPI
parse-typeExtends the parse module with type converters…
permissive · top 5,000 on PyPI
text2digitsConverts written-out number words in text to…
permissive · top 15,000 on PyPI
word2numberConverts written-out number words (like "twenty…
permissive · top 5,000 on PyPI
unicode-rbnfConverts numbers to spelled-out text in…
permissive · top 15,000 on PyPI
text2numConverts natural language number words into…
permissive · top 15,000 on PyPI
recognizers-text-numberRecognizes and extracts numeric entities…
permissive · top 15,000 on PyPI
indic-numtowordsConverts non-negative integers to their word…
permissive · top 15,000 on PyPI
spanishconjugatorConjugates Spanish verbs by tense, mood, and…
permissive · top 15,000 on PyPI
numerizeConverts large numbers into human-readable…
permissive · top 15,000 on PyPI