Metadata-Version: 2.5
Name: render-lab-tasks-cloudinary
Version: 0.1.0
Summary: cloudinary tasks for Render Workflows
Project-URL: Repository, https://github.com/render-lab/render-tasks-python
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: render-lab-media-contract<0.2,>=0.1.0
Requires-Dist: render-lab-tasks-core<0.2,>=0.1.1
Requires-Dist: render-lab-triggers<0.2,>=0.1.0
Requires-Dist: render==1.0.1
Description-Content-Type: text/markdown

# render-lab-tasks-cloudinary

Twelve async Cloudinary tasks, exposed with raw injectable implementations in
`render_lab_tasks_cloudinary.tasks`. The root is registration-free.

## Environment

`CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_API_KEY`, and `CLOUDINARY_API_SECRET` are read
lazily on first use. Credentials sign upload requests and authenticate Admin API
calls. They are never forwarded to media source URLs.

## Behavior and evidence

Uploads find an existing deterministic public ID first and recover a competing
upload's result. Replace explicitly overwrites. Rename recovers an already-renamed
asset, and delete treats an absent asset as success. The `assetIds` restore input
retains the TS contract: its values are Cloudinary public IDs.

URL sources are counted while downloading; normal uploads buffer within the source
budget and large uploads send bounded chunks with a shared upload ID. Data URIs use
the 1 MiB media contract cap. Chunked uploads return only the final response.
Signing, multipart fields and Admin API requests are checked against the actual
pinned TypeScript Cloudinary SDK. Live checks still need disposable Cloudinary assets.
See ADR-0015 for the async REST adapter and transfer decisions.

## Webhook adapter

`render_lab_tasks_cloudinary.webhooks.cloudinary_adapter(on_event, ...)` returns a
registration-free adapter for `render_lab_triggers`. The callback receives the
verified event and returns `{"task": "namespace.task", "args": [event]}` or `None`.
The signing credential `CLOUDINARY_API_SECRET` is read inside verification unless
provided explicitly. Importing this module does not register tasks. Signature
checks use the raw body; live delivery remains in the testing backlog.

## Installation

```sh
pip install render-lab-tasks-cloudinary==0.1.0
```
