Skip to main content

lovekit

PyPI version PyPI pyversions Maintainer

The python client for lovekit, the Arkitekt service for live audio and video. Lovekit manages broadcasts and their streams and hands out the tokens to publish into them; the media itself flows over WebRTC through a LiveKit media server, which you talk to with the regular livekit SDK.

Installation

pip install lovekit   # or: pip install "arkitekt[rekuest,lovekit]"

Usage

Every lovekit operation is a method of the Lovekit client, in a blocking and an a-prefixed async flavour: ensure_solo_broadcast, ensure_stream, get_stream, list_streams, get_solo_broadcast, list_solo_broadcasts, …. ensure_stream returns the token a livekit.rtc.Room connects to the media server with.

In an arkitekt app

The client is injected by annotation. Add the service to your app and ask for lovekit: Lovekit:

from arkitekt import App, run
from lovekit import lovekit_service
from lovekit.api.schema import StreamKind
from lovekit.lovekit import Lovekit

app = App("camera", "0.1.0", services=[lovekit_service])


@app.action
async def go_live(title: str, lovekit: Lovekit) -> str:
    """Go Live

    Opens a video stream and returns the token to publish into it.
    """
    broadcast = await lovekit.aensure_solo_broadcast(title=title)
    return await lovekit.aensure_stream(kind=StreamKind.VIDEO, broadcast=broadcast.id, title=title)


if __name__ == "__main__":
    run(app)

Streams and solo broadcasts travel between actions by id (@lovekit/stream, @lovekit/solo_broadcast), so an action can take and return them directly.

From a script

from arkitekt import easy
from lovekit import lovekit_service

with easy("my-script", lovekit_service) as lovekit:
    for stream in lovekit.list_streams():
        print(stream.id)

With a token, publish or subscribe through the regular livekit SDK (await rtc.Room().connect(<livekit url>, token)).

Development

The generated API (lovekit/api/schema.py) comes from the documents in graphql/; see graphql.config.yaml.

uv run pytest -m "not integration"   # no server needed
uv run pytest -m integration          # a real lovekit + livekit via dokker

See RELEASING.md for how versions are cut.

Metadata

Release files for lovekit 3.1.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 lovekit 3.1.1
File Size Uploaded
lovekit-3.1.1.tar.gz 14.2 kB Details

Built distribution (wheel)

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

Total release size: 28.9 kB

Release files / lovekit-3.1.1.tar.gz

Download URL lovekit-3.1.1.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4911ccd1eda927ef53d19f73f47eb1773c51bdb0d9678444645950c078d3ceac
BLAKE2b-256 checksum
How to use checksums
f41dc9bed4d3d8cc283ab8714ce98e71ed7366a5c1175a36398a0bfd40abfee3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lovekit-3.1.1-py3-none-any.whl

Download URL lovekit-3.1.1-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc03ddba469b3ee79c72387112f00cf3749c9261a73e67c4f6ffd9c1bf691429
BLAKE2b-256 checksum
How to use checksums
1774a18ec94a67420f06bde0b61377f678c0e560b90aec93f2dd368df27776ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

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