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.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agoras_media-2.1.2.tar.gz | 16.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agoras_media-2.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.5 kB
Release files / agoras_media-2.1.2.tar.gz
| Download URL | agoras_media-2.1.2.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd9aaccaff67fdee0e3a6a9423b79e67f93e2913ca8154e9006037fe807f1f42
|
|
BLAKE2b-256 checksum How to use checksums |
09e292f703cca63ce14d5ecc87a074a35ff62fe6e5668acfddf58ec6e0ed054a
|
| 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 25, 2026.
Transparency logRelease files / agoras_media-2.1.2-py3-none-any.whl
| Download URL | agoras_media-2.1.2-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b2f544a31630f0d16352bd443a2a5477a5910fcbbad51ec00402c446163703c
|
|
BLAKE2b-256 checksum How to use checksums |
d02ab2e1302eba60ef99ec6f3bda85eb685bbc60b90b5e4e92f2fec99716b62d
|
| 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 25, 2026.
Transparency log