{"id":37074065,"url":"https://github.com/wtransport/pywebtransport","last_synced_at":"2026-05-09T13:23:06.041Z","repository":{"id":306777581,"uuid":"1008382440","full_name":"wtransport/pywebtransport","owner":"wtransport","description":"An async-native WebTransport stack for Python.","archived":false,"fork":false,"pushed_at":"2026-03-01T14:20:21.000Z","size":2647,"stargazers_count":29,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-01T17:56:59.846Z","etag":null,"topics":["async","http3","networking","protocol","python","quic","rust","webtransport"],"latest_commit_sha":null,"homepage":"https://python.wtransport.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wtransport.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"wtransport"}},"created_at":"2025-06-25T13:07:36.000Z","updated_at":"2026-03-01T14:20:20.000Z","dependencies_parsed_at":"2025-08-25T03:35:17.003Z","dependency_job_id":"49a607fe-b7b0-46be-b754-13c4c8ce502d","html_url":"https://github.com/wtransport/pywebtransport","commit_stats":null,"previous_names":["lemonsterfy/pywebtransport","wtransport/pywebtransport"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/wtransport/pywebtransport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtransport%2Fpywebtransport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtransport%2Fpywebtransport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtransport%2Fpywebtransport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtransport%2Fpywebtransport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wtransport","download_url":"https://codeload.github.com/wtransport/pywebtransport/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtransport%2Fpywebtransport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30234469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","http3","networking","protocol","python","quic","rust","webtransport"],"created_at":"2026-01-14T08:43:23.431Z","updated_at":"2026-05-09T13:23:06.023Z","avatar_url":"https://github.com/wtransport.png","language":"Python","funding_links":["https://opencollective.com/wtransport"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg\n    src=\"https://raw.githubusercontent.com/wtransport/pywebtransport/main/docs/assets/favicon.svg\"\n    alt=\"PyWebTransport Logo\"\n    width=\"100\"\n  /\u003e\n\n# PyWebTransport\n\n_An async-native WebTransport stack for Python_\n\n  \u003cbr /\u003e\n\n[![PyPI version](https://badge.fury.io/py/pywebtransport.svg)](https://pypi.org/project/pywebtransport/)\n[![Python Version](https://img.shields.io/pypi/pyversions/pywebtransport)](https://pypi.org/project/pywebtransport/)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![CI](https://github.com/wtransport/pywebtransport/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/wtransport/pywebtransport/actions/workflows/ci.yml)\n[![Coverage](https://codecov.io/gh/wtransport/pywebtransport/branch/main/graph/badge.svg)](https://codecov.io/gh/wtransport/pywebtransport)\n[![Docs](https://app.readthedocs.org/projects/pywebtransport/badge/?version=latest)](https://python.wtransport.org/)\n\n\u003c/div\u003e\n\n## Features\n\n- **Sans-I/O Architecture**: Powered by an ownership-driven Rust state machine decoupled from an autonomous threaded reactor via a lock-free IPC boundary.\n- **Transport Primitives**: Full implementation of bidirectional streams, unidirectional streams, and unreliable datagrams.\n- **Structured Concurrency**: Deterministic lifecycle management for connections and streams via asynchronous context managers.\n- **Zero-Copy I/O**: End-to-end support for buffer protocols and `memoryview` to minimize data copying overhead.\n- **Application Framework**: Declarative `ServerApp` featuring path-based routing and composable stateful middleware.\n\n## Installation\n\n```bash\npip install pywebtransport\n```\n\n## Quick Start\n\n### Server\n\n```python\nimport asyncio\n\nfrom pywebtransport import Event, ServerApp, ServerConfig, WebTransportSession, WebTransportStream\nfrom pywebtransport.types import EventType\nfrom pywebtransport.utils import generate_self_signed_cert\n\ngenerate_self_signed_cert(hostname=\"localhost\")\n\napp = ServerApp(config=ServerConfig(certfile=\"localhost.crt\", keyfile=\"localhost.key\"))\n\n\n@app.route(path=\"/\")\nasync def echo_handler(session: WebTransportSession) -\u003e None:\n    async def on_datagram(event: Event) -\u003e None:\n        if isinstance(event.data, dict) and (data := event.data.get(\"data\")):\n            await session.send_datagram(data=b\"ECHO: \" + data)\n\n    session.events.on(event_type=EventType.DATAGRAM_RECEIVED, handler=on_datagram)\n\n    try:\n        async for stream in session.incoming_bidirectional_streams():\n            asyncio.create_task(handle_stream(stream))\n    finally:\n        session.events.off(event_type=EventType.DATAGRAM_RECEIVED, handler=on_datagram)\n\n\nasync def handle_stream(stream: WebTransportStream) -\u003e None:\n    try:\n        data = await stream.read_all()\n        await stream.write_all(data=b\"ECHO: \" + data, end_stream=True)\n    except Exception:\n        pass\n\n\nif __name__ == \"__main__\":\n    app.run(host=\"127.0.0.1\", port=4433)\n```\n\n### Client\n\n```python\nimport asyncio\nimport ssl\n\nfrom pywebtransport import ClientConfig, WebTransportClient\nfrom pywebtransport.types import EventType\n\n\nasync def main() -\u003e None:\n    config = ClientConfig(verify_mode=ssl.CERT_NONE)\n\n    async with WebTransportClient(config=config) as client:\n        session = await client.connect(url=\"https://127.0.0.1:4433/\")\n\n        await session.send_datagram(data=b\"Hello, Datagram!\")\n\n        event = await session.events.wait_for(event_type=EventType.DATAGRAM_RECEIVED)\n        if isinstance(event.data, dict) and (data := event.data.get(\"data\")):\n            print(f\"Datagram: {data!r}\")\n\n        stream = await session.create_bidirectional_stream()\n        await stream.write_all(data=b\"Hello, Stream!\", end_stream=True)\n\n        response = await stream.read_all()\n        print(f\"Stream: {response!r}\")\n\n        await session.close()\n\n\nif __name__ == \"__main__\":\n    try:\n        asyncio.run(main())\n    except KeyboardInterrupt:\n        pass\n```\n\n## Interoperability\n\n**Infrastructure**\n\n- [**Public Instance**](https://interop.wtransport.org): `https://interop.wtransport.org`, _Native Dual-Stack_\n- [**Container Image**](https://github.com/wtransport/pywebtransport/pkgs/container/interop-server): `ghcr.io/wtransport/interop-server:latest`, _UDP Port 4433_\n\n**Endpoints**\n\n- **/echo**: Bidirectional stream and datagram reflection.\n- **/stats**: Current session statistics and negotiated parameters.\n- **/status**: Global server health and aggregate metrics.\n- **/webtransport/devious-baton**: Devious Baton protocol state transition validation.\n\n## Sponsors\n\n\u003cdiv\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://www.fastly.com/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cimg\n      src=\"https://raw.githubusercontent.com/wtransport/pywebtransport/main/docs/assets/sponsor-fastly.svg\"\n      alt=\"Fastly\"\n      width=\"110\"\n    /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## License\n\nDistributed under the terms of the Apache License 2.0. See [`LICENSE`](https://github.com/wtransport/pywebtransport/blob/main/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtransport%2Fpywebtransport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtransport%2Fpywebtransport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtransport%2Fpywebtransport/lists"}