Skip to main content

sqi-sdk

Pure-Python client for sqi — a distributed task and render farm manager.

sqi-sdk (import name sqi_client) is a pure-Python library for programmatic job submission, status queries, and management. It covers the same operations as the web UI via the REST API, and is the foundation for the DCC submitters and for pipeline automation scripts (see ../../ROADMAP.md).

It talks to a running sqi-server over its REST API, with an optional WebSocket extra for live event streaming. The only required dependency is httpx; everything else is an opt-in extra, so the library stays light enough to embed in DCC Python environments (Maya, Houdini, Nuke).

Requirements

  • Python 3.9 or newer (VFX Reference Platform CY2022+; covers Maya 2023+, Houdini 19.5+, Nuke 14+).
  • A reachable sqi-server instance.

Installation

pip install sqi-sdk            # core (httpx only)
pip install "sqi-sdk[yaml]"    # + PyYAML (for your own YAML handling; not needed to submit)
pip install "sqi-sdk[ws]"      # + websockets for live event streaming

For offline installs or a specific pre-release build, the wheel is also attached to each GitHub release:

pip install https://github.com/uberware/sqi/releases/download/vX.Y.Z/sqi_sdk-X.Y.Z-py3-none-any.whl
# with an extra:
pip install "sqi-sdk[ws] @ https://github.com/uberware/sqi/releases/download/vX.Y.Z/sqi_sdk-X.Y.Z-py3-none-any.whl"

The package ships a py.typed marker, so type checkers see its annotations.

Quickstart

from pathlib import Path

from sqi_client import SqiClient

with SqiClient("http://localhost:8080") as sqi:
    # Submit an OpenJD template (a Path is read from disk; a str is sent verbatim;
    # a dict is serialized to JSON) and block until the job finishes.
    job = sqi.submit_and_wait(
        Path("render.yaml"), farm_id="<farm-id>", queue_id="<queue-id>", timeout=600
    )
    print("job", job.id, "->", job.status)

    # Print each task's captured log output.
    for task in sqi.iter_job_tasks(job.id):
        page = sqi.get_task_logs(task.id)
        print("".join(chunk.data for chunk in page.items), end="")

What you can do

  • Submit raw OpenJD job templates (submit_job, submit_and_wait).
  • Query jobs, tasks, workers, and logs with typed models and automatic pagination (list_* returns a Page; iter_* walks every page lazily).
  • Manage jobs (pause, resume, set priority, cancel, retry) and tasks (cancel, retry) and workers (enable, disable).
  • CRUD farms, queues, storage locations (the server derives type from the roots), and usage pools.
  • Tail logs by polling (tail_task_logs) or live over WebSocket with the ws extra (tail_task_logs_live).

Errors map to a typed hierarchy rooted at SqiError (e.g. NotFoundError, ValidationError, ConflictError, SqiTimeoutError). The transport retries idempotent GETs with backoff.

Authentication

sqi-server can optionally require authentication (auth.enabled, off by default — see docs/auth.md). SqiClient supports bearer-token authentication for a server that requires it:

from sqi_client import SqiAuthError, SqiClient

# Pass a token explicitly...
sqi = SqiClient("http://localhost:8080", token="<token>")

# ...or let it fall back to $SQI_TOKEN, then $SQI_API_KEY, from the environment.
sqi = SqiClient("http://localhost:8080")  # reads SQI_TOKEN / SQI_API_KEY if set

try:
    sqi.list_products()
except SqiAuthError:
    print("authentication required or credential rejected")

When a token is available (explicit token= or either environment variable), it is sent as Authorization: Bearer <token> on every request; an explicit headers={"Authorization": ...} argument still overrides it. A 401 or 403 response raises SqiAuthError.

Issue a key from the web UI (Admin → API Keys) or POST /api/v1/api-keys; the raw key is shown once at creation. Provide it to the SDK as token= (or via $SQI_TOKEN / $SQI_API_KEY) and it authenticates headlessly against a server with auth.enabled=true. Browser sessions stay cookie-based; API keys are the machine credential. See docs/auth.md for the full model.

Discovering your permissions

client.me() returns the authenticated Principal, including permissions. Check for "jobs.submit_as" before setting a job owner other than your own user — without it the server responds 403.

Products

