Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

METADATA 6.5KB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. Metadata-Version: 2.1
  2. Name: websockets
  3. Version: 11.0.3
  4. Summary: An implementation of the WebSocket Protocol (RFC 6455 & 7692)
  5. Author-email: Aymeric Augustin <aymeric.augustin@m4x.org>
  6. License: BSD-3-Clause
  7. Project-URL: homepage, https://github.com/aaugustin/websockets
  8. Project-URL: changelog, https://websockets.readthedocs.io/en/stable/project/changelog.html
  9. Project-URL: documentation, https://websockets.readthedocs.io/
  10. Project-URL: funding, https://tidelift.com/subscription/pkg/pypi-websockets?utm_source=pypi-websockets&utm_medium=referral&utm_campaign=readme
  11. Project-URL: tracker, https://github.com/aaugustin/websockets/issues
  12. Keywords: WebSocket
  13. Classifier: Development Status :: 5 - Production/Stable
  14. Classifier: Environment :: Web Environment
  15. Classifier: Intended Audience :: Developers
  16. Classifier: License :: OSI Approved :: BSD License
  17. Classifier: Operating System :: OS Independent
  18. Classifier: Programming Language :: Python
  19. Classifier: Programming Language :: Python :: 3
  20. Classifier: Programming Language :: Python :: 3.7
  21. Classifier: Programming Language :: Python :: 3.8
  22. Classifier: Programming Language :: Python :: 3.9
  23. Classifier: Programming Language :: Python :: 3.10
  24. Classifier: Programming Language :: Python :: 3.11
  25. Requires-Python: >=3.7
  26. License-File: LICENSE
  27. .. image:: logo/horizontal.svg
  28. :width: 480px
  29. :alt: websockets
  30. |licence| |version| |pyversions| |tests| |docs| |openssf|
  31. .. |licence| image:: https://img.shields.io/pypi/l/websockets.svg
  32. :target: https://pypi.python.org/pypi/websockets
  33. .. |version| image:: https://img.shields.io/pypi/v/websockets.svg
  34. :target: https://pypi.python.org/pypi/websockets
  35. .. |pyversions| image:: https://img.shields.io/pypi/pyversions/websockets.svg
  36. :target: https://pypi.python.org/pypi/websockets
  37. .. |tests| image:: https://img.shields.io/github/checks-status/aaugustin/websockets/main?label=tests
  38. :target: https://github.com/aaugustin/websockets/actions/workflows/tests.yml
  39. .. |docs| image:: https://img.shields.io/readthedocs/websockets.svg
  40. :target: https://websockets.readthedocs.io/
  41. .. |openssf| image:: https://bestpractices.coreinfrastructure.org/projects/6475/badge
  42. :target: https://bestpractices.coreinfrastructure.org/projects/6475
  43. What is ``websockets``?
  44. -----------------------
  45. websockets is a library for building WebSocket_ servers and clients in Python
  46. with a focus on correctness, simplicity, robustness, and performance.
  47. .. _WebSocket: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
  48. Built on top of ``asyncio``, Python's standard asynchronous I/O framework, the
  49. default implementation provides an elegant coroutine-based API.
  50. An implementation on top of ``threading`` and a Sans-I/O implementation are also
  51. available.
  52. `Documentation is available on Read the Docs. <https://websockets.readthedocs.io/>`_
  53. .. copy-pasted because GitHub doesn't support the include directive
  54. Here's an echo server with the ``asyncio`` API:
  55. .. code:: python
  56. #!/usr/bin/env python
  57. import asyncio
  58. from websockets.server import serve
  59. async def echo(websocket):
  60. async for message in websocket:
  61. await websocket.send(message)
  62. async def main():
  63. async with serve(echo, "localhost", 8765):
  64. await asyncio.Future() # run forever
  65. asyncio.run(main())
  66. Here's how a client sends and receives messages with the ``threading`` API:
  67. .. code:: python
  68. #!/usr/bin/env python
  69. import asyncio
  70. from websockets.sync.client import connect
  71. def hello():
  72. with connect("ws://localhost:8765") as websocket:
  73. websocket.send("Hello world!")
  74. message = websocket.recv()
  75. print(f"Received: {message}")
  76. hello()
  77. Does that look good?
  78. `Get started with the tutorial! <https://websockets.readthedocs.io/en/stable/intro/index.html>`_
  79. Why should I use ``websockets``?
  80. --------------------------------
  81. The development of ``websockets`` is shaped by four principles:
  82. 1. **Correctness**: ``websockets`` is heavily tested for compliance with
  83. :rfc:`6455`. Continuous integration fails under 100% branch coverage.
  84. 2. **Simplicity**: all you need to understand is ``msg = await ws.recv()`` and
  85. ``await ws.send(msg)``. ``websockets`` takes care of managing connections
  86. so you can focus on your application.
  87. 3. **Robustness**: ``websockets`` is built for production. For example, it was
  88. the only library to `handle backpressure correctly`_ before the issue
  89. became widely known in the Python community.
  90. 4. **Performance**: memory usage is optimized and configurable. A C extension
  91. accelerates expensive operations. It's pre-compiled for Linux, macOS and
  92. Windows and packaged in the wheel format for each system and Python version.
  93. Documentation is a first class concern in the project. Head over to `Read the
  94. Docs`_ and see for yourself.
  95. .. _Read the Docs: https://websockets.readthedocs.io/
  96. .. _handle backpressure correctly: https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#websocket-servers
  97. Why shouldn't I use ``websockets``?
  98. -----------------------------------
  99. * If you prefer callbacks over coroutines: ``websockets`` was created to
  100. provide the best coroutine-based API to manage WebSocket connections in
  101. Python. Pick another library for a callback-based API.
  102. * If you're looking for a mixed HTTP / WebSocket library: ``websockets`` aims
  103. at being an excellent implementation of :rfc:`6455`: The WebSocket Protocol
  104. and :rfc:`7692`: Compression Extensions for WebSocket. Its support for HTTP
  105. is minimal — just enough for an HTTP health check.
  106. If you want to do both in the same server, look at HTTP frameworks that
  107. build on top of ``websockets`` to support WebSocket connections, like
  108. Sanic_.
  109. .. _Sanic: https://sanicframework.org/en/
  110. What else?
  111. ----------
  112. Bug reports, patches and suggestions are welcome!
  113. To report a security vulnerability, please use the `Tidelift security
  114. contact`_. Tidelift will coordinate the fix and disclosure.
  115. .. _Tidelift security contact: https://tidelift.com/security
  116. For anything else, please open an issue_ or send a `pull request`_.
  117. .. _issue: https://github.com/aaugustin/websockets/issues/new
  118. .. _pull request: https://github.com/aaugustin/websockets/compare/
  119. Participants must uphold the `Contributor Covenant code of conduct`_.
  120. .. _Contributor Covenant code of conduct: https://github.com/aaugustin/websockets/blob/main/CODE_OF_CONDUCT.md
  121. ``websockets`` is released under the `BSD license`_.
  122. .. _BSD license: https://github.com/aaugustin/websockets/blob/main/LICENSE