Skip to main content

render-lab-tasks-sanity

Python port of all 10 registered tasks in the pinned TypeScript pack at 45f9c2d44bd28e01ae9813e0d2ff56ee6c533816. Python 3.12+.

Install this distribution and its dependencies:

pip install render-lab-tasks-sanity==0.1.0

Import definitions from render_lab_tasks_sanity.tasks; combine app objects with Workflows.from_workflows(...). JSON fields retain TS spelling; functions use snake_case. Package root imports are inert.

Tasks

Registered name Python export (also exposes _impl)
sanity.createDocument create_document
sanity.deleteAsset delete_asset
sanity.deleteByQuery delete_by_query
sanity.deleteDocument delete_document
sanity.getDocument get_document
sanity.getDocuments get_documents
sanity.mutate mutate
sanity.patchDocument patch_document
sanity.query query
sanity.uploadAsset upload_asset

Dependencies and retries

Raw implementations accept context first and keyword-only deps. The .client module exports typed Port, Deps, and Client classes. Inject a fake port, or pass a caller-owned httpx.AsyncClient to Client. Default dependencies close their client after one operation. Credentials resolve at first use. Transport retries are disabled; retry.py owns durable policies. DTO types are in .types. Requires core >=0.1.1.

Environment

Variable Contract
SANITY_PROJECT_ID Required project.
SANITY_DATASET Required dataset.
SANITY_API_TOKEN Required for all API operations.
SANITY_API_VERSION Optional version; defaults to v2025-02-19.

Verification and limitations

The Python adapter translates the TS @sanity/client seam into direct HTTP with CDN disabled and API version v2025-02-19 by default. Documents preserve arbitrary JSON fields. Multi-get preserves input order/null slots, caps IDs at 1,000, and rejects results at or above 4 MiB; query has the same byte ceiling. Uploads accept at most 2 MiB of decoded base64. Python forwards ifRevisionId as the API's ifRevisionID patch guard. Mutations retain TS retries; increment and arbitrary mutation batches may be applied more than once after ambiguous failures. Live revision-conflict and duplicate-write verification are still required.

Shared fixtures execute the actual pinned TS implementations and compare Python outputs and requests. Sanity's SDK calls are translated into separately asserted REST requests. These are hermetic checks, not real account or hosted verification. See the testing backlog and the root verification tracker. Licensed under MIT.

Webhook adapter

render_lab_tasks_sanity.webhooks.sanity_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 SANITY_WEBHOOK_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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

render_lab_tasks_sanity-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

render_lab_tasks_sanity-0.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file render_lab_tasks_sanity-0.1.0.tar.gz.

File metadata

  • Download URL: render_lab_tasks_sanity-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for render_lab_tasks_sanity-0.1.0.tar.gz
Algorithm Hash digest
SHA256 42d8eacca297522347b22719222d8b07a4271bdaf035a61033d06c427edb15f9
MD5 dab0fc78f1ba789ed751dffede638a01
BLAKE2b-256 7c56ae5a6ee2215b411c16980395008686057f854696e8463843fb00363a5d12

See more details on using hashes here.

Provenance

The following attestation bundles were made for render_lab_tasks_sanity-0.1.0.tar.gz:

Publisher: publish.yml on render-lab/render-tasks-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file render_lab_tasks_sanity-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for render_lab_tasks_sanity-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e912fa492b4b7039f49e3336fdf7a70733b94140eab7168f685efd6fbb768f46
MD5 a4a8a452ab1b5a0292ce20d65e25e5e7
BLAKE2b-256 fd5a5f52bf865de67376bb40bbafdff007da62e47ad8af128ec7555ffd48dd23

See more details on using hashes here.

Provenance

The following attestation bundles were made for render_lab_tasks_sanity-0.1.0-py3-none-any.whl:

Publisher: publish.yml on render-lab/render-tasks-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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