Skip to main content

aiolibdatachannel

An asyncio-friendly Python wrapper around libdatachannel — a lightweight C/C++ WebRTC stack. aiolibdatachannel exposes WebRTC Peer Connections and Data Channels through idiomatic async/await Python.

Scope: PeerConnection + DataChannel only. WebSocket and Media/RTP transport are deliberately disabled in this build to keep the wheel small and the API focused.

Install

pip install aiolibdatachannel

Wheels are published for Linux (manylinux_2_34 x86_64 / aarch64) and macOS (arm64, 14.0+) per CPython version (cp312 / cp313 / cp314). Intel Macs and Windows aren't currently covered — Intel Mac because Apple Silicon is the modern target, Windows because libdatachannel dynamically links OpenSSL and the wheel packaging for that on Windows is still open.

ℹ️ Earlier releases shipped a single cp312-abi3 wheel covering all CPython 3.12+. The bundled OpenSSL inside that wheel collided with the OpenSSL CPython itself loads via _ssl / hashlib (process- global PRNG / FIPS state), which segfaulted on first PeerConnection use under CPython 3.14. We now publish per-version wheels so each binary lines up with the matching interpreter ABI.

The Python↔C boundary uses nanobind: libdatachannel and its static dependencies (usrsctp, libjuice, OpenSSL) link directly into the extension. The binding layer itself is deliberately thin: native trampolines route every libdatachannel callback through a single Python dispatcher, and the asyncio semantics live in the pure-Python wrapper on top, not in C++.

Quickstart

import asyncio
from aiolibdatachannel import PeerConnection, RTCConfiguration

async def main() -> None:
    config = RTCConfiguration(ice_servers=["stun:stun.l.google.com:19302"])

    async with PeerConnection(config) as pc:
        dc = await pc.create_data_channel("chat")

        offer = await pc.create_offer()
        # ... ship `offer` to the peer via your signalling channel ...
        answer_sdp = await receive_answer_from_peer()
        await pc.set_remote_description(answer_sdp, "answer")

        await dc.wait_open()
        await dc.send(b"hello")

        async for message in dc:
            print("got", message)

asyncio.run(main())

See examples/offerer.py and examples/answerer.py for a runnable pair of scripts that negotiate over stdin/stdout.

Logging

Route libdatachannel's internal logs through Python's standard logging module:

import logging
from aiolibdatachannel import install_python_logger

logging.basicConfig(level=logging.INFO)
install_python_logger()  # logger name defaults to "aiolibdatachannel"

Severities are translated (FATAL→CRITICAL, ERROR→ERROR, WARNING→WARNING, INFO→INFO, DEBUG/VERBOSE→DEBUG) and the filter threshold on the native side is derived from the Python logger's effective level, so you don't pay to format lines that would be filtered out anyway. Pass install_python_logger(my_logger) or install_python_logger(level=LogLevel.DEBUG) to customise.

Development

Full native build (requires a C++17 toolchain, CMake ≥ 3.24, ninja, and OpenSSL headers):

git clone --recursive https://github.com/social-home-io/aiolibdatachannel.git
cd aiolibdatachannel
pip install -e .[dev]
pytest

If you only need to touch the Python wrapper (async semantics, async iterators, event plumbing), skip the C++ build and run against the pure-Python stand-in from tests/_fake_native.py:

pip install pytest pytest-asyncio
PYTHONPATH=. pytest -m "not native"

tests/conftest.py injects the fake into sys.modules whenever AIOLIB_REQUIRE_NATIVE is unset. Tests marked @pytest.mark.native (loopback, cancellation, logging, errors, stress) are auto-skipped in that mode.

Long-running soak tests (10 000-message loopback, 100 PC lifecycles, shutdown-leak subprocess checks) live behind a stress marker and are off by default — enable with pytest -m stress or AIOLIB_STRESS=1 pytest. They also run nightly in CI.

See docs/BUILDING.md for detailed build instructions, including how to switch TLS backends and how to bump the bundled libdatachannel version.

License

This project is licensed under the Mozilla Public License 2.0, matching the license of libdatachannel which it bundles and statically links. See LICENSE and vendor/libdatachannel/LICENSE.

Metadata

Release files for aiolibdatachannel 2026.10.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiolibdatachannel 2026.10.15
File Size Uploaded
aiolibdatachannel-2026.10.15.tar.gz 11.7 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for aiolibdatachannel 2026.10.15
File
aiolibdatachannel-2026.10.15-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details
aiolibdatachannel-2026.10.15-cp314-cp314-manylinux_2_34_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ ARM64 Details
aiolibdatachannel-2026.10.15-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details
aiolibdatachannel-2026.10.15-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details
aiolibdatachannel-2026.10.15-cp313-cp313-manylinux_2_34_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ ARM64 Details
aiolibdatachannel-2026.10.15-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
aiolibdatachannel-2026.10.15-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
aiolibdatachannel-2026.10.15-cp312-cp312-manylinux_2_34_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ ARM64 Details
aiolibdatachannel-2026.10.15-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details

