# python-websockets/websockets

Library for building WebSocket servers and clients in Python

Repository: https://github.com/python-websockets/websockets
Canonical: https://ross.abutalabs.com/products/python-websockets-websockets
Homepage: https://websockets.readthedocs.io/
Language: Python
License: BSD-3-Clause
License Family: permissive
Topics: python, python3, websocket, websockets, websocket-client, websocket-server, websocket-library
Last push: 2026-08-26T06:06:33+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 99, longevity 100
- inputs: {"age_days": 4904, "days_push": 7, "days_rel": 7, "gap_med": 26, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5714, forks 603 (observed 2026-08-28T04:09:28.180768+00:00)

## What it is
websockets is a Python library for building WebSocket servers and clients, with a focus on correctness, simplicity, robustness, and performance. It provides coroutine-based asyncio, threading, and trio implementations, plus a Sans-I/O layer for embedding in other projects.

## Use cases
- build a websocket server in python
- connect to a websocket endpoint from python
- stream real-time messages between client and server
- add bidirectional communication to a python backend
- implement a websocket client with threading
- embed websocket protocol handling in another library

## When to choose
- you need a mature, well-tested WebSocket implementation in Python
- you want asyncio-based coroutine APIs for concurrent connections
- you need flexibility across asyncio, trio, or threading
- you want a Sans-I/O layer to integrate WebSocket handling into your own stack

## When to avoid
- you only need simple HTTP request/response without WebSockets
- you are building a browser or non-Python client
- you need a full web framework with routing and templating rather than just WebSocket support

## Facets
- artifact type: library
- maturity: stable
- function: websocket, http-server, http-client, concurrency
- domain: web-development, backend, networking
- platform: python, cross-platform
- tags: asyncio, trio, threading, sans-io, real-time-communication, real-time

## Member repositories
- python-websockets/websockets (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:28.180768+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:53:29.522398+00:00, confidence not recorded.
  - readme: https://github.com/python-websockets/websockets (fetched 2026-08-28T04:09:28.180768+00:00, sha 3e83d290cc1b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
