Fast rule-based parser for RFQ documents and short product queries
Project description
rfq-parser
Fast, rule-based parser for RFQ (Request for Quotation) documents and short product queries.
Built in Rust with Python bindings via PyO3. Extracts structured product specifications in <1ms — no LLM, no network calls.
Install
pip install rfq-parser
Quick start
import rfq_parser
# Short product query
result = rfq_parser.parse("500 polo shirts red size XL")
item = result.items[0]
print(item.chunks) # "polo shirts"
print(item.qty) # 500.0
print(item.uom) # None (implicit pieces)
print(item.colors) # ["red"]
print(item.sizes) # ["XL"]
# RFQ document
rfq = """
Please quote for:
1. Car Battery, 3000 Cartons, Black, 70Ah, Japan. Target: 12 USD/unit.
2. Silk Fabric, 500 Yards, Red, 150cm width, China.
"""
result = rfq_parser.parse(rfq)
for item in result.items:
print(f"{item.index}. {item.chunks} — qty={item.qty} {item.uom}")
print(f" colors={item.colors}, origin={item.origin}")
if result.is_rfq:
tt = result.trade_terms() # TradeTerms | None
What it extracts
Each ParsedItem contains:
| Field | Description |
|---|---|
chunks |
Product noun phrase(s), connectors preserved ("polo shirt OR t-shirt") |
qty, qty_max, uom |
Quantity and unit of measure |
colors, sizes, materials |
Ontology-matched specs |
standards, specs |
Technical standards and extra specs |
origin, price, currency |
RFQ-specific fields |
dims |
Dimensions (e.g. ["150cm", "70Ah"]) |
ParseResult.trade_terms() returns a TradeTerms object with incoterm, currency, destination, lead_time, payment for RFQ documents.
Why rule-based?
- Deterministic — same input always gives the same output
- Fast — <1ms, safe to call on every keystroke
- No dependencies — no model to download, no API key
- LLM-friendly — use the structured output as context to reduce token count in downstream LLM calls
Supported
- English, Vietnamese, French product queries
- Informal RFQ emails and formal procurement documents
- Multi-item RFQs with trade terms (Incoterms, payment, lead time)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rfq_parser-0.1.1.tar.gz.
File metadata
- Download URL: rfq_parser-0.1.1.tar.gz
- Upload date:
- Size: 53.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86cfa23b72e799c68ef1441d0c9f32ca778f4381e830248bfd21c0c118094f39
|
|
| MD5 |
945f683f59cd4ddf42f11f1fb1cc8ca0
|
|
| BLAKE2b-256 |
81899aef91a7241eeb7bf69aae08f21f79826ab40c222065c1edd3477474ca46
|
Provenance
The following attestation bundles were made for rfq_parser-0.1.1.tar.gz:
Publisher:
publish.yml on progdinh/rfq-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rfq_parser-0.1.1.tar.gz -
Subject digest:
86cfa23b72e799c68ef1441d0c9f32ca778f4381e830248bfd21c0c118094f39 - Sigstore transparency entry: 1761509210
- Sigstore integration time:
-
Permalink:
progdinh/rfq-parser@2448d76e4a7f882d12944a45167429a5a684d1fa -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/progdinh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2448d76e4a7f882d12944a45167429a5a684d1fa -
Trigger Event:
push
-
Statement type:
File details
Details for the file rfq_parser-0.1.1-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: rfq_parser-0.1.1-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 785.5 kB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00e59a0f5379677bc872288f4d8bc2c9127303367011168a9794265663ffe5cd
|
|
| MD5 |
5b6431a04a7f08ee92a30ebffb57f4a0
|
|
| BLAKE2b-256 |
236845c93e4c22b444a54e1e420caa139f6feb66141a32401473a10b58c78a7e
|
Provenance
The following attestation bundles were made for rfq_parser-0.1.1-cp311-abi3-win_amd64.whl:
Publisher:
publish.yml on progdinh/rfq-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rfq_parser-0.1.1-cp311-abi3-win_amd64.whl -
Subject digest:
00e59a0f5379677bc872288f4d8bc2c9127303367011168a9794265663ffe5cd - Sigstore transparency entry: 1761510029
- Sigstore integration time:
-
Permalink:
progdinh/rfq-parser@2448d76e4a7f882d12944a45167429a5a684d1fa -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/progdinh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2448d76e4a7f882d12944a45167429a5a684d1fa -
Trigger Event:
push
-
Statement type:
File details
Details for the file rfq_parser-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rfq_parser-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 912.2 kB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68a3110c4ae3cff6f53b45368d447464da9898d22f5ed045233a77215f2606ad
|
|
| MD5 |
593743ad2c15f5bbe42f0a648b302a1d
|
|
| BLAKE2b-256 |
ca02246232e92269257cedc035767db6dba7c07aa13a2f36e245b5e2b9c321ba
|
Provenance
The following attestation bundles were made for rfq_parser-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on progdinh/rfq-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rfq_parser-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
68a3110c4ae3cff6f53b45368d447464da9898d22f5ed045233a77215f2606ad - Sigstore transparency entry: 1761510656
- Sigstore integration time:
-
Permalink:
progdinh/rfq-parser@2448d76e4a7f882d12944a45167429a5a684d1fa -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/progdinh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2448d76e4a7f882d12944a45167429a5a684d1fa -
Trigger Event:
push
-
Statement type:
File details
Details for the file rfq_parser-0.1.1-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: rfq_parser-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 819.3 kB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d323e237b0e69a3b3176add801d5822fbcd89593a7ec25c963a8efd9e642724
|
|
| MD5 |
65da25d52c1b814fa86605246fc2ad03
|
|
| BLAKE2b-256 |
ef1440d6f36f9536cd950fed97ab33f323877c2d56121ccf4a6f4505f6d3b26e
|
Provenance
The following attestation bundles were made for rfq_parser-0.1.1-cp311-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on progdinh/rfq-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rfq_parser-0.1.1-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
2d323e237b0e69a3b3176add801d5822fbcd89593a7ec25c963a8efd9e642724 - Sigstore transparency entry: 1761511596
- Sigstore integration time:
-
Permalink:
progdinh/rfq-parser@2448d76e4a7f882d12944a45167429a5a684d1fa -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/progdinh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2448d76e4a7f882d12944a45167429a5a684d1fa -
Trigger Event:
push
-
Statement type: