Skip to main content

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 import MediaFactory, Image, 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 2.2.0

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 2.2.0
File Size Uploaded
agoras_media-2.2.0.tar.gz 18.4 kB Details

Built distribution (wheel)

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

Total release size: 35.6 kB

Release files / agoras_media-2.2.0.tar.gz

Download URL agoras_media-2.2.0.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1c74dd9ea91854358213777cc2b6cb9d79bfb3345a18d29bf66b1b0d0be0d22a
BLAKE2b-256 checksum
How to use checksums
a7b80fba57a9e2811775340e44169fe3dd758e7b91ea6510e5237d74633a8f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 26, 2026.

Transparency log

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

Download URL agoras_media-2.2.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cc7381d8a0a0a26fb94717fb0cd5f97a3d1ddb94268d78229e5f5436905bf5e
BLAKE2b-256 checksum
How to use checksums
809ac5d721e713478000599675161165f1f703e352bd61636a34dd274716ec9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release 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