Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rfq_parser-0.1.0.tar.gz (53.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rfq_parser-0.1.0-cp311-abi3-win_amd64.whl (785.5 kB view details)

Uploaded CPython 3.11+Windows x86-64

rfq_parser-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (912.2 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

rfq_parser-0.1.0-cp311-abi3-macosx_11_0_arm64.whl (819.5 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file rfq_parser-0.1.0.tar.gz.

File metadata

  • Download URL: rfq_parser-0.1.0.tar.gz
  • Upload date:
  • Size: 53.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rfq_parser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe7cc4e3e46aec149becb561a3df5af1e7ecc1daf09f85b3775a2dd94d68fd72
MD5 747ff60353d2f22fd8218a8206694d02
BLAKE2b-256 b870b71c5405bf344091522126dc9192c0a393e665d435d491dbfad0ddaebe20

See more details on using hashes here.

Provenance

The following attestation bundles were made for rfq_parser-0.1.0.tar.gz:

Publisher: publish.yml on progdinh/rfq-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rfq_parser-0.1.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: rfq_parser-0.1.0-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

Hashes for rfq_parser-0.1.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 295a04f0a92552db624eb56c4eb9080cb0b9dbb71ea748535ccfa02e1c804bcc
MD5 078d7524f8942d78877eaff89c8c96e6
BLAKE2b-256 f122154c9039ff63f1de78bcbd6b09745e98a3d19b59d7acd49701110c0bda44

See more details on using hashes here.

Provenance

The following attestation bundles were made for rfq_parser-0.1.0-cp311-abi3-win_amd64.whl:

Publisher: publish.yml on progdinh/rfq-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rfq_parser-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rfq_parser-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 21cd64b3542f7acb33cf5e174174f350423e6112372a69fbc6b13c11345e64d1
MD5 a63e8b9b98d4c601674dee2defaf9664
BLAKE2b-256 de1b71bd9784b5cc21db2b442fa5cb2522a308db41b2be5be17cbec112fc36d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for rfq_parser-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on progdinh/rfq-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rfq_parser-0.1.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rfq_parser-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37429379c7f4036f137bba7a7b9dd5d8413ca06f838339902873908ef523ae12
MD5 078f6ff4aa04b881792498f3c529b186
BLAKE2b-256 367f2c20522f592bacce02f540ec4e73f035b3ded37cc1528e8b084bc6903478

See more details on using hashes here.

Provenance

The following attestation bundles were made for rfq_parser-0.1.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on progdinh/rfq-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page