Skip to main content

Official Python client for the Thresh document extraction API

Project description

thresh-sdk

Official Python client for the Thresh document extraction API — documents in, schema-conformant JSON out.

from thresh import Thresh

client = Thresh(api_key="th_live_...")
doc = client.upload(
    "contract.pdf",
    fields=["purchase_price", "closing_date", "buyer_name"],
    tables=[{"name": "monthly_charges", "columns": ["item", "qty", "mrc"]}],
    questions=["Is the contract contingent upon financing?"],
)
result = client.wait(doc.id)

result.fields["purchase_price"]        # "399900"
result.tables["monthly_charges"]       # [{"item": ..., "qty": ..., "mrc": ...}, ...]
result.answer("Is the contract contingent upon financing?")  # "Yes"
  • upload(...) accepts a path or a binary file object; pass idempotency_key= to make retries safe.
  • wait(id, timeout=300) polls until completed or failed (failed results return with .error set — no exception).
  • verify_webhook_signature(secret, header, body) validates Thresh-Signature headers on webhook deliveries.
  • Errors raise ThreshError with .status, .error_type, and .request_id.

Missing values come back as the string "null"; checkbox states as "true"/"false".

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

thresh_sdk-0.2.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

thresh_sdk-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file thresh_sdk-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for thresh_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fed49bfbfd051d3469076c0cf0ecc406763ca72f84c5042f62e96c85b4e866b8
MD5 fb290e210611affaec6bb497b01af0cb
BLAKE2b-256 f63bf08caf8711556458959137b33ec8ba25b684064e6507cefb9e621ac53a8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for thresh_sdk-0.2.0.tar.gz:

Publisher: publish-sdk.yml on Fillnull/thresh

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

File details

Details for the file thresh_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: thresh_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thresh_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 328930116354ea29a0083a0d87dc74ab2a35e63866cc65c610d24085e93fb4b5
MD5 552b56f144b07620c466521db0f52d8f
BLAKE2b-256 65215a9a69316f2b1db413522371526f9121c3dfa98631fe115052eb6a19be77

See more details on using hashes here.

Provenance

The following attestation bundles were made for thresh_sdk-0.2.0-py3-none-any.whl:

Publisher: publish-sdk.yml on Fillnull/thresh

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