skillfed

price-parser

Extract price and currency from a raw string

price-parser v0.5.1 820.1K downloads/30d#4,975 on PyPI346
Permissive license BSD-3-Clause Active released

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-parser

uv

uv add price-parser

poetry

poetry add price-parser

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

parse price from textextract currency and amountprice string parsingcurrency extractionweb scraping price cleanupdecimal separator handlinginternational price parsing
web-scrapingdata-extractionparsing

More Text Processing packages