Total release size: 55.3 MB

Release files / aiolibdatachannel-2026.10.15.tar.gz

Download URL aiolibdatachannel-2026.10.15.tar.gz
Size 11.7 MB
Tags Source
SHA-256 checksum
How to use checksums
dfc60977c32660e26dec1d5bb0fb9283b135e5b6042f75b24264aa2e142759ea
BLAKE2b-256 checksum
How to use checksums
4f642e2ac61be7de255af1ca702ea2d18e8b04b771d186a74bcb807266cff4aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL aiolibdatachannel-2026.10.15-cp314-cp314-manylinux_2_34_x86_64.whl
Size 5.2 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
de5ce3880d87a3a509d767fd93ab3be7e662468787c09d862782689ee7f5103e
BLAKE2b-256 checksum
How to use checksums
60382c7a36b317ab47382043c3c55ac2b2f359d4d025b9ed9c58501de67a63ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp314-cp314-manylinux_2_34_aarch64.whl

Download URL aiolibdatachannel-2026.10.15-cp314-cp314-manylinux_2_34_aarch64.whl
Size 4.9 MB
Tags CPython 3.14 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
b983eb67fe8aaf1db8421200e71ffd8b2af31a34991c3d64bd1e0ea959176de1
BLAKE2b-256 checksum
How to use checksums
0d4c4cb5bf7b6e74b5f1a4323287965cdbdadfdd610537039510831c38e5a168
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp314-cp314-macosx_14_0_arm64.whl

Download URL aiolibdatachannel-2026.10.15-cp314-cp314-macosx_14_0_arm64.whl
Size 4.5 MB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
f78fe98519046082a4d3ce8b7fc47bbebdc7ced9aebedd04b1fcefdc96bb7e32
BLAKE2b-256 checksum
How to use checksums
547c97d335080b590523b4eedb7f8889e715243b52a9e40bf9ef8afd35434133
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL aiolibdatachannel-2026.10.15-cp313-cp313-manylinux_2_34_x86_64.whl
Size 5.2 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
55546780f174c5752794f11287478c45676059c6b35ad6a4788bd23a1fd2957d
BLAKE2b-256 checksum
How to use checksums
4f0003f7dbe8bbe27b67dc5f2ad8303c3099c124eafff7ade3412a45d1d4783d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp313-cp313-manylinux_2_34_aarch64.whl

Download URL aiolibdatachannel-2026.10.15-cp313-cp313-manylinux_2_34_aarch64.whl
Size 4.9 MB
Tags CPython 3.13 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
c11d8bec5fde57ebef0e7c173bfb2ad95a9014635be034c901eab8e802b06d94
BLAKE2b-256 checksum
How to use checksums
bb33e0579d3e1dd9917a12a467c970e1c2df601f0dacb5bc3068baa9b2495823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp313-cp313-macosx_14_0_arm64.whl

Download URL aiolibdatachannel-2026.10.15-cp313-cp313-macosx_14_0_arm64.whl
Size 4.5 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
bd5eee9f7cd4020135a4f27e917f50540d74d650e6467f56ef9ce992a4402156
BLAKE2b-256 checksum
How to use checksums
ef433bdc4f91fa6add9f791a577e464110fcb11be40c13049823e65486c208a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL aiolibdatachannel-2026.10.15-cp312-cp312-manylinux_2_34_x86_64.whl
Size 5.2 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
292cdb45937562a9d423543afed41d5a672454859e692883254bebd06f696dc7
BLAKE2b-256 checksum
How to use checksums
425fd5b06ec8297d7c0c2954086013dd27cee895fa31d71daa8acd6b5ac7ee88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp312-cp312-manylinux_2_34_aarch64.whl

Download URL aiolibdatachannel-2026.10.15-cp312-cp312-manylinux_2_34_aarch64.whl
Size 4.9 MB
Tags CPython 3.12 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
cabaeab34b8b28634234874c382e9a12b7c4024d515573ddfdc5d120d35ec766
BLAKE2b-256 checksum
How to use checksums
c85f2d4d151099d76b6e066f1f4a6fd4d3199f9a10097232ee2080d7492180d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / aiolibdatachannel-2026.10.15-cp312-cp312-macosx_14_0_arm64.whl

Download URL aiolibdatachannel-2026.10.15-cp312-cp312-macosx_14_0_arm64.whl
Size 4.5 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
404e3934d7b4c86d9950b1b59ee28e4c266aca9555ddb44a8d2b14c425d7f878
BLAKE2b-256 checksum
How to use checksums
6c27468586e4381e75612dc111f1ee85bb8573033cf366352e51781c90253345
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.10.15 This release

10 release files

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