Skip to main content

dTelecom RTC for Python

Join a dTelecom room from a Python process, receive remote audio as PCM16, and publish audio or room data. Supply a participant grant from your backend. Its response includes the signaling URL, token and ranked fallback URLs. Room connections

from dtelecom_rtc import AudioSource, Room

async def echo(grant, finished):
    source = AudioSource(sample_rate=16000)
    async with Room() as room:
        @room.on("track_subscribed")
        async def receive(track, publication, participant):
            async for frame in track.stream(sample_rate=16000):
                await source.capture_frame(frame)

        await room.connect(grant.ws_url, grant.token, fallback_urls=grant.fallback_urls)
        await room.publish_audio("echo", source)
        await finished.wait()
    source.close()

Use a distinct identity for each participant. Set auto_subscribe=False to choose remote tracks explicitly with set_subscribed. Register event handlers before joining to include publications already present in the room. A data_received handler receives payload bytes, the sender when known, the delivery kind and topic. publish_data accepts a string or bytes, optional topic and destination participant SIDs, and reliable or lossy delivery.

The SDK tries the issuer's ranked endpoints with the same grant after a transport failure. When extending a grant through Cloud, call room.update_connection_token(token, fallback_urls) so the room uses the refreshed credentials after a reconnect. Use disconnect() or exit the async context to leave.

Configure SDK log levels using Python's standard logging.getLogger("dtelecom_rtc").setLevel(...). Use AudioFrame.duration, samples_per_channel, and the resample, downsample and upsample helpers for standalone PCM. create_text_message, encode_data_packet and decode_data_packet expose the fork's room-data format. The protocol message models and enums are exported from dtelecom_rtc.models.

For a live interoperability check, install Playwright and use the ESM bundle of @dtelecom/livekit-client@1.13.0. Set DTELECOM_API_KEY, DTELECOM_API_SECRET, DTELECOM_CLOUD_URL and DTELECOM_BROWSER_MODULE, then run python tests/integration/browser_call.py. The script creates a disposable room and uses synthetic audio. Add --recovery to test a grant with three ranked nodes and reconnect the Python publisher. CHROME_EXECUTABLE selects a local browser when needed.

On transport loss, room.state becomes "reconnecting" and the room emits reconnecting before releasing remote tracks and participants. A service can keep per-speaker state through that teardown, then reconcile the identities present at reconnected. A terminal disconnected ends the session.

Metadata

Release files for dtelecom-rtc 0.1.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 dtelecom-rtc 0.1.0
File Size Uploaded Provenance Actions
dtelecom_rtc-0.1.0.tar.gz 23.6 kB With provenance Details for dtelecom_rtc-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dtelecom-rtc 0.1.0
File Interpreter ABI Platform Actions
dtelecom_rtc-0.1.0-py3-none-any.whl Python 3 none any Details for dtelecom_rtc-0.1.0-py3-none-any.whl

Total release size: 44.4 kB

Release files / dtelecom_rtc-0.1.0.tar.gz

Download URL dtelecom_rtc-0.1.0.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
25e9b5edafb4780aab1cddfec17fdcab7fe73129b529b66ba747d237214819d4
BLAKE2b-256 checksum
How to use checksums
4a1a0e4c5a34f384906b1e39c2d2fd2e1c14977d50879240db7995d60c999d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / dtelecom_rtc-0.1.0-py3-none-any.whl

Download URL dtelecom_rtc-0.1.0-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ea410ca1335916c3105f0fde376894d7362ce62ffcc72d45951f6aa215a5b08
BLAKE2b-256 checksum
How to use checksums
407ff387c1eca4c0cc79d4d5396da9fa117f61cb9ddddc101d208f3b27963275
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for dtelecom-rtc 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dtelecom_rtc-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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