MediaRuntime Python SDK
Official synchronous Python client for the MediaRuntime asynchronous media API.
Status: stable 0.2.0, published on PyPI with GitHub trusted publishing.
Install
pip install mediaruntime
Set MEDIARUNTIME_API_KEY; the production API URL is built in. Pass the server-held key
explicitly when you want the credential source to be visible in application code.
import os
from mediaruntime import MediaRuntime
media = MediaRuntime(api_key=os.environ["MEDIARUNTIME_API_KEY"])
job = media.jobs.create(
source="./video.mp4",
outputs=["video.web"],
moderation={"enabled": True, "mode": "report"},
idempotency_key="video:vid_123:v1",
)
# Useful for scripts/tests. Prefer signed webhooks in production.
result = job.wait(timeout=300)
moderation = media.jobs.get_moderation(result.id)
print(result.bundle.get("download_url"), moderation.flagged_checks)
MediaRuntime() without arguments is equivalent: it reads MEDIARUNTIME_API_KEY
automatically. Never put the key in frontend code or commit its literal value.
Aliases are frozen gateway contracts: video.web, video.streaming, video.social,
audio.web, audio.transcription, and image.web. The gateway materializes them before
validation, estimation, billing, and persistence. Explicit { "type": ..., "preset": ... }
output dictionaries remain supported and may be mixed with aliases.
HTTP(S) and gs:// sources are submitted directly. Other strings and pathlib.Path
instances are treated as local files and uploaded through MediaRuntime's signed upload
flow.
Verify webhooks
event = media.webhooks.verify(raw_body, request.headers)
print(event.id, event.job_id, event.status)
media.webhooks.flask(handler), fastapi(handler), and django(handler) provide optional
framework adapters without making those frameworks package dependencies. Persist and
deduplicate event.id in your own datastore before acknowledging a delivery.
See the software design document for boundaries, retry safety, security behavior, compatibility, and release gates.
Metadata
Release files for mediaruntime 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mediaruntime-0.2.0.tar.gz | 17.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mediaruntime-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.7 kB
Release files / mediaruntime-0.2.0.tar.gz
| Download URL | mediaruntime-0.2.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cb3b0fc1230ba91790c39c61b663922d9ffee61aad71e71e2a478adce272ad4
|
|
BLAKE2b-256 checksum How to use checksums |
3c59ea3a004eef9f4f3ec89101fd132a239e5481f3c4d4ed673c636d5c9bba98
|
| 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 16, 2026.
Transparency logRelease files / mediaruntime-0.2.0-py3-none-any.whl
| Download URL | mediaruntime-0.2.0-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d0ace02678d729e23744b9b878e3353e3a380ff1f946bbeae088bad012c2f5e
|
|
BLAKE2b-256 checksum How to use checksums |
7e392cf0afa2efd22f93e2177f61b5186c8fa28d6e65d1a85b02d4501463a77a
|
| 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 16, 2026.
Transparency log