Skip to main content

LiveKit Python Client SDK for LiveKit

Project description

The LiveKit icon, the name of the repository and some sample code in the background.

pypi-v

📹🎙️🐍 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

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 SDKsComponents · JavaScript · iOS/macOS · Android · Flutter · React Native · Rust · Python · Unity (web) · Unity (beta)
Server SDKsNode.js · Golang · Ruby · Java/Kotlin · PHP (community) · Python (community)
ServicesLivekit server · Egress · Ingress
ResourcesDocs · Example apps · Cloud · Self-hosting · CLI

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livekit-0.2.5.tar.gz (26.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

livekit-0.2.5-py3-none-win_amd64.whl (6.4 MB view details)

Uploaded Python 3Windows x86-64

livekit-0.2.5-py3-none-manylinux_2_28_x86_64.whl (7.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

livekit-0.2.5-py3-none-manylinux_2_28_aarch64.whl (6.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

livekit-0.2.5-py3-none-macosx_11_0_arm64.whl (7.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

livekit-0.2.5-py3-none-macosx_10_9_x86_64.whl (8.7 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file livekit-0.2.5.tar.gz.

File metadata

  • Download URL: livekit-0.2.5.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for livekit-0.2.5.tar.gz
Algorithm Hash digest
SHA256 0d34faa568d5cd41579d565aff6f2835a78ac36ed7488b7ef0f252dfd90e1d1a
MD5 e22fb10f588c7efad116be2a9463447a
BLAKE2b-256 90bddf8b8d1e07ac1f4c810f9e9693b6e5313bf05f59a76a97ee27092af14ef6

See more details on using hashes here.

File details

Details for the file livekit-0.2.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: livekit-0.2.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for livekit-0.2.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 717f4128982b93173fe4505c683adc1bde9b2bcda29f0933c7e7d63c27346b8d
MD5 5a8cd0203c7f0cc5646d61cfb84ab55c
BLAKE2b-256 d30c6ec6968499470f50899c590fbdd1326d6a910a4222def07e6c8b75bc43f0

See more details on using hashes here.

File details

Details for the file livekit-0.2.5-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for livekit-0.2.5-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 280870251af4a21d77fff72fa16941be13cf6624681867b4bba9a96aea62a4f2
MD5 164d24d904f877bc9f0a5efe1c0e6993
BLAKE2b-256 3dceb05ac43de74cdf55c04bdcb8a5c6a52c41bfaba0599cb255d68d03fcf04b

See more details on using hashes here.

File details

Details for the file livekit-0.2.5-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for livekit-0.2.5-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 37fda1b2b1566e634435e79061dc059dd5754059810f214557fc4c2886cdf3f2
MD5 981db6135049d52afc56bb6cc5c3132a
BLAKE2b-256 febad3540c0b97f665013b5ece15868a20387f21eda5aedb18946a93904c2f45

See more details on using hashes here.

File details

Details for the file livekit-0.2.5-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for livekit-0.2.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c269ab98ec3f02ab2a7b226b30c0547e9fe172bb5a6c00eebe167abb3930ec23
MD5 a177c6a8a09f4853256fc571ccca652e
BLAKE2b-256 e8b90a3c249547abdf3ddbf739dd33bebb6c1ed309ad413592329ebf974a578f

See more details on using hashes here.

File details

Details for the file livekit-0.2.5-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for livekit-0.2.5-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 81d6e1ddbe97fd32c4aa860c21735cc42689212402cfa1fbbe6f09a34827c35f
MD5 3ca2ca6e5dd950c56da9eec0f610e454
BLAKE2b-256 5fff029cf3569a9b4939a8f353c88d7a046c00646d85bdddd1b6147aac02be13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page