Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

zelf-sdk (Python)

Official client for the Zelf API. Part of hellozelf/zelf-sdk.

Install

pip install zelf-sdk
from zelf import ZelfAPIClient

client = ZelfAPIClient(api_key="sk_zelf_...")

There is an async client with the same surface:

from zelf import ZelfAPIClientAsync

async with ZelfAPIClientAsync() as client:
    page = await client.content.list(brand_id="brd_1")

Client options

Option Default What it does
api_key ZELF_API_KEY Brand API key, sent as x-api-key
base_url ZELF_BASE_URL, else production Point at the sandbox or another deployment
timeout 60s Bounds each individual attempt, not the whole call
max_retries 2 How many times a retryable response is retried
retry_writes off Allow non-idempotent requests to be retried
default_headers none Added to every request
http_client built in Supply your own HTTP client

Pagination

A list call returns one page. The page carries its rows and the envelope that came with them.

On the page Meaning
results the rows, already decoded
item_count rows on this page
page 1-based page number
next / previous neighbouring page numbers, or nothing at the ends
applied_filters the filters the API actually applied
log_id quote this in a support request

Walking the rest takes one of three bounds: everything, at most N pages, or at most N items. The item bound never fetches a page it does not need.

page = client.content.list(page_size=50)

for item in page:                      # this page only
    ...

for item in page.auto_paging():        # every page
    ...

for item in page.auto_paging(max_pages=5):
    ...

for item in page.auto_paging(max_items=100):
    ...

Errors

Every failure is a typed error carrying the status, the API's error code and the log_id.

try:
    client.content.details("con_nope")
except zelf.NotFoundError as error:
    print(error.status_code, error.code, error.log_id)

The type follows the status: bad request, authentication, permission denied, not found, conflict, rate limit, internal server, service unavailable. Network problems raise a connection or timeout error instead.

Retries

A failed GET is retried twice by default, honouring Retry-After and otherwise backing off exponentially with jitter, capped at 8 seconds.

Writes are never retried. The API publishes no Idempotency-Key, so a retried create would start a second billable run. Opt in with retry_writes if your call site can tolerate it.

Webhooks

from zelf import webhooks

event = webhooks.parse(body, headers, secret)
if event.event_type is webhooks.EventType.CONTENT_SNAPSHOT:
    for row in event.items:
        ...

verify returns the decoded payload, parse returns a typed event with items, files and statistics reachable. A handler verifies once and routes by event type. For a manifest delivery, rows downloads the NDJSON files and checks the published SHA-256 before yielding anything.

Sandbox

ZELF_BASE_URL=https://sandbox-api.hellozelf.com
ZELF_API_KEY=sk_zelf_sandbox_demo

Same response shapes and pagination as production, with canned data. It honours page and page_size and ignores other filters.

The sandbox is not a stand-in for production behaviour. It validates nothing, and it never reads a path parameter, so INVALID_ID and the other error cases cannot be reached there. Test error handling and validation against production.

Tests

uv run pytest tests -q

See the repository README for the API surface, and docs/contributing.md for how these are generated.

Metadata

Release files for zelf-sdk 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for zelf-sdk 1.1.1
File Size Uploaded Provenance
zelf_sdk-1.1.1.tar.gz 109.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for zelf-sdk 1.1.1
File Interpreter ABI Platform
zelf_sdk-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 175.7 kB

Release files / zelf_sdk-1.1.1.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL zelf_sdk-1.1.1.tar.gz
Size 109.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cceb945dca3717840d0791918dd50d4ea44394033acbd8dd0df94c3213afcd2c
BLAKE2b-256 checksum
How to use checksums
80a55a410c2dda94809a34e1cb0463469be640b61b70a5f2c6b1a41d846ae3b7
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 Oct 22, 2026.

Transparency log

Release files / zelf_sdk-1.1.1-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL zelf_sdk-1.1.1-py3-none-any.whl
Size 66.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07489c91e3e2a662191e9477fbe2fdce7da64db2ce3ea6aee5b7ff6b8926588a
BLAKE2b-256 checksum
How to use checksums
05d604a74444440ba6d9afda9557e6373a11ce2a0e86f02da6a6f817d71154d5
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 Oct 22, 2026.

Transparency log

Security for zelf-sdk 1.1.1

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.

Change of provenance

The configuration that created this release differs from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Configuration

  • Removed 1.1.0 publish-python.yml
  • Added 1.1.1 publish.yml
Select from 2 files

Attestation for zelf_sdk-1.1.1.tar.gz

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 Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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