Python bindings for web-transport-quinn
Project description
web-transport
Python bindings for web-transport-quinn — a pure-Rust WebTransport library built on QUIC.
Features
- Server and client — one session per connection, no HTTP/3 pooling complexity
- Streams — bidirectional and unidirectional, with backpressure
- Datagrams — unreliable, low-latency messaging
- Certificate pinning — connect to self-signed servers by hash
- Async-native — built for
asyncio, works withasync withandasync for - Fast — Rust core compiled to a native extension via PyO3
Installation
pip install web-transport-quinn
Requires Python 3.12+. Prebuilt wheels are available for Linux, macOS, and Windows.
Quick start: Echo server
import asyncio
import web_transport
async def main():
cert, key = web_transport.generate_self_signed(["localhost"])
async with web_transport.Server(
certificate_chain=[cert],
private_key=key,
bind="[::]:4433",
) as server:
print(f"Listening on {server.local_addr}")
print(f"Certificate hash: {web_transport.certificate_hash(cert).hex()}")
async for request in server:
session = await request.accept()
asyncio.create_task(handle(session))
async def handle(session: web_transport.Session):
async with session:
send, recv = await session.accept_bi()
async with send:
data = await recv.read()
await send.write(data)
asyncio.run(main())
Quick start: Client
import asyncio
import web_transport
async def main():
async with web_transport.Client(no_cert_verification=True) as client:
session = await client.connect("https://localhost:4433")
async with session:
send, recv = await session.open_bi()
async with send:
await send.write(b"Hello, WebTransport!")
response = await recv.read()
print(response)
asyncio.run(main())
API overview
| Name | Description |
|---|---|
Server |
Listens for incoming WebTransport sessions |
SessionRequest |
Inspect and accept/reject incoming sessions |
Client |
Opens outgoing WebTransport sessions |
Session |
Established session — open streams, send datagrams |
SendStream |
Write to a QUIC stream |
RecvStream |
Read from a QUIC stream |
generate_self_signed() |
Create a self-signed certificate and private key (DER bytes) |
certificate_hash() |
SHA-256 fingerprint of a DER-encoded certificate |
Server and Client accept DER-encoded bytes for certificates and keys, so you can use any TLS library (e.g. cryptography) to generate or load them.
All exceptions inherit from web_transport.WebTransportError. See the type stubs for the full API reference.
Certificate pinning
Connect to servers with self-signed certificates by pinning their SHA-256 hash:
cert_hash = web_transport.certificate_hash(cert) # or bytes.fromhex("ab12cd34...")
async with web_transport.Client(
server_certificate_hashes=[cert_hash],
) as client:
session = await client.connect("https://localhost:4433")
Datagrams
Send and receive unreliable datagrams over an established session:
await session.send_datagram(b"ping")
data = await session.receive_datagram()
The maximum payload size is available via session.max_datagram_size.
Development
See CLAUDE.md for full development conventions and tooling.
# Install dependencies
uv sync
# Build and test
uv run maturin develop
uv run pytest
# Lint and format
uv run ruff format .
uv run ruff check .
cargo fmt
cargo clippy -- -D warnings
License
MIT
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file web_transport_quinn-0.1.0.tar.gz.
File metadata
- Download URL: web_transport_quinn-0.1.0.tar.gz
- Upload date:
- Size: 81.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a965134b074e94ad503eab2ed1ffd784ec962136509ceb67e30e5e70705e47b0
|
|
| MD5 |
c952967a7c640a175797396e6b598eef
|
|
| BLAKE2b-256 |
10081771140817fda2dca0859cab6f97d41badfd693c62e91a90983a8542d1cd
|
Provenance
The following attestation bundles were made for web_transport_quinn-0.1.0.tar.gz:
Publisher:
release.yml on ai-and-i/web-transport-quinn-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_transport_quinn-0.1.0.tar.gz -
Subject digest:
a965134b074e94ad503eab2ed1ffd784ec962136509ceb67e30e5e70705e47b0 - Sigstore transparency entry: 1004743678
- Sigstore integration time:
-
Permalink:
ai-and-i/web-transport-quinn-py@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-and-i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file web_transport_quinn-0.1.0-cp313-cp313-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: web_transport_quinn-0.1.0-cp313-cp313-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb00178f2cdd2bc0d3a00923398577496c75b7a2d5a63c41e68fcaa9a5f1d3e6
|
|
| MD5 |
081c4c01c099b514c5892d2bd722f074
|
|
| BLAKE2b-256 |
d197da8593856f6cbf4f9ac00ab2248e0010ed3f771072740a4ebf5e2b6d7207
|
Provenance
The following attestation bundles were made for web_transport_quinn-0.1.0-cp313-cp313-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on ai-and-i/web-transport-quinn-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_transport_quinn-0.1.0-cp313-cp313-manylinux_2_28_aarch64.whl -
Subject digest:
fb00178f2cdd2bc0d3a00923398577496c75b7a2d5a63c41e68fcaa9a5f1d3e6 - Sigstore transparency entry: 1004743683
- Sigstore integration time:
-
Permalink:
ai-and-i/web-transport-quinn-py@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-and-i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file web_transport_quinn-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: web_transport_quinn-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
137079a372774de9ea50af2bdcbbe082650dd67bf4abb369553942b76d6b638c
|
|
| MD5 |
690bad8a78303a4310ce8dd547548aab
|
|
| BLAKE2b-256 |
1bb265db1dba85f18ef8ae2ff502c3887d462b0780209acf1e7e2456ec03d4e2
|
Provenance
The following attestation bundles were made for web_transport_quinn-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on ai-and-i/web-transport-quinn-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_transport_quinn-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
137079a372774de9ea50af2bdcbbe082650dd67bf4abb369553942b76d6b638c - Sigstore transparency entry: 1004743687
- Sigstore integration time:
-
Permalink:
ai-and-i/web-transport-quinn-py@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-and-i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file web_transport_quinn-0.1.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: web_transport_quinn-0.1.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9e732c836d8971e412fa86b7f630934f8640eb92b0dee928cae2cbe935b011
|
|
| MD5 |
eddfabe7fd3e376408f3ca31b6f7e3dc
|
|
| BLAKE2b-256 |
09d3066691862e2e20ebb0ffd37970d709e4b885dc322050264b948f45d9f971
|
Provenance
The following attestation bundles were made for web_transport_quinn-0.1.0-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on ai-and-i/web-transport-quinn-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_transport_quinn-0.1.0-cp312-cp312-win_amd64.whl -
Subject digest:
fc9e732c836d8971e412fa86b7f630934f8640eb92b0dee928cae2cbe935b011 - Sigstore transparency entry: 1004743699
- Sigstore integration time:
-
Permalink:
ai-and-i/web-transport-quinn-py@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-and-i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file web_transport_quinn-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: web_transport_quinn-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c431d27ef86cd2436859156593889f1d9b84ef09782e5032363dce29fc88e3d
|
|
| MD5 |
eea8c4ad07f1b8183527e95f356456ca
|
|
| BLAKE2b-256 |
edc4fe1964ff6fe964ae47b887629c382393a023715c5264ddc746e8ca5e0e62
|
Provenance
The following attestation bundles were made for web_transport_quinn-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on ai-and-i/web-transport-quinn-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_transport_quinn-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl -
Subject digest:
7c431d27ef86cd2436859156593889f1d9b84ef09782e5032363dce29fc88e3d - Sigstore transparency entry: 1004743694
- Sigstore integration time:
-
Permalink:
ai-and-i/web-transport-quinn-py@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-and-i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file web_transport_quinn-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: web_transport_quinn-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
141f9a692756655f20576f52348a5d3ef910e6e7ac78d3a931a214c7cb318df0
|
|
| MD5 |
13fdedaa8670f2cffdc83ca1e2a725e6
|
|
| BLAKE2b-256 |
5b62be63839df46b2ef8a0324e64872526df9b6c11a79d60a76e2d69b1e9d056
|
Provenance
The following attestation bundles were made for web_transport_quinn-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on ai-and-i/web-transport-quinn-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_transport_quinn-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
141f9a692756655f20576f52348a5d3ef910e6e7ac78d3a931a214c7cb318df0 - Sigstore transparency entry: 1004743680
- Sigstore integration time:
-
Permalink:
ai-and-i/web-transport-quinn-py@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-and-i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file web_transport_quinn-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: web_transport_quinn-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8847e69c808e9a16b2e15c06fd5a87e18a5a6f26ef90c1ee8d1fb6454d191398
|
|
| MD5 |
da011bbf7aaae109765f70c04b4b06a3
|
|
| BLAKE2b-256 |
8979ad18b072005b4607a4585b9ca210965b9dec65902b0b63a855c70f91b9f3
|
Provenance
The following attestation bundles were made for web_transport_quinn-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
release.yml on ai-and-i/web-transport-quinn-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_transport_quinn-0.1.0-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
8847e69c808e9a16b2e15c06fd5a87e18a5a6f26ef90c1ee8d1fb6454d191398 - Sigstore transparency entry: 1004743698
- Sigstore integration time:
-
Permalink:
ai-and-i/web-transport-quinn-py@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-and-i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file web_transport_quinn-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl.
File metadata
- Download URL: web_transport_quinn-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eccdbcf0019af442821a541b15cd7218abd5e67dc8e4acad68713eb31ba52195
|
|
| MD5 |
245ed0fda690051828cb3e8a746897dc
|
|
| BLAKE2b-256 |
3e05d1910f5bf8b32193ac24739c105dcc242d73aa2b39f6114af32bcea5282f
|
Provenance
The following attestation bundles were made for web_transport_quinn-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl:
Publisher:
release.yml on ai-and-i/web-transport-quinn-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_transport_quinn-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl -
Subject digest:
eccdbcf0019af442821a541b15cd7218abd5e67dc8e4acad68713eb31ba52195 - Sigstore transparency entry: 1004743690
- Sigstore integration time:
-
Permalink:
ai-and-i/web-transport-quinn-py@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-and-i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9b8fdd438a5b7d02c4189344a0a38f533b3d2a9b -
Trigger Event:
push
-
Statement type: