skillfed

quantulum3

Extract quantities from unstructured text.

quantulum3 v0.10.0 226.9K downloads/30d#9,194 on PyPI150
Permissive license MIT Active released

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 quantulum3

uv

uv add quantulum3

poetry

poetry add quantulum3

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: Science/ResearchNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Text Processing :: Linguistic

Tags

extract quantities from textunit extraction nlpmeasurement parsingquantity recognitioninformation extraction unitsnumber and unit parsingtext mining quantities
nlpinformation-extractionunit-parsing

More Scientific/Engineering packages