Python client for the HTPBE PDF tamper/forgery detection API
Project description
htpbe — Python client
Python client for the HTPBE API — structural PDF tamper & forgery detection. It analyses a PDF's byte-level structure (xref tables, incremental updates, signatures, object streams) to detect whether a document was modified after creation. No original copy needed.
Not a KYC/identity platform — it's the structural PDF-forensics layer. Full API reference: https://htpbe.tech/api
Install
pip install htpbe
Quickstart
from htpbe import Client
client = Client(api_key="htpbe_live_...") # get a key at https://htpbe.tech/api
result = client.analyze_and_wait("https://example.com/invoice.pdf")
print(result["status"]) # "intact" | "modified" | "inconclusive"
print(result["modification_markers"]) # e.g. ["HTPBE_POST_SIGNATURE_EDIT"]
The API works on any publicly accessible PDF URL (≤ 10 MB), downloadable without authentication.
Two-step flow
analyze_and_wait is shorthand for the underlying two calls:
check_id = client.analyze("https://example.com/contract.pdf")
result = client.get_result(check_id)
List your checks
page = client.list_checks(limit=50)
for check in page["data"]:
print(check["id"], check["status"])
print(page["total"]) # total number of checks
Error handling
from htpbe import HtpbeAPIError
try:
result = client.analyze_and_wait(url)
except HtpbeAPIError as exc:
print(exc.status, exc.code, exc.message) # e.g. 402 payment_required ...
Testing without spending credits
Test keys (htpbe_test_...) return deterministic synthetic results and only accept the documented test URLs — see the API docs. Live keys (htpbe_live_...) accept any public PDF URL and draw from your credit balance.
What you can detect
The verdict is intact, modified, or inconclusive, with named modification_markers. Common use cases:
Links
- API reference & keys: https://htpbe.tech/api
- Free web checker: https://htpbe.tech
- How it works: https://htpbe.tech/how
License
MIT
Project details
Release history Release notifications | RSS feed
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 htpbe-0.1.0.tar.gz.
File metadata
- Download URL: htpbe-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72771ac58cb6e051261fd612697bcf5047187e919b3eec79e0acbb041dda939f
|
|
| MD5 |
a804433d65674bae04373bb52e94fe6f
|
|
| BLAKE2b-256 |
bf1418d21c19f752a36064e1a42c5999c5e7a25bae9ad566aa52f656dc701e7f
|
Provenance
The following attestation bundles were made for htpbe-0.1.0.tar.gz:
Publisher:
publish.yml on htpbe/python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
htpbe-0.1.0.tar.gz -
Subject digest:
72771ac58cb6e051261fd612697bcf5047187e919b3eec79e0acbb041dda939f - Sigstore transparency entry: 1644593360
- Sigstore integration time:
-
Permalink:
htpbe/python-client@125d2d7b962280cb8e1dbb61f624fd660f9026e6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/htpbe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@125d2d7b962280cb8e1dbb61f624fd660f9026e6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file htpbe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: htpbe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40975cd8a59bb48bfda4c70d5622dae14e27ae867e551cf4ef95d4ce997c10c2
|
|
| MD5 |
a177b71a15af20313f659b78b8ab648f
|
|
| BLAKE2b-256 |
1581913da4be897d6d6cea6f371adfa962c3b44c9de2065063de43c6f06ed06c
|
Provenance
The following attestation bundles were made for htpbe-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on htpbe/python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
htpbe-0.1.0-py3-none-any.whl -
Subject digest:
40975cd8a59bb48bfda4c70d5622dae14e27ae867e551cf4ef95d4ce997c10c2 - Sigstore transparency entry: 1644593429
- Sigstore integration time:
-
Permalink:
htpbe/python-client@125d2d7b962280cb8e1dbb61f624fd660f9026e6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/htpbe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@125d2d7b962280cb8e1dbb61f624fd660f9026e6 -
Trigger Event:
release
-
Statement type: