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.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 3.0.0
File Size Uploaded Provenance Actions
agoras_media-3.0.0.tar.gz 19.2 kB With provenance Details for agoras_media-3.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 36.5 kB

Release files / agoras_media-3.0.0.tar.gz

Download URL agoras_media-3.0.0.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0800c76f18c78d5fa4b02621519b1e3510ee4f77cd54a4b8de739f1d318048b4
BLAKE2b-256 checksum
How to use checksums
1de80a40b0a952b62de372799e1db3a1f35cc72f2d69f7e166e2cc9ad3bf59da
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.0-py3-none-any.whl

Download URL agoras_media-3.0.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c05d0ebb863fc93a1d68daf1a131dbce48fde7415278394b625b16e812187e3
BLAKE2b-256 checksum
How to use checksums
28612548f9234bdbbdd24805c9430b81171ca9080dbeb25a7b9f52ab581f9b19
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.0

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.0.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