lovekit
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lovekit-3.1.0.tar.gz | 14.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lovekit-3.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.9 kB
Release files / lovekit-3.1.0.tar.gz
| Download URL | lovekit-3.1.0.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
daa08c288246c130e7312a9acab7236c231d75be8a3847b72daf80b4cfb49c49
|
|
BLAKE2b-256 checksum How to use checksums |
5c96abaede69f0fd547eff88f187e9013c09aaa25854b2cc467ee345088b1111
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","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.0-py3-none-any.whl
| Download URL | lovekit-3.1.0-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8de1ea4cc3dad18c8361742039debcd97568845b3ca432b7cccac1e883aae46
|
|
BLAKE2b-256 checksum How to use checksums |
6e093c70e922cf596ca4646ca6cd9303f9a7ef23d028b9109ff2538f043d5505
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","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}
|