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, Stream

with FrameWorksClient(token="YOUR_API_TOKEN") as fw:
    created = fw.create_stream(input=CreateStreamInput(name="Studio A"))
    # Returns the Stream member or raises ResultError for ValidationError/AuthError.
    stream = expect_result(created.create_stream, Stream)
    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 of your own: the server version check looks up an SDK operation's release by name.

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.3.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 livepeer-frameworks 0.3.0
File Size Uploaded
livepeer_frameworks-0.3.0.tar.gz 320.1 kB Details

Built distribution (wheel)

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

Total release size: 800.4 kB

Release files / livepeer_frameworks-0.3.0.tar.gz

Download URL livepeer_frameworks-0.3.0.tar.gz
Size 320.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5954e06784530aac0eda231691cd210456ddc6f37ffddc696014deebb1633ad3
BLAKE2b-256 checksum
How to use checksums
665c37c444b44f14dea029d2f61f0676e1d72926284b251591034e774ad73001
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

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

Download URL livepeer_frameworks-0.3.0-py3-none-any.whl
Size 480.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2f7838c2ffeee9a769b5bb4af5a94ddb14ccdb7e22171786e3afc04bb696f36
BLAKE2b-256 checksum
How to use checksums
e3b7f2ef91edc3d227e33b4d3c8924af151774e180d3bc4e9bcfafcb8d85d156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.1.0

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