quantulum3
Extract quantities from unstructured text.
What it is and what it does
Quantulum3 is a Python library that identifies and extracts numeric quantities and their units from plain text. It parses both standard units (litre, kilogram, terawatt) and spelled-out numbers, ranges, and uncertainties, then reconciles them against Wikipedia to determine their entity type (volume, mass, energy, etc.). When multiple units could match the same text, it uses a classifier trained on GloVe word vectors and Wikipedia context to disambiguate—for example, distinguishing currency from weight based on surrounding words.
The library returns Quantity objects containing the parsed value, unit name, entity classification, and span positions in the original text. It also supports inline parsing for debugging, export to JSON or dictionaries, and conversion to spoken form. Two lightweight runtime dependencies (inflect and num2words) handle number inflection and text-to-speech conversion. Optional classifier training is available for custom models.
Use it for:
- Parse scientific or technical documents to identify measurements and their units for indexing or validation.
- Disambiguate currency amounts from weight or distance in mixed-domain text.
- Build a dimensionless number extractor for cases where only numeric values matter.
- Convert measurement text to structured data for downstream unit conversion or comparison.
- Extract and classify quantities from product descriptions or technical specifications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extracts quantities, measurements, and their units from unstructured text, disambiguating between similar units using vector similarity and Wikipedia context.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a specific NLP problem (quantity extraction with disambiguation) that is difficult to implement from scratch. MIT licensing removes legal friction. Use it when you need to reliably extract and classify quantities from unstructured text; skip it if you only need simple regex-based number extraction.
Install
quantulum3 on PyPI
pip
pip install quantulum3uv
uv add quantulum3poetry
poetry add quantulum3Installing quantulum3
Before you install
Low friction installation with only two runtime dependencies (inflect and num2words). Active maintenance with recent releases; last commit 2026-05-19. Supports Python 3.9 through 3.13.
License in practice
MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute the package freely provided you include the license notice.
Quickstart
pip install quantulum3
from quantulum3 import parser
quants = parser.parse('I want 2 liters of wine')
print(quants[0].value, quants[0].unit.name)
Requires Python 3.9 or later. Optional classifier features require additional dependencies installable via `pip install quantulum3[classifier]`.
Verify before relying
- Whether the GloVe vector representation and Wikipedia disambiguation data are bundled or downloaded on first use, and what network/storage requirements that entails.
- Performance characteristics on large documents or real-time parsing scenarios.
- How well the parser handles domain-specific or non-English quantities.
- Typical accuracy and precision of the disambiguation classifier on real-world text.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — inflect, num2words |
| Maintenance | actively maintained — 158 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 226,851/month — #9,194 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: quantulum3-0.10.0-py3-none-any.whl
Keywords: information extraction, quantities, units, measurements, nlp, natural language processing, text mining, text processing
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
recognizers-text-number-with-unitRecognizes and extracts numbers with units…
permissive · top 15,000 on PyPI
quantitiesQuantities handles arithmetic and unit…
unclear · top 15,000 on PyPI
recognizers-text-numberRecognizes and extracts numeric entities…
permissive · top 15,000 on PyPI
recognizers-textRecognizes and extracts entities like numbers,…
permissive · top 15,000 on PyPI
recognizers-text-choiceRecognizes and resolves entities like numbers,…
permissive · top 15,000 on PyPI
unytAttaches units to NumPy arrays and provides…
permissive · top 15,000 on PyPI
textacytextacy extends spaCy's NLP capabilities with…
permissive · top 15,000 on PyPI
glinerGLiNER is a lightweight framework for named…
permissive · top 15,000 on PyPI
langextractLangExtract uses LLMs to extract and ground…
permissive · top 15,000 on PyPI
PintPint defines, operates on, and converts between…
permissive · top 5,000 on PyPI