Python SDK for the Verda Enterprise Watermarking API
Project description
Verda Python SDK
Python SDK for the Verda Watermarking API.
Embed imperceptible watermarks into images, videos, and audio. Decode watermarks to trace content back to its source.
Install
pip install verda-watermark
Quick Start
from verda import VerdaClient
client = VerdaClient(api_key="vk_...")
# Encode a watermark
result = client.encode(file="photo.jpg")
print(result.watermark_ref) # Unique reference for this watermark
print(result.verify_url) # Verification link (verda.ai/XXXXXX)
print(result.download_url) # Download the watermarked file
# Encode from a URL
result = client.encode(url="https://cdn.example.com/video.mp4")
# Decode / verify a watermark
result = client.decode(file="suspect.jpg")
print(result.match) # True if watermark found
print(result.provenance) # Origin info (owner, verify_url, etc.)
# Check credits
balance = client.credits()
print(f"${balance.balance_dollars:.2f} remaining")
Configuration
client = VerdaClient(
api_key="vk_...", # or set VERDA_API_KEY env var
base_url="https://api.verda.ai/api/v2/enterprise", # default
poll_interval=5, # seconds between job polls
poll_timeout=300, # max seconds to wait
)
Async Jobs
By default, encode() and decode() wait for the job to complete. For long-running jobs (video), use wait=False:
# Start encode without waiting
job_id = client.encode("long_video.mp4", wait=False)
# Check status later
job = client.get_job(job_id)
print(job.status) # QUEUED, PROCESSING, COMPLETED, or FAILED
Job Management
# List your recent jobs
job_list = client.list_jobs(page=1, limit=20)
for job in job_list.jobs:
print(f"{job.job_id}: {job.job_type} - {job.status}")
if job.verify_url:
print(f" Verify: {job.verify_url}")
# Filter by source (jobs from SDK vs web playground)
api_jobs = client.list_jobs(source="api")
playground_jobs = client.list_jobs(source="playground")
# Delete server-side files for a completed job
client.delete_job_files(job_id)
Watermark Registry (On-Prem)
For on-prem deployments where you run the codec yourself, use the registry to allocate watermark IDs centrally:
# Register a watermark before encoding locally
reg = client.register_watermark(
content_type="audio",
file_hash="sha256_of_original_file",
file_format="wav",
duration_seconds=180.0,
)
uid = reg["uid"] # Embed this value with your local codec
ref = reg["watermark_ref"] # Store this for your records
# After decoding, look up the watermark
entry = client.lookup_watermark(uid=uid)
if entry:
print(f"Registered by: {entry.client_id}")
print(f"Content type: {entry.content_type}")
Model Manifest (On-Prem)
manifest = client.get_model_manifest()
print(f"Latest encode version: {manifest.latest_encode_version}")
for v in manifest.versions:
print(f" v{v.version} (default={v.is_default_encode})")
On-Prem Mode
Point the client to your local server:
client = VerdaClient(api_key="vk_...", on_prem="http://localhost:8001")
# File-based
result = client.encode(file="speech.wav")
# Tensor-based (requires numpy + soundfile)
result = client.encode_tensor(audio_16k=waveform, sample_rate=16000)
Supported Formats
| Type | Formats |
|---|---|
| Image | jpg, png, webp, bmp, gif, tiff, heic |
| Video | mp4, mov, avi, mkv, webm |
| Audio | mp3, wav, flac, aac, ogg, m4a |
Pricing
New accounts receive a one-time free credit. See enterprise.verda.ai/api-docs for current pricing.
Error Handling
from verda import VerdaClient, VerdaError, InsufficientCreditsError
try:
result = client.encode(file="photo.jpg")
except InsufficientCreditsError:
print("Top up your credits at enterprise.verda.ai")
except VerdaError as e:
print(f"Error: {e.message} (HTTP {e.status_code})")
License
MIT
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 verda_watermark-0.3.2.tar.gz.
File metadata
- Download URL: verda_watermark-0.3.2.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21974f73177239080c7d257745d4802f16d8b80b9047ae149b5aadde6355b280
|
|
| MD5 |
fef585b780346f829c08742262dee6d2
|
|
| BLAKE2b-256 |
fc9956a4a706bf68b805ec977e0b18476b80f229a6790687051ad7ec1b0f4bf4
|
File details
Details for the file verda_watermark-0.3.2-py3-none-any.whl.
File metadata
- Download URL: verda_watermark-0.3.2-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c109033f80927d8c843a0d8b86130e10d60a42eadac516f049bdbaa6d9851c5
|
|
| MD5 |
aadb89dbc6796a2204f26d2e9855f46a
|
|
| BLAKE2b-256 |
3c0f94753fd8a9b365da7b384ec30a67a10c367d51d44b7a6416a8ad27c0f3c6
|