SOPHON Encoding API
Project description
sophon-sdk
Official Python SDK for the SOPHON Encoding API.
This repository is generated from Liqhtworks/sophon-api. The curated
README.md and examples/ directory are preserved across SDK regeneration.
Install
pip install sophon-sdk
Requires Python 3.9+.
Quick Start
import os
from pathlib import Path
import sophon_sdk
configuration = sophon_sdk.Configuration(
host=os.getenv("SOPHON_BASE_URL", "https://api.liqhtworks.xyz"),
access_token=os.environ["SOPHON_API_KEY"],
)
with sophon_sdk.ApiClient(configuration) as api_client:
uploads = sophon_sdk.UploadsApi(api_client)
result = sophon_sdk.upload_file(
uploads,
Path("source.mov"),
file_name="source.mov",
mime_type="video/quicktime",
concurrency=4,
)
print(result.upload_id)
Upload Input Forms
upload_file accepts all common server-side input forms:
from io import BytesIO
from pathlib import Path
# 1. Path-like input.
sophon_sdk.upload_file(
uploads,
Path("source.mov"),
file_name="source.mov",
mime_type="video/quicktime",
)
# 2. Bytes input.
data = Path("source.mov").read_bytes()
sophon_sdk.upload_file(
uploads,
data,
file_name="source.mov",
mime_type="video/quicktime",
)
# 3. Binary file-like input. The object must support seek().
with open("source.mov", "rb") as fh:
sophon_sdk.upload_file(
uploads,
fh,
file_name="source.mov",
mime_type="video/quicktime",
)
# BytesIO works too.
buf = BytesIO(data)
sophon_sdk.upload_file(
uploads,
buf,
file_name="source.mov",
mime_type="video/quicktime",
)
Webhooks
Use verify_webhook_signature with the raw request body before JSON parsing.
See examples/webhook-server for a FastAPI route
that reads the raw body, verifies X-Turbo-Signature-256, and only then parses
JSON.
Helpers
| Helper | Purpose |
|---|---|
upload_file |
Chunked upload orchestration with bounded concurrency, retries, resume, and progress callbacks. |
wait_for_job |
Poll until terminal status with timeout and typed errors. |
verify_webhook_signature |
Constant-time HMAC verification plus replay-window enforcement. |
API Docs
Generated endpoint/model docs live under docs/.
License
Proprietary. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sophon_sdk-0.1.4.tar.gz.
File metadata
- Download URL: sophon_sdk-0.1.4.tar.gz
- Upload date:
- Size: 74.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
425abd19d6a3f67f450478fbc8ae69c35ccabe91772842de0a4ca39d90ddd62c
|
|
| MD5 |
abd9893d6d8fa3f6200bdd37da792fc1
|
|
| BLAKE2b-256 |
dfc0cdb72d4fd631c5b4e40fac410c98a669aa12e3a0a9e47708291de06dac1e
|
Provenance
The following attestation bundles were made for sophon_sdk-0.1.4.tar.gz:
Publisher:
publish.yml on Liqhtworks/sophon-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sophon_sdk-0.1.4.tar.gz -
Subject digest:
425abd19d6a3f67f450478fbc8ae69c35ccabe91772842de0a4ca39d90ddd62c - Sigstore transparency entry: 1468486928
- Sigstore integration time:
-
Permalink:
Liqhtworks/sophon-sdk-python@64a8f260a6e081566bdae7080bee2d27b7c00618 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/Liqhtworks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64a8f260a6e081566bdae7080bee2d27b7c00618 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sophon_sdk-0.1.4-py3-none-any.whl.
File metadata
- Download URL: sophon_sdk-0.1.4-py3-none-any.whl
- Upload date:
- Size: 182.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
518ec18fd12915587829569a64a594ad787e798ad69f611a3b97adfe0ea1ac16
|
|
| MD5 |
c091ac4023f3dc0a9ba22ef4cd2d5ca6
|
|
| BLAKE2b-256 |
b2d10002eddef606a6dcc6c358a274fea36b0ad776d5a739fb7bf13d38a365bb
|
Provenance
The following attestation bundles were made for sophon_sdk-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on Liqhtworks/sophon-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sophon_sdk-0.1.4-py3-none-any.whl -
Subject digest:
518ec18fd12915587829569a64a594ad787e798ad69f611a3b97adfe0ea1ac16 - Sigstore transparency entry: 1468487023
- Sigstore integration time:
-
Permalink:
Liqhtworks/sophon-sdk-python@64a8f260a6e081566bdae7080bee2d27b7c00618 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/Liqhtworks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64a8f260a6e081566bdae7080bee2d27b7c00618 -
Trigger Event:
push
-
Statement type: