|
25 | 25 | What is ``websockets``?
|
26 | 26 | -----------------------
|
27 | 27 |
|
28 |
| -``websockets`` is a library for building WebSocket servers_ and clients_ in |
29 |
| -Python with a focus on correctness and simplicity. |
| 28 | +websockets is a library for building WebSocket_ servers and clients in Python |
| 29 | +with a focus on correctness, simplicity, robustness, and performance. |
30 | 30 |
|
31 |
| -.. _servers: https://github.com/aaugustin/websockets/blob/main/example/server.py |
32 |
| -.. _clients: https://github.com/aaugustin/websockets/blob/main/example/client.py |
| 31 | +.. _WebSocket: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API |
33 | 32 |
|
34 | 33 | Built on top of ``asyncio``, Python's standard asynchronous I/O framework, it
|
35 | 34 | provides an elegant coroutine-based API.
|
@@ -92,19 +91,19 @@ Why should I use ``websockets``?
|
92 | 91 |
|
93 | 92 | The development of ``websockets`` is shaped by four principles:
|
94 | 93 |
|
95 |
| -1. **Simplicity**: all you need to understand is ``msg = await ws.recv()`` and |
96 |
| - ``await ws.send(msg)``; ``websockets`` takes care of managing connections |
| 94 | +1. **Correctness**: ``websockets`` is heavily tested for compliance |
| 95 | + with :rfc:`6455`. Continuous integration fails under 100% branch |
| 96 | + coverage. |
| 97 | + |
| 98 | +2. **Simplicity**: all you need to understand is ``msg = await ws.recv()`` and |
| 99 | + ``await ws.send(msg)``. ``websockets`` takes care of managing connections |
97 | 100 | so you can focus on your application.
|
98 | 101 |
|
99 |
| -2. **Robustness**: ``websockets`` is built for production; for example it was |
| 102 | +3. **Robustness**: ``websockets`` is built for production. For example, it was |
100 | 103 | the only library to `handle backpressure correctly`_ before the issue
|
101 | 104 | became widely known in the Python community.
|
102 | 105 |
|
103 |
| -3. **Quality**: ``websockets`` is heavily tested. Continuous integration fails |
104 |
| - under 100% branch coverage. Also it passes the industry-standard `Autobahn |
105 |
| - Testsuite`_. |
106 |
| - |
107 |
| -4. **Performance**: memory usage is configurable. An extension written in C |
| 106 | +4. **Performance**: memory usage is optimized and configurable. A C extension |
108 | 107 | accelerates expensive operations. It's pre-compiled for Linux, macOS and
|
109 | 108 | Windows and packaged in the wheel format for each system and Python version.
|
110 | 109 |
|
|
0 commit comments