Crochet: use Twisted anywhere!
Crochet is an MIT-licensed library that makes it easier to use Twisted from regular blocking code. Some use cases include:
WSGI container_.
.. _WSGI container: https://twistedmatrix.com/documents/current/web/howto/web-in-60/wsgi.html
Crochet is maintained by Itamar Turner-Trauring.
Note: Crochet development is pretty slow these days because mostly it Just Works. PyPI shows about 30,000 downloads a month, so existing users seem happy: https://pypistats.org/packages/crochet
You can install Crochet by running::
$ pip install crochet
Downloads are available on
PyPI_.
Documentation can be found on
Read The Docs_.
Bugs and feature requests should be filed at the project
Github page_.
.. _Read the Docs: https://crochet.readthedocs.org/ .. _Github page: https://github.com/itamarst/crochet/ .. _PyPI: https://pypi.python.org/pypi/crochet
.. image:: https://travis-ci.org/itamarst/crochet.png?branch=master :target: http://travis-ci.org/itamarst/crochet :alt: Build Status
Crochet supports Python 2.7, 3.5, 3.6, 3.7, and 3.8 as well as PyPy and PyPy3.
Crochet provides the following basic APIs:
crochet.wait_fordecorator.
crochet.run_in_reactor) allows blocking code to run code "in the background" in the Twisted thread, with the ability to repeatedly check if it's done.
Crochet will do the following on your behalf in order to enable these APIs:
loggingframework. Unlike Twisted's built-in
loggingbridge, this includes support for blocking
Handlerinstances.