Skip to main content

terbium

Business documents in. Clean rows out.

PyPI Python 3.9+ License: MIT

Documentation · Quickstart · Changelog · Releases · Trove

terbium parses business documents (vendor catalogues first, plus invoices, receipts, resumes, price lists and decks) into clean rows. It rebuilds structure from the position of every word, scores its own confidence, and only calls an AI model when the algorithm cannot be sure.


Sponsors

Primary sponsor

NodeMaven: best proxy for web scraping and automation with the highest quality IP

NodeMaven: the most efficient proxy provider for web scraping and automation, with the highest quality IPs on the market.

Why NodeMaven?

  • ZIP targeting
  • 99.9% uptime
  • IP filtering: every proxy has a fraud score under 97%
  • No KYC required
  • Free tools: Proxy Bandwidth Checker, Meta Tag Checker, IP Lookup and more

Codes for terbium users: TERBIUM35 for 35% off mobile and residential proxies, TERBIUM40 for 40% off ISP (static) proxies.


Install

pip install terbium-parse

The PyPI name is terbium-parse; you import terbium, and the command is terbium. (The PyPI project named terbium is unrelated.) terbium --version prints the installed version.

Optional AI lanes: pip install "terbium-parse[anthropic]" (or openai, kimi, grok, gemini, or ai for all). OCR of images and image-only pages needs a local tesseract binary. Details: Installation.

Example

Point it at a vendor catalogue and get a table of products, each with its name, SKU, materials or ingredients, dimensions and image. Then a CSV.

import terbium

rows = terbium.build_catalog("vendor_catalogue.pdf", images_dir="images/")
terbium.to_catalog_csv(rows, "catalogue.csv")
# rows: {"sku": "RG-1001", "name": "Anatolia Kilim", "materials": "wool",
#        "dimensions": None, "image": "Anatolia_Kilim.jpeg", "page": 12}

The same engine reads other documents:

doc = terbium.parse("invoice.pdf")                     # line items, totals, vendor
cv = terbium.parse("maria_cv.pdf", doc_type="resume")  # sections, experience, skills
print(doc.stats)   # Stats(total=..., confident=..., ambiguous=...)
terbium catalogue.pdf --csv out.csv                    # product table + photos, no AI
terbium invoice.pdf --csv rows.csv --html report.html  # CSV + self-contained report

Features

  • Structure from geometry. Running headers are stripped, two-page spreads split, and columns, rows and matrices rebuilt from word positions. The table detector is content-agnostic.
  • Catalog table. Each product photo anchors a row; the name, SKU, materials and dimensions are mined from nearby text, and the photo is extracted and named after the product.
  • Many document types. Automatic classification into catalogue, lookbook, transaction, resume, table or deck, with --type to override.
  • Formats. PDF, PPTX, XLSX, CSV, and PNG, JPG, WEBP or TIFF images through local OCR.
  • Confidence on every record. Each record carries a 0.05 to 1.0 score and the reasons behind it.
  • AI only where needed. Hard tables go to a routed model tier (Haiku, Sonnet or Opus class) across Claude (default), GPT, Kimi, Grok and Gemini. With no key, terbium prints which pages need help and which tier it recommends.
  • Feeds. Normalized colour, material and dimension fields, plus Shopify CSV and PIM JSON exporters.

Documentation

Developer notes stay in this repository: docs/DESIGN.md, docs/ROADMAP.md and docs/TAXONOMY.md.

Contributing

Issues and pull requests are welcome at https://github.com/velofy/terbium. To work on the code:

git clone https://github.com/velofy/terbium.git
cd terbium
pip install -e ".[dev]"
python -m pytest -q
python eval/category_bench.py

License

MIT. Built by anishfyi. See LICENSE.

terbium · Tb · 65

Metadata

Release files for terbium-parse 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terbium-parse 2.0.0
File Size Uploaded Provenance Actions
terbium_parse-2.0.0.tar.gz 76.8 kB Without provenance Details for terbium_parse-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for terbium-parse 2.0.0
File Interpreter ABI Platform Actions
terbium_parse-2.0.0-py3-none-any.whl Python 3 none any Details for terbium_parse-2.0.0-py3-none-any.whl

Total release size: 163.5 kB

Release files / terbium_parse-2.0.0.tar.gz

Download URL terbium_parse-2.0.0.tar.gz
Size 76.8 kB
Tags Source
SHA-256 checksum
How to use checksums
46ea44685553c03999efa439f8d5116c5d231b930b8a5327adea3a284e52fc75
BLAKE2b-256 checksum
How to use checksums
ff4b872d330be49360c9209d31e9a063a451163dbe07bfe7ab03aa0c8cd85a8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / terbium_parse-2.0.0-py3-none-any.whl

Download URL terbium_parse-2.0.0-py3-none-any.whl
Size 86.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30aa95d9ef1eb9d45537d315c74e96841442946bb0bf97dfb37ddb6d37474d59
BLAKE2b-256 checksum
How to use checksums
293da7423da26ddfea86964529b7b9758f75def4bd6acd8e29930d054528224f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for terbium-parse 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page