price-parser
Extract price and currency from a raw string
What it is and what it does
price-parser is a small library for extracting structured price data from raw text. It parses price amounts and currency symbols from messy strings—the kind you'd extract from a web page with a CSS selector—and returns them as a Price object with numeric amount (as Decimal), currency symbol, and original text representations. The library handles the tedious parts: thousand and decimal separators that vary by locale (commas, periods, spaces), currency symbols in different positions, and edge cases like free items or ambiguous formatting.
The main use case is web scraping: instead of writing site-specific regex or parsing logic, you pass a price string to Price.fromstring() and get back clean, normalized data. It supports a wide range of international formats and currencies, with optional hints for disambiguation when the input is ambiguous. When extraction fails, it gracefully returns None for missing fields rather than raising exceptions.
Use it for:
- Web scraping: extract and normalize prices from product pages across different e-commerce sites.
- Price comparison tools: parse prices from multiple sources with different formatting conventions.
- Data cleaning: normalize price strings in bulk datasets before analysis or storage.
- Localized shopping apps: handle prices in different currencies and decimal/thousand separator conventions.
- Automated price monitoring: extract prices from HTML snapshots for historical tracking or alerts.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extracts price amounts and currency symbols from unstructured text strings, handling varied formats, thousand separators, and decimal separators across multiple locales.
Yes. Low install friction, active maintenance, no known vulnerabilities, permissive license, and a focused, well-tested utility (900+ real-world test cases). Install if you need to parse prices from text; skip if you only work with structured price data or APIs that already return normalized amounts.
Install
price-parser on PyPI
pip
pip install price-parseruv
uv add price-parserpoetry
poetry add price-parserInstalling price-parser
Before you install
Low friction installation with a single lightweight dependency (attrs). Active maintenance with recent releases; last commit 2026-08-06 and latest release 2026-03-19. Supports Python 3.9 through 3.14.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install price-parser
from price_parser import Price
price = Price.fromstring("22,90 €")
print(price.amount, price.currency)
Requires Python 3.9 or later.
Verify before relying
- Whether the library handles all Unicode currency symbols or only a defined set.
- Performance characteristics when parsing large batches of price strings.
- Whether currency_hint matching is case-sensitive or locale-aware.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — attrs |
| Maintenance | actively maintained — 148 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 820,097/month — #4,975 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: price_parser-0.5.1-py3-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
pricesHandles monetary amounts with currency…
permissive · top 15,000 on PyPI
forex-pythonFetches current and historical foreign exchange…
permissive · top 15,000 on PyPI
currency-symbolsMaps ISO 4217 currency codes to their symbols…
permissive · top 5,000 on PyPI
py-moneyRepresents monetary amounts with currency-aware…
permissive · top 15,000 on PyPI
cpiAdjusts U.S. dollar amounts for inflation using…
permissive · top 15,000 on PyPI
CurrencyConverterConverts currency amounts using historical…
unclear · top 15,000 on PyPI
py-moneyedProvides Money and Currency classes for…
permissive · top 5,000 on PyPI
parselParsel extracts data from HTML, JSON, and XML…
permissive · top 5,000 on PyPI
django-moneyAdds Money and currency field types to Django…
permissive · top 5,000 on PyPI
overpunchParses and formats overpunch-encoded numbers, a…
permissive · top 15,000 on PyPI