ws4py
WebSocket client and server library for Python 2 and 3 as well as PyPy
What it is and what it does
ws4py is a Python library that implements the WebSocket protocol as defined in RFC 6455, allowing applications to establish persistent, bidirectional communication channels between clients and servers. It supports both client and server implementations and works across Python 2.7 and modern Python 3 versions as well as PyPy.
The library is designed for scenarios where you need real-time, low-latency communication—such as live notifications, collaborative editing, or streaming data—without the overhead of repeated HTTP requests. It can be used as WSGI middleware or as a standalone server component.
Use it for:
- Building real-time chat or messaging applications where messages must flow instantly between connected clients
- Streaming live data to multiple clients simultaneously without polling
- Implementing collaborative tools that require bidirectional updates between browser and server
- Creating WebSocket-based APIs for mobile or desktop clients that need persistent connections
- Adding live notifications or alerts to web applications
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ws4py implements the WebSocket protocol (RFC 6455) for Python, enabling bidirectional communication between clients and servers over a single TCP connection.
Yes, if you need WebSocket support in Python. The package is stable (Production/Stable status), has no known vulnerabilities, installs with zero dependencies, and is actively maintained. Suitable for production use.
Install
ws4py on PyPI
pip
pip install ws4pyuv
uv add ws4pypoetry
poetry add ws4pyInstalling ws4py
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with a recent release (2024-12-19) and an active repository.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install ws4py
from ws4py.client.threadedclient import WebSocketClient
client = WebSocketClient('ws://example.com/echo')
client.connect()
Verify before relying
- Whether the package actively supports Python 3.12 and PyPy despite the 603-day gap since last commit
- Current state of CherryPy integration (listed in classifiers but integration details not in excerpt)
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 603 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 434,528/month — #6,687 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ws4py-0.6.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
autobahnAutobahn provides WebSocket and WAMP (Web…
permissive · top 5,000 on PyPI
trio-websocketImplements WebSocket protocol (RFC 6455) for…
permissive · top 1,000 on PyPI
wslinkwslink provides bi-directional websocket…
permissive · top 5,000 on PyPI
simple-websocketProvides a straightforward WebSocket server and…
permissive · top 1,000 on PyPI
websocketswebsockets is a library for building WebSocket…
permissive · top 100 on PyPI
wsprotowsproto is a pure-Python WebSocket protocol…
permissive · top 1,000 on PyPI
python-engineioPython implementation of the Engine.IO realtime…
permissive · top 1,000 on PyPI
websocketProvides WebSocket protocol support for…
permissive · top 15,000 on PyPI
flask-sockAdds WebSocket support to Flask applications…
permissive · top 5,000 on PyPI
python-socketioPython implementation of Socket.IO realtime…
permissive · top 1,000 on PyPI