skillfed

websockets

An implementation of the WebSocket Protocol (RFC 6455 & 7692)

websockets Permissive license BSD-3-Clause Active 5,712 v17.0.1 released

Install

websockets on PyPI

pip

pip install websockets

uv

uv add websockets

poetry

poetry add websockets

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 13 days since the last release
Last repo commit
First released
Popularity one of the 100 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: websockets-17.0.1-py3-none-any.whl

Keywords: WebSocket

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15

About websockets

from the package's own PyPI description — quoted content, verbatim

.. image:: logo/horizontal.svg :width: 480px :alt: websockets

|licence| |version| |pyversions|

.. |licence| image:: https://img.shields.io/pypi/l/websockets.svg :target: https://pypi.python.org/pypi/websockets

.. |version| image:: https://img.shields.io/pypi/v/websockets.svg :target: https://pypi.python.org/pypi/websockets

.. |pyversions| image:: https://img.shields.io/pypi/pyversions/websockets.svg :target: https://pypi.python.org/pypi/websockets

What is websockets?

websockets is a library for building WebSocket_ servers and clients in Python with a focus on correctness, simplicity, robustness, and performance.

.. _WebSocket: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API

Built on top of asyncio, Python's standard asynchronous I/O framework, the default implementation provides an elegant coroutine-based API.

Implementations on top of threading and trio are also provided, as well as a Sans-I/O layer for integration in third-party projects.

Documentation is available on Read the Docs. <https://websockets.readthedocs.io/>_

.. copy-pasted because GitHub doesn't support the include...

Read as markdown · JSON record · Source repository · Homepage · Docs

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

websockets is a library for building WebSocket servers and clients in Python with asyncio, threading, and trio support, emphasizing correctness, simplicity, robustness, and performance.

Low install friction with zero runtime dependencies and a pure-wheel distribution (websockets-17.0.1-py3-none-any.whl). Active maintenance with a release 13 days ago and last commit on 2026-08-10.

Released under BSD-3-Clause (permissive license), allowing commercial and private use with minimal restrictions beyond attribution and liability disclaimers.

Usage

pip install websockets

import asyncio
from websockets.asyncio.server import serve

async def echo(websocket):
    async for message in websocket:
        await websocket.send(message)

asyncio.run(serve(echo, "localhost", 8765))

Requires Python 3.11 or later; asyncio example requires async/await support.

Verdict: websockets is a production-ready, actively maintained WebSocket implementation with zero dependencies, permissive licensing, and strong RFC 6455 compliance. It ranks in the top 100 PyPI packages with no known vulnerabilities and supports Python 3.11–3.15, making it a low-friction choice for WebSocket applications.

Needs verification

  • Whether the C extension for performance optimization is automatically compiled or requires system dependencies during installation.
  • Specific performance characteristics and memory overhead compared to callback-based alternatives in production scenarios.
websocket server client pythonasyncio websocket libraryrfc 6455 websocket implementationpython websocket protocolreal-time bidirectional communicationwebsocket compression extensionscoroutine-based websocket api

Similar packages