README.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. Twisted
  2. #######
  3. |gitter|_
  4. |rtd|_
  5. |pypi|_
  6. |ci|_
  7. For information on changes in this release, see the `NEWS <NEWS.rst>`_ file.
  8. What is this?
  9. -------------
  10. Twisted is an event-based framework for internet applications, supporting Python 3.6+.
  11. It includes modules for many different purposes, including the following:
  12. - ``twisted.web``: HTTP clients and servers, HTML templating, and a WSGI server
  13. - ``twisted.conch``: SSHv2 and Telnet clients and servers and terminal emulators
  14. - ``twisted.words``: Clients and servers for IRC, XMPP, and other IM protocols
  15. - ``twisted.mail``: IMAPv4, POP3, SMTP clients and servers
  16. - ``twisted.positioning``: Tools for communicating with NMEA-compatible GPS receivers
  17. - ``twisted.names``: DNS client and tools for making your own DNS servers
  18. - ``twisted.trial``: A unit testing framework that integrates well with Twisted-based code.
  19. Twisted supports all major system event loops -- ``select`` (all platforms), ``poll`` (most POSIX platforms), ``epoll`` (Linux), ``kqueue`` (FreeBSD, macOS), IOCP (Windows), and various GUI event loops (GTK+2/3, Qt, wxWidgets).
  20. Third-party reactors can plug into Twisted, and provide support for additional event loops.
  21. Installing
  22. ----------
  23. To install the latest version of Twisted using pip::
  24. $ pip install twisted
  25. Additional instructions for installing this software are in `the installation instructions <INSTALL.rst>`_.
  26. Documentation and Support
  27. -------------------------
  28. Twisted's documentation is available from the `Twisted Matrix website <https://twistedmatrix.com/documents/current/>`_.
  29. This documentation contains how-tos, code examples, and an API reference.
  30. Help is also available on the `Twisted mailing list <https://mail.python.org/mailman3/lists/twisted.python.org/>`_.
  31. There is also an IRC channel, ``#twisted``,
  32. on the `Libera.Chat <https://libera.chat/>`_ network.
  33. A web client is available at `web.libera.chat <https://web.libera.chat/>`_.
  34. Unit Tests
  35. ----------
  36. Twisted has a comprehensive test suite, which can be run by ``tox``::
  37. $ tox -l # to view all test environments
  38. $ tox -e nocov # to run all the tests without coverage
  39. $ tox -e withcov # to run all the tests with coverage
  40. $ tox -e alldeps-withcov-posix # install all dependencies, run tests with coverage on POSIX platform
  41. You can test running the test suite under the different reactors with the ``TWISTED_REACTOR`` environment variable::
  42. $ env TWISTED_REACTOR=epoll tox -e alldeps-withcov-posix
  43. Some of these tests may fail if you:
  44. * don't have the dependencies required for a particular subsystem installed,
  45. * have a firewall blocking some ports (or things like Multicast, which Linux NAT has shown itself to do), or
  46. * run them as root.
  47. Static Code Checkers
  48. --------------------
  49. You can ensure that code complies to Twisted `coding standards <https://twistedmatrix.com/documents/current/core/development/policy/coding-standard.html>`_::
  50. $ tox -e lint # run pre-commit to check coding stanards
  51. $ tox -e mypy # run MyPy static type checker to check for type errors
  52. Or, for speed, use pre-commit directly::
  53. $ pipx run pre-commit run
  54. Copyright
  55. ---------
  56. All of the code in this distribution is Copyright (c) 2001-2024 Twisted Matrix Laboratories.
  57. Twisted is made available under the MIT license.
  58. The included `LICENSE <LICENSE>`_ file describes this in detail.
  59. Warranty
  60. --------
  61. THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
  62. EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  63. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
  64. TO THE USE OF THIS SOFTWARE IS WITH YOU.
  65. IN NO EVENT WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
  66. AND/OR REDISTRIBUTE THE LIBRARY, BE LIABLE TO YOU FOR ANY DAMAGES, EVEN IF
  67. SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  68. DAMAGES.
  69. Again, see the included `LICENSE <LICENSE>`_ file for specific legal details.
  70. .. |pypi| image:: https://img.shields.io/pypi/v/twisted.svg
  71. .. _pypi: https://pypi.python.org/pypi/twisted
  72. .. |gitter| image:: https://img.shields.io/gitter/room/twisted/twisted.svg
  73. .. _gitter: https://gitter.im/twisted/twisted
  74. .. |ci| image:: https://github.com/twisted/twisted/actions/workflows/test.yaml/badge.svg
  75. .. _ci: https://github.com/twisted/twisted
  76. .. |rtd| image:: https://readthedocs.org/projects/twisted/badge/?version=latest&style=flat
  77. .. _rtd: https://docs.twistedmatrix.com