📹🎙️🐍 Python Client SDK for LiveKit
The Livekit Python Client provides a convenient interface for integrating Livekit's real-time video and audio capabilities into your Python applications. With this library, developers can easily leverage Livekit's WebRTC functionalities, allowing them to focus on building their AI models or other application logic without worrying about the complexities of WebRTC.
Official LiveKit documentation: https://docs.livekit.io/
Installation
$ pip install livekit
Connecting to a room
async def main():
room = livekit.Room()
await room.connect(URL, TOKEN)
logging.info("connected to room %s", room.name)
@room.on("participant_connected")
def on_participant_connected(participant: livekit.RemoteParticipant):
logging.info(
"participant connected: %s %s", participant.sid, participant.identity)
video_stream = None
@room.on("track_subscribed")
def on_track_subscribed(track: livekit.Track, publication: livekit.RemoteTrackPublication, participant: livekit.RemoteParticipant):
logging.info("track subscribed: %s", publication.sid)
if track.kind == livekit.TrackKind.KIND_VIDEO:
nonlocal video_stream
video_stream = livekit.VideoStream(track)
@video_stream.on("frame_received")
def on_video_frame(frame: livekit.VideoFrame):
# received a video frame from the track
pass
await room.run()
Examples
- Facelandmark: Use mediapipe to detect face landmarks (eyes, nose ...)
- Whisper: Transcribe an audio track using OpenAI whisper
- Basic room: Connect to a room
- Publish hue: Publish a rainbow video track
- Publish wave: Publish a sine wave
Getting help / Contributing
Please join us on Slack to get help from our devs / community members. We welcome your contributions(PRs) and details can be discussed there.
| LiveKit Ecosystem | |
|---|---|
| Client SDKs | Components · JavaScript · iOS/macOS · Android · Flutter · React Native · Rust · Python · Unity (web) · Unity (beta) |
| Server SDKs | Node.js · Golang · Ruby · Java/Kotlin · PHP (community) · Python (community) |
| Services | Livekit server · Egress · Ingress |
| Resources | Docs · Example apps · Cloud · Self-hosting · CLI |
Metadata
Release files for livekit 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| livekit-0.2.2.tar.gz | 26.7 kB | Without provenance | Details for livekit-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| livekit-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for livekit-0.2.2-py3-none-any.whl |
Total release size: 64.1 kB
Release files / livekit-0.2.2.tar.gz
| Download URL | livekit-0.2.2.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e455d9f51616d459e03edaf36d3c135d96a01358ec09934ff2dbe347ff4ae6f
|
|
BLAKE2b-256 checksum How to use checksums |
7b0047969ade1d23a5ecee25c44c9d6decbd53d19d8857bd5ab3fda84fe0902d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / livekit-0.2.2-py3-none-any.whl
| Download URL | livekit-0.2.2-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98608459135bc7b059dbb6b9cccd1f2e6b9fdddb9d7d41d20220b161c2ae00f6
|
|
BLAKE2b-256 checksum How to use checksums |
bac7fce7cb3fbed6c41d426b3a53ce10ea967d1269384e057430b3a9a96d5757
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Security for livekit 0.2.2
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.