Skip to main content

SteadyLink Python SDK

CI PyPI Python License: MIT

The official Python client for the SteadyLink API.

Requirements

  • Python 3.10 or newer
  • A SteadyLink workspace and API key

The package has no runtime dependencies. Management API keys must only be used in trusted server environments.

Installation

python -m pip install steadylink

Quick start

import os
from steadylink import SteadyLink

client = SteadyLink(
    api_key=os.environ["STEADYLINK_API_KEY"],
    workspace_id=os.environ.get("STEADYLINK_WORKSPACE_ID"),
)

buckets = client.list_buckets()["items"]

Create a scoped API key in Dashboard > Developers. You can use access_token instead of api_key for a signed-in user session. Pass exactly one authentication method.

Upload a file

from pathlib import Path

path = Path("campaign-hero.webp")
data = path.read_bytes()

asset = client.upload_file(
    "bucket_id",
    filename=path.name,
    body=data,
    content_type="image/webp",
    path="campaign/",
)

upload_file creates an upload session, sends the bytes to the presigned storage URL, and finalizes the upload. SteadyLink credentials are never attached to the storage request.

Replace a file

client.replace_file(
    "bucket_id",
    "campaign/campaign-hero.webp",
    filename=path.name,
    body=data,
    content_type="image/webp",
)

The replacement creates a new revision. Existing delivery URLs continue to work.

Configuration

client = SteadyLink(
    api_key=os.environ["STEADYLINK_API_KEY"],
    workspace_id="workspace_id",
    base_url="https://api.steadylink.io",
    max_retries=2,
)
Option Description
api_key Server-side management API key.
access_token User access token. Use this or api_key, not both.
workspace_id Workspace used for workspace-scoped operations.
base_url API origin. Useful for private or preview environments.
max_retries Maximum transient retries. Defaults to 2.
transport Custom JSON transport for testing or alternate runtimes.
binary_transport Custom presigned-upload transport.

Errors and retries

from steadylink import SteadyLinkError, SteadyLinkNetworkError

try:
    client.list_buckets()
except SteadyLinkError as error:
    print(error.status, error.code, error.request_id, error.detail)
except SteadyLinkNetworkError as error:
    print(str(error))

The client retries 429, 502, 503, and 504 responses for safe HTTP methods. A mutating request is only retried when it carries an idempotency key.

Type checking

The package includes a py.typed marker and inline type annotations for type checkers that implement PEP 561.

Security

  • Keep management API keys out of browser bundles, mobile apps, logs, and source control.
  • Give each integration the smallest set of scopes it needs.
  • Use upload_to_url for presigned storage uploads. It does not attach SteadyLink authentication headers.
  • Report vulnerabilities through GitHub private vulnerability reporting.

Documentation

Development

python -m pip install build pytest twine
pytest
python -m build
python -m twine check dist/*

See the contributing guide for the development and release process.

License

MIT

Metadata

Release files for steadylink 0.1.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 steadylink 0.1.0
File Size Uploaded
steadylink-0.1.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for steadylink 0.1.0
File Interpreter ABI Platform
steadylink-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.7 kB

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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