Skip to main content

thresh-sdk

Official Python client for Thresh: documents in, schema-conformant JSON out. Full API reference at https://usethresh.com/docs.

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.
  • No schema? client.upload("contract.pdf") runs auto-extraction: the engine discovers and names the fields and tables itself. Refine what it found, then client.create_template("sale-contract", fields=[...]) and reuse it with client.upload("next.pdf", template="sale-contract").
  • 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".

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.9.1.tar.gz (20.0 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.9.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thresh_sdk-0.9.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for thresh_sdk-0.9.1.tar.gz
Algorithm Hash digest
SHA256 4e6240dd57d16176245cec50275f6b7019ac46fc1adc7667ef82c132cb6c3daf
MD5 caf5847d53655e0da3857196b4b7a431
BLAKE2b-256 7c57fdcf2e4456bdb1febae1c9b1bfeec28440451fed122aacfc20c4991903b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for thresh_sdk-0.9.1.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.9.1-py3-none-any.whl.

File metadata

  • Download URL: thresh_sdk-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for thresh_sdk-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1edfa8c84fff8fd619e826c88d567ab56102ee6fc95c1d5b77e8f1ffe3437f9
MD5 30e699eedf00982ab9ddc521d7843f8c
BLAKE2b-256 21afad447d335c1a6a721a614f9791bb768386c4f821f9b939e77874d4b5f8a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for thresh_sdk-0.9.1-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.

Release history Release notifications | RSS feed

This release

0.9.1 This release

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

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