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; passidempotency_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, thenclient.create_template("sale-contract", fields=[...])and reuse it withclient.upload("next.pdf", template="sale-contract"). wait(id, timeout=300)polls untilcompletedorfailed(failed results return with.errorset — no exception).verify_webhook_signature(secret, header, body)validatesThresh-Signatureheaders on webhook deliveries.- Errors raise
ThreshErrorwith.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
Built Distribution
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 thresh_sdk-0.4.0.tar.gz.
File metadata
- Download URL: thresh_sdk-0.4.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1c022d207ede366dc99b0978b9d429ba1e744f2301b83a091aefaa9536b31a6
|
|
| MD5 |
63d8910af1df60331ce832015d2e3bb3
|
|
| BLAKE2b-256 |
2fea3d845c279ee4707338a8227cb0fd748a453823d7036a1848ed1f49ef4a1d
|
Provenance
The following attestation bundles were made for thresh_sdk-0.4.0.tar.gz:
Publisher:
publish-sdk.yml on Fillnull/thresh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thresh_sdk-0.4.0.tar.gz -
Subject digest:
b1c022d207ede366dc99b0978b9d429ba1e744f2301b83a091aefaa9536b31a6 - Sigstore transparency entry: 2204569715
- Sigstore integration time:
-
Permalink:
Fillnull/thresh@abe3235f8c8113e4188dffa8dc2c0fd02829170e -
Branch / Tag:
refs/tags/sdk-v0.4.0 - Owner: https://github.com/Fillnull
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@abe3235f8c8113e4188dffa8dc2c0fd02829170e -
Trigger Event:
release
-
Statement type:
File details
Details for the file thresh_sdk-0.4.0-py3-none-any.whl.
File metadata
- Download URL: thresh_sdk-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3066384190d72ab1774174b5b77f702bab01bd0194b53daddb32369710d4fb8b
|
|
| MD5 |
347f7eeacfff71a602e7201c2cc26cfb
|
|
| BLAKE2b-256 |
b3e3dd5cd15293ead090f7b8e34edf316ca754c568fedbf8dbb700f5dcb7f16d
|
Provenance
The following attestation bundles were made for thresh_sdk-0.4.0-py3-none-any.whl:
Publisher:
publish-sdk.yml on Fillnull/thresh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thresh_sdk-0.4.0-py3-none-any.whl -
Subject digest:
3066384190d72ab1774174b5b77f702bab01bd0194b53daddb32369710d4fb8b - Sigstore transparency entry: 2204569731
- Sigstore integration time:
-
Permalink:
Fillnull/thresh@abe3235f8c8113e4188dffa8dc2c0fd02829170e -
Branch / Tag:
refs/tags/sdk-v0.4.0 - Owner: https://github.com/Fillnull
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@abe3235f8c8113e4188dffa8dc2c0fd02829170e -
Trigger Event:
release
-
Statement type: