content-sdk
Install
pip install content-sdk # https://pypi.org/project/content-sdk/
Python 3.11+. Requires only httpx and pydantic. The wheel is also attached
to each GitHub release;
from a clone: pip install ./packages/python-sdk.
The official Python SDK for the Content engine — the one
API client. It fully encapsulates the REST API (/api/v1); the CLI, the MCP
server and applications all speak through it, so the engine's rules are never
duplicated.
Install
pip install content-sdk # or: uv pip install -e packages/python-sdk
Synchronous
from content_sdk import ContentClient, outputs
with ContentClient("http://localhost:8010") as client:
analysis = client.analyze(outputs.url_source("https://www.youtube.com/watch?v=…"))
caps = client.get_capabilities(analysis.id) # analysis_id is addressable
job = client.generate(analysis.id, [outputs.audio_output()])
job.wait() # polls until terminal
for artifact in job.artifacts:
print(artifact.filename, artifact.media_type)
analyze, get_capabilities and generate accept either an
analysis_id / Analysis or inline sources (ADR 0014):
client.get_capabilities([outputs.url_source("https://…")]) # stateless, by sources
Asynchronous
import asyncio
from content_sdk import AsyncContentClient, outputs
async def main():
async with AsyncContentClient("http://localhost:8010") as client:
analysis = await client.analyze(outputs.url_source("https://…"))
job = await analysis.generate([outputs.audio_output()])
await job.wait()
print([a.filename for a in await job.artifacts()])
asyncio.run(main())
Errors
Every non-2xx maps to a typed exception carrying the stable error codes:
from content_sdk import NotFound, Gone, ValidationError
try:
client.get_analysis("ana_stale")
except Gone as exc: # 410 — the analysis or its facts expired
print(exc.codes) # ["analysis_expired"]
except NotFound: # 404
...
except ValidationError as exc: # 422 / 409 idempotency
print(exc.codes)
Design
models.py— pure pydantic contract models (data only, no client).resources.py— behavioural objects (Analysis,Job) bound to a client._transport.py— httpx sync/async layer; conservative retries (transport errors + 5xx on safe GETs only; creations retried only with an idempotency key).
The SDK never imports the engine and never depends on the CLI or MCP.
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 content_sdk-0.3.0.tar.gz.
File metadata
- Download URL: content_sdk-0.3.0.tar.gz
- Upload date:
- Size: 29.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19aeb199be387fde556a47cf0dde325dca45c4ee010f82b48946c686e85c53ba
|
|
| MD5 |
ebceb293182fbe4fd89b920d32dce2b2
|
|
| BLAKE2b-256 |
580d54e56a1af80481accbeb5683db6ffb996329f119064dc056dc7fa367c74f
|
Provenance
The following attestation bundles were made for content_sdk-0.3.0.tar.gz:
Publisher:
publish-pypi.yml on LatentNoise/content
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
content_sdk-0.3.0.tar.gz -
Subject digest:
19aeb199be387fde556a47cf0dde325dca45c4ee010f82b48946c686e85c53ba - Sigstore transparency entry: 2410914702
- Sigstore integration time:
-
Permalink:
LatentNoise/content@3069ae000249ca5c1fb4d92a6c0c1ae01db96a51 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LatentNoise
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@3069ae000249ca5c1fb4d92a6c0c1ae01db96a51 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file content_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: content_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 36.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d2ed9c1e33070fb6bb98a996d0974d64d5e5d7ba339fc60e51f355b3975f2d1
|
|
| MD5 |
126c29a68271a43b9170db748091292c
|
|
| BLAKE2b-256 |
6a47fe763765d4669a037a8c1a4b5b6a301e34c6df736af29b641c17cca23812
|
Provenance
The following attestation bundles were made for content_sdk-0.3.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on LatentNoise/content
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
content_sdk-0.3.0-py3-none-any.whl -
Subject digest:
7d2ed9c1e33070fb6bb98a996d0974d64d5e5d7ba339fc60e51f355b3975f2d1 - Sigstore transparency entry: 2410915359
- Sigstore integration time:
-
Permalink:
LatentNoise/content@3069ae000249ca5c1fb4d92a6c0c1ae01db96a51 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LatentNoise
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@3069ae000249ca5c1fb4d92a6c0c1ae01db96a51 -
Trigger Event:
workflow_dispatch
-
Statement type: