Skip to main content

Agent Media Tools — Python SDK

status Python 3.8+

Python client for Agent Media Tools — a free online platform for image processing, PDF manipulation, web scraping, AI generation, QR codes, pastebin, webhooks, and more.

Installation

The PyPI package is not published yet. For local review from this repository:

cd sdk/python
pip install -e .

Registry installation instructions will be added after the official package is published.

Quick Start

Free tier — no API key needed

from agentmediatools import Client

client = Client()

# 🖼️ Resize an image
with open("photo.jpg", "rb") as f:
    result = client.image.resize(f, width=800, format="webp")
    with open("photo.webp", "wb") as out:
        out.write(result)

# 🔗 Generate a QR code
qr = client.qrcode.generate("https://example.com")
with open("qrcode.png", "wb") as f:
    f.write(qr)

# 📄 Create a paste
paste = client.create_paste("Hello world!", title="My first paste")
print(paste)

# 🛠️ Developer utilities
print(client.dev.uuid())
print(client.dev.ip())

Agent API key — for premium endpoints

from agentmediatools import Client

client = Client(api_key="mt_your_key_here")

# 🌐 Scrape a web page
content = client.scrape("https://example.com")
print(content)

# 📹 Get video metadata
info = client.video_info("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
print(info)

# 🎞️ Extract audio from a video
audio = client.audio_extract("https://example.com/video.mp4")
with open("audio.mp3", "wb") as f:
    f.write(audio)

Namespace Overview

Namespace Description
client.image.* Image processing — resize, convert, compress, analyze, crop, batch
client.pdf.* PDF tools — merge, split, compress, rotate, to_text, to_images, from_images
client.ai.* AI generation — generate image/video, transcribe, remove-bg, OCR
client.web.* Web page tools — screenshot, html-to-pdf, article extract
client.intel.* Intelligence — DNS, SSL, OG preview, country, timezone, regex, text stats, color
client.tools.* Utilities — CSV, case, slugify, lorem, zip, video utils, cron validate
client.agent.* Agent substrate — identity, approvals, receipts, jobs, heartbeat, shop, provisioning
client.mailbox.* Mailbox — create, post, poll, peek, claim
client.artifact.* Artifact store — upload, get, download raw
client.pastebin.* Text pastes
client.qrcode.* QR code generation
client.shortener.* URL shortening
client.webhook.* Webhook inboxes
client.jwt.* JWT decoding
client.json_tools.* JSON formatting, validation, minification
client.dev.* Developer tools — IP, UUID, password, hash, base64, units, timestamps, diff

Detailed API Reference

Image Tools (client.image.*)

Method Description
resize Resize to exact dimensions or aspect-ratio constrained
convert Convert between JPEG, PNG, WebP, AVIF
compress Reduce file size with quality control
analyze Extract image metadata (dimensions, EXIF, color space)
crop Crop by coordinates
batch_process Process multiple images in one go

PDF Tools (client.pdf.*)

Method Description
merge Combine multiple PDFs
split Split into individual pages
compress Reduce file size
rotate Rotate pages
to_text Extract text content
to_images Convert pages to PNG
from_images Create PDF from images

AI Generation (client.ai.*) — requires api_key

Method Description
generate_image Generate an image from a text prompt
get_generate_image_job Poll an image generation job
generate_video Generate a video from a text prompt
get_generate_video_job Poll a video generation job
list_video_models List available video models
transcribe Transcribe audio to text
remove_bg Remove image background
ocr Extract text from images/documents
extract_structured Extract structured data from documents

Web Tools (client.web.*)

Method Description
screenshot Take a screenshot of a web page
html_to_pdf Convert a web page to PDF
article_extract Extract readable article content

Intel Tools (client.intel.*)

Method Description
dns_lookup DNS record lookup
dns_email_security Check SPF, DKIM, DMARC records
ssl_check Check SSL/TLS certificate
og_preview Get Open Graph metadata
country_lookup Look up country info
timezone_convert Convert between timezones
timezone_list List all timezones
timezone_now Current time in a timezone
regex_test Test a regex pattern
regex_reference Regex syntax reference
text_stats Text statistics
color_convert Convert between color formats
color_names Named CSS colors

Utility Tools (client.tools.*)

Method Description
csv_convert Convert CSV to JSON/XML
case_convert Convert text case
slugify Create URL-friendly slugs
lorem_ipsum Generate placeholder text
url_parse Parse URL components
http_status HTTP status code info
mime_lookup MIME type lookup
html_to_md HTML to Markdown
zip_files Create ZIP archives
unzip Extract ZIP archives
cron_validate Validate cron expressions
video_info Video metadata
video_thumbnail Generate video thumbnail
video_gif Generate animated GIF from video
video_extract_audio Extract audio from video

Agent Substrate (client.agent.*) — requires api_key

Method Description
claim_identity Claim/update agent identity handle
get_identity Get current agent identity
get_identity_by_handle Look up identity by handle
directory Search public agent directory
get_policy Get spend policy
create_approval Create approval request
list_approvals List pending approvals
get_approval Get approval details
list_receipts List signed receipts
create_receipt Create signed receipt
get_receipt Get receipt by ID
verify_receipt Verify receipt signature
create_job Create a new job
list_jobs List jobs
get_job Get job details
claim_job Claim a job
update_job Update a job
complete_job Complete a job
cancel_job Cancel a job
heartbeat Send agent heartbeat
shop_checkout Purchase shop items
shop_purchases List past purchases
shop_check_access Check shop access
provision_human Provision human account
get_provision Check provision status
provision_lookup Look up provisioning info
claim_provision Claim pending provision

Mailbox (client.mailbox.*)

Method Description
create Create a mailbox
post Post a message
poll Long-poll for new messages
peek Peek at messages
claim Claim mailbox for agent key

Artifact Store (client.artifact.*)

Method Description
upload Upload a file artifact
get Get artifact metadata
raw Download raw artifact content

Requirements

  • Python 3.8+
  • requests (automatically installed)

Documentation

Full API docs: https://agentmediatools.com/docs

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentmediatools-0.2.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

agentmediatools-0.2.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file agentmediatools-0.2.0.tar.gz.

File metadata

  • Download URL: agentmediatools-0.2.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for agentmediatools-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8d4b724e01c35eb44a98459c00542905e23dbe66560ad37db0ad0158863ced1a
MD5 2c3a3ef49f295355ca00ad8fd039942c
BLAKE2b-256 7d144f0f64b7d20ce0934b893c9f5cf18c595e4ac1837e0174954645959ca9c2

See more details on using hashes here.

File details

Details for the file agentmediatools-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentmediatools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 461b388fb893bf3afe1c665817af56f009bce42eb1d63ce62566bf179bd33d31
MD5 20fbb9f449ea75511cd08f0a7d0fce81
BLAKE2b-256 fa8b4789c9cf262c148bf9c91eed32bb2ef8c85cdd4dbd67c39865f681a84590

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page