Products are named, versioned wrappers around OpenJD templates that live in the server's catalog. The SDK exposes eight methods for working with them (iter_products() is the iterator companion to list_products()):

with SqiClient("http://localhost:8080") as sqi:
    # List all products (built-ins + custom), no pagination
    products = sqi.list_products()

    # Fetch one product by name
    product = sqi.get_product("python")

    # Create a custom product from a raw OpenJD template
    custom = sqi.create_product(
        name="my-render",
        title="My Renderer",
        template="specificationVersion: jobtemplate-2023-09\nname: My Renderer\nsteps: []\n",
        format="yaml",
        description="Render a frame range.",
        readme="# My Renderer\n\nLonger usage notes in Markdown go here.\n",
        category="Rendering",
        version="1.0.0",
    )

    # Replace a custom product's fields (full PUT replacement)
    sqi.update_product(
        "my-render",
        template=custom.template,
        format="yaml",
        title="My Renderer v2",
    )

    # Delete a custom product (built-ins return 403 Forbidden)
    sqi.delete_product("my-render")

    # Fetch the parsed job parameters for a product (type, default, UI hints)
    params = sqi.get_product_parameters("python")
    for p in params:
        print(p.name, p.type, p.default)

    # Submit a job from a product; job_name overrides the template's job name
    job = sqi.submit_product_job(
        "python",
        farm_id="<farm-id>",
        queue_id="<queue-id>",
        job_name="My Script Run",
        parameters={"Script": "print('hello')", "Interpreter": "python3"},
        max_attempts=5,  # optional per-job retry overrides; omit to inherit
    )
    print("submitted job", job.id)

A product has two independent text fields: description is a short (max 500 character) plain-text blurb, not Markdown, because it reaches consumers that cannot render markup, such as the Blender add-on's tooltip; it is the field product search matches on. readme is long-form Markdown (max 8000 characters), rendered only on the product's detail page in the web UI; it is never searched. Both caps are enforced server-side (HTTP 400 on create/update) and are not validated client-side.

update_product is a full PUT replacement: any field omitted from the call, including readme, is cleared on the server rather than left unchanged.

get_product_parameters raises NotFoundError when the product does not exist and ValidationError when the stored template cannot be parsed (HTTP 422). submit_product_job uses the keyword argument job_name= (not name=) to avoid shadowing the positional product name argument; the wire field sent to the server is "name". submit_product_job also accepts optional owner, submitter, priority, project, depends_on, estimated_seconds, paused, and the retry overrides max_attempts, retry_delay_seconds and failure_limit. Each is sent only when set; an unset retry override inherits the queue → farm → server default.

Documentation

Full reference — construction and configuration, every public method with examples, error handling, pagination, log tailing, and the conveniences — is in docs/python-client.md. Runnable examples live in examples/.

License

AGPL-3.0-or-later. The full license text is in LICENSE.

Metadata

Release files for sqi-sdk 0.4.0

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

Source distribution (sdist)

Source distribution for sqi-sdk 0.4.0
File Size Uploaded Provenance Actions
sqi_sdk-0.4.0.tar.gz 98.5 kB With provenance Details for sqi_sdk-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqi-sdk 0.4.0
File Interpreter ABI Platform Actions
sqi_sdk-0.4.0-py3-none-any.whl Python 3 none any Details for sqi_sdk-0.4.0-py3-none-any.whl

Total release size: 156.6 kB

Release files / sqi_sdk-0.4.0.tar.gz

Download URL sqi_sdk-0.4.0.tar.gz
Size 98.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6614103cc5664a8accd348a7d281f6c9f98b75512bc7fe34cf0e38ba96238eb7
BLAKE2b-256 checksum
How to use checksums
9c2673117cad074032687e89d3f18cf20a8e00df55081d231a35be3f4daa2a85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / sqi_sdk-0.4.0-py3-none-any.whl

Download URL sqi_sdk-0.4.0-py3-none-any.whl
Size 58.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7447f0336758fd03916688603785ce9f71660cfe446d8d26d8eca633d8ca208
BLAKE2b-256 checksum
How to use checksums
396923879d00c42aa64ffb60829494ea6a645e8ccd84f6c318a3abf7dce2cc33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Security for sqi-sdk 0.4.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sqi_sdk-0.4.0.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 Nov 24, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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