markproof
Python client for the Markproof API — EU AI Act Article 50 watermarking and verification in one call. Thin wrapper over requests.
Is your AI output Article 50-ready? Drop a file into the free checker (no signup) to see whether it carries a watermark and signed Content Credentials.
Install
pip install markproof
Usage
from markproof import Markproof
client = Markproof(api_key="lt_live_...")
marked = client.mark("generated.png", generator_name="my-app", model_name="my-model-v1")
print(marked.watermark_code, marked.verify_url)
with open("generated-marked.png", "wb") as f:
f.write(marked.file)
result = client.verify("generated-marked.png")
print(result.summary)
API
Markproof(api_key, base_url=DEFAULT_BASE_URL)—base_urldefaults to the production API; override for local dev.client.mark(file, filename=None, generator_name=None, model_name=None, response_format="file", visible_label=None, label_position=None)→MarkResult—fileis a path (str/os.PathLike) or rawbytes(in which casefilenameis required).response_format="file"(default) returns the marked bytes inline (result.file/result.content_type);"url"returns a short-lived signed download URL instead (result.file_url, ~1 hour — download promptly rather than caching it). Either way you also getasset_id,watermark_code,verify_url,c2pa_manifest_label.visible_label(images only):Truedraws a visible "AI-generated" label (EU AI Act Art. 50(4)) before marking, or pass your own text (max 40 characters);label_positionpicks the corner ("bottom-right"default,"bottom-left","top-right","top-left").client.verify(file, filename=None)→VerifyResult—watermark/c2padetection results,matched_assetif the watermark matches a record in Markproof's database, and a human-readablesummary.client.get_asset(asset_id)→Asset— requires an API key on the same project that created the asset.
All methods raise MarkproofError (with .status and .body) on a non-2xx response.
Batches and webhooks
For volume, queue many files at once instead of calling mark per file. Each item counts as one mark.
created = client.create_batch(
urls=["https://cdn.example.com/1.png", "https://cdn.example.com/2.png"], # and/or files=["a.png", (data, "b.wav")]
generator_name="your-app",
webhook_url="https://your-app.example.com/hooks/markproof", # optional
)
batch = client.wait_for_batch(created.batch_id) # or get_batch(...), or wait for the webhook
for item in batch.items:
print(item.index, item.status, item.file_url or item.error)
client.create_batch(files=None, urls=None, generator_name=None, model_name=None, webhook_url=None)→CreatedBatch— files go up in one multipart request (keep the total under ~4.5 MB; useurlsfor more). Max items per batch: 10 Free, 100 Indie, 1,000 Pro.client.get_batch(batch_id)→Batch—status(queued/processing/completed/partial/failed),counts, anditemswithasset_id,watermark_code,verify_url,file_url(signed, ~1 hour; call again for a fresh one) orerror.client.wait_for_batch(batch_id, interval=3.0, timeout=900, on_progress=None)— polls until the batch is final.
Verify webhooks with the raw request body and your signing secret from the dashboard:
from markproof import verify_webhook_signature
ok = verify_webhook_signature(
request.get_data(), # the exact bytes received, not re-serialized JSON
request.headers.get("Markproof-Signature"),
os.environ["MARKPROOF_WEBHOOK_SECRET"],
)
parse_webhook_event(...) does the same and returns the batch.completed event, raising WebhookSignatureError if the signature doesn't match. Event ids are stable across retries, so use them to drop duplicates.
Metadata
Release files for markproof 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| markproof-0.2.0.tar.gz | 14.6 kB | Without provenance | Details for markproof-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| markproof-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for markproof-0.2.0-py3-none-any.whl |
Total release size: 25.5 kB
Release files / markproof-0.2.0.tar.gz
| Download URL | markproof-0.2.0.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d0c9cf88753c6b6493ddebbf308ef50d81441b49a104cc1653a915ce8fe3197
|
|
BLAKE2b-256 checksum How to use checksums |
192f83c66cbb1fffeb0d158707747f88315ba8f01e8a1f9502331f8cbaeb04cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / markproof-0.2.0-py3-none-any.whl
| Download URL | markproof-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
081c37338f876d44710d5d3cef7e63b2b562682d4810842607d78247c107a619
|
|
BLAKE2b-256 checksum How to use checksums |
98ce4225c3f932d0cf4acff63733c63581af30ff33a60ab93c8abe727a874501
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for markproof 0.2.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.