Skip to main content

livepeer-frameworks

Typed Python client for the FrameWorks GraphQL API. It ships a sync and an async client generated from the public GraphQL schema, with a method for every public root field and argument-taking field, pydantic models, retries, pagination, typed errors, a VOD upload helper, playback token signing, and webhook verification.

pip install livepeer-frameworks
from livepeer_frameworks import FrameWorksClient, expect_result, paginate_relay
from livepeer_frameworks.graphql import ConnectionInput, CreateStreamInput, StreamWithKey

with FrameWorksClient(token="YOUR_API_TOKEN") as fw:
    created = fw.create_stream(input=CreateStreamInput(name="Studio A"))
    # Returns the stream with its key, or raises ResultError for ValidationError/AuthError.
    stream = expect_result(created.create_stream, StreamWithKey)
    print(stream.stream_key, stream.playback_id)

    for s in paginate_relay(
        lambda page: fw.list_streams(page=ConnectionInput.model_validate(page)).streams_connection
    ):
        print(s.name)

The client defaults to https://bridge.frameworks.network/graphql and reads no environment variables. Pass url= only for a self-hosted or staging Bridge, and pass the token explicitly. Per-call options are keyword arguments of the generated methods: idempotency_key= (sent as Idempotency-Key; paid mutations settled with x402 need one) and playback_token= (sent as X-Frameworks-Playback-JWT).

Queries are retried on network errors and HTTP 408, 429, and 5xx. A mutation is retried only when the request provably never reached the server: the connection could not be established, or the gateway answered 429. It is never sent again after a timeout, a dropped connection, or a 5xx, because the gateway does not deduplicate replayed mutations.

Subscriptions

Every public subscription is an async iterator method on AsyncFrameWorksClient (tenant_events, live_stream_events, skipper_chat, ...) that yields the operation's pydantic model:

async with AsyncFrameWorksClient(token="YOUR_API_TOKEN") as fw:
    async for event in fw.tenant_events(types=["stream.live", "stream.idle"]):
        print(event.tenant_events.type_, event.tenant_events.subject)

The sync FrameWorksClient has no subscription methods: ariadne-codegen, which generates the clients, emits subscriptions only for an async client.

Custom documents

Every public root field and argument-taking field has a generated method with a default selection. The Python SDK has no typed builder for other selections: ariadne-codegen 0.19's custom operation builder generates only queries and mutations (no subscriptions), and returns dict[str, Any] with custom scalars undecoded (Time arrives as a str, where the generated methods return datetime). For other selections, send your own document through the client's execute (queries and mutations; get_data returns the data) or the async client's execute_ws (subscriptions), which use the SDK's authentication, retries, and typed errors. Give it an operation name freely: operation-specific server checks use the selected document's identity, while custom documents retain the baseline server check.

Scopes and partial errors

An API token carries scopes. The stream methods (list_streams, get_stream, create_stream, update_stream, refresh_stream_key) select only stream fields, so streams:read and streams:write cover them. Live state (Stream.metrics) comes from analytics and needs analytics:read: read it with get_stream_metrics or list_stream_metrics. A stream key lets its holder publish, so it needs streams:write: create_stream and refresh_stream_key return a StreamWithKey, get_stream_key reads it, and list_streams, get_stream, and update_stream return a Stream without it.

When a field below a returned root field fails (for example metrics selected with a token that lacks analytics:read), the server sets it to null and reports an error at its path. The call returns the data and hands those errors, as a PartialErrors, to on_partial_errors=, set on the client or per call:

warnings: list[PartialErrors] = []
fw.list_streams(on_partial_errors=warnings.append)

Errors without a path, errors that null a root field, and UNAUTHORIZED, RATE_LIMITED, and document errors raise a typed error.

Versions

The TypeScript, Go, and Python SDKs share one version. Until FrameWorks 1.0 the SDKs stay at 0.x, and each minor line supports the FrameWorks releases listed for it; this line needs FrameWorks v0.3.11 or later. Against an older stable release the client raises ServerTooOldError before sending a call.

Documentation: https://logbook.frameworks.network/builders/sdks

Metadata

Release files for livepeer-frameworks 0.5.1

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

Source distribution (sdist)

Source distribution for livepeer-frameworks 0.5.1
File Size Uploaded Provenance Actions
livepeer_frameworks-0.5.1.tar.gz 346.0 kB Without provenance Details for livepeer_frameworks-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for livepeer-frameworks 0.5.1
File Interpreter ABI Platform Actions
livepeer_frameworks-0.5.1-py3-none-any.whl Python 3 none any Details for livepeer_frameworks-0.5.1-py3-none-any.whl

Total release size: 853.1 kB

Release files / livepeer_frameworks-0.5.1.tar.gz

Download URL livepeer_frameworks-0.5.1.tar.gz
Size 346.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7d305d1ec3ccd1b6160453a574d2b6b8c51fd16f02d3f54e7892ceccfe541b8a
BLAKE2b-256 checksum
How to use checksums
02e8d8542d867f2ba5e8ddfeed4d1fecaa121b3744514ee61e3c54b0f276eb58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / livepeer_frameworks-0.5.1-py3-none-any.whl

Download URL livepeer_frameworks-0.5.1-py3-none-any.whl
Size 507.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f21b699121d7f7b7770c6e0facb389fdd78acef5355d5685d042d967f0ec3dd
BLAKE2b-256 checksum
How to use checksums
dfe92ef179bf93707e499e6a24c7c71dcff2d6d1a5f3eb7d46e3556f53a993a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for livepeer-frameworks 0.5.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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