Skip to main content

agoras-media

Image and video processing for social media platforms.

Installation

pip install agoras-media

Contents

  • MediaFactory: Factory for creating Image and Video instances

  • Image: Image download, validation, and processing

  • Video: Video download, validation, and platform-specific limits

Usage

import asyncio
from agoras.media.image import Image
from agoras.media.video import Video

# Create and download images
async def download_image():
    image = Image('https://example.com/image.jpg')
    await image.download()
    # Use image.content, image.temp_file
    image.cleanup()

# Create platform-specific video
async def download_video():
    video = MediaFactory.create_video('https://example.com/video.mp4', 'facebook')
    await video.download()
    # Use video.content, video.temp_file
    video.cleanup()

# Download multiple images
async def batch_download():
    images = await MediaFactory.download_images([
        'https://example.com/image1.jpg',
        'https://example.com/image2.jpg'
    ])
    for img in images:
        print(f'Downloaded: {img.url}')
        img.cleanup()

asyncio.run(download_image())

Media constraints

Per-platform MIME, size, duration, and transfer limits live in agoras.media.constraints. Wrappers and MediaFactory import the same table; do not hardcode limits elsewhere.

To inspect limits:

agoras utils media-limits
agoras utils media-limits --platform discord --kind video

To add a platform row, edit constraints.py and run:

pytest packages/media/tests/test_constraints_contract.py

Dependencies

  • agoras-common

  • Pillow (image processing)

  • opencv-python-headless (video duration and validation)

  • filetype (file type detection)

Metadata

Release files for agoras-media 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agoras-media 3.0.1
File Size Uploaded Provenance Actions
agoras_media-3.0.1.tar.gz 19.2 kB With provenance Details for agoras_media-3.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agoras-media 3.0.1
File Interpreter ABI Platform Actions
agoras_media-3.0.1-py3-none-any.whl Python 3 none any Details for agoras_media-3.0.1-py3-none-any.whl

Total release size: 36.5 kB

Release files / agoras_media-3.0.1.tar.gz

Download URL agoras_media-3.0.1.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
21dbba52b5e92fb767341a8da2b23c5f10bf96374903444afc1debb5d1c8844e
BLAKE2b-256 checksum
How to use checksums
026424ad2c893977bf57d142b68b896cb58af747ea6e4d8b01d91b7780e7e225
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / agoras_media-3.0.1-py3-none-any.whl

Download URL agoras_media-3.0.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7e7640f12a2d0ffad3009e4ce5ef59e3f9ef74db39a8ac8a2a4cdc3f0032c50
BLAKE2b-256 checksum
How to use checksums
6695ca5c0af076d2749619307c3b7abd898db75f48c7ab881bba7c3bf9c2e547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for agoras-media 3.0.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agoras_media-3.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

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.

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