Skip to main content

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.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, timestamp, 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}")

# 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

verda_watermark-0.3.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verda_watermark-0.3.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file verda_watermark-0.3.1.tar.gz.

File metadata

  • Download URL: verda_watermark-0.3.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for verda_watermark-0.3.1.tar.gz
Algorithm Hash digest
SHA256 224c070c52e2b38a39fc0c241118b95cd7c279593b0b77d1b92858c7835c64f5
MD5 57d6f970e4f6ab02d3f4ce37caedad13
BLAKE2b-256 99e2112bf597842160c654ee5d87ff795b6f6111849862fe260e852f9f3f6e76

See more details on using hashes here.

File details

Details for the file verda_watermark-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for verda_watermark-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f223b8ea7e30b766a48a6dba373e5d1f3a8857c089155b1d018f98780689d52d
MD5 5e1ead7c7e82cf988b91722b1a579777
BLAKE2b-256 d251d1c4e3b8af4ee67826abbc59dde6f9f377e8c9be72644b79e10f6eb1b943

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page