Metadata-Version: 2.5
Name: mediaruntime
Version: 0.1.0
Summary: Official Python SDK for the MediaRuntime API
Project-URL: Homepage, https://mediaruntime.com
Project-URL: Documentation, https://mediaruntime.com/docs
Project-URL: Issues, https://github.com/ericel/mediaruntime-python-sdk/issues
Project-URL: Repository, https://github.com/ericel/mediaruntime-python-sdk
Author: MediaRuntime
License-Expression: MIT
License-File: LICENSE
Keywords: audio,image,mediaruntime,transcoding,video
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: twine>=5; extra == 'dev'
Description-Content-Type: text/markdown

# MediaRuntime Python SDK

Official synchronous Python client for the MediaRuntime asynchronous media API.

Status: `0.1.0` release candidate. Publishing begins after PyPI ownership and GitHub
trusted publishing are configured.

## Install

```bash
pip install mediaruntime
```

Set `MEDIARUNTIME_API_KEY`; the production API URL is built in.

```python
from mediaruntime import MediaRuntime

media = MediaRuntime()
job = media.jobs.create(
    source="./video.mp4",
    outputs=[{"type": "mp4", "preset": "mp4_720p_h264_aac"}],
    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)
```

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

```python
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](docs/PYTHON_SDK_SDD.md) for boundaries, retry safety,
security behavior, compatibility, and release gates.
