https://github.com/pgjones/quart-trio
Quart-Trio is an extension for Quart to support the Trio event loop.
https://github.com/pgjones/quart-trio
quart
Last synced: about 1 year ago
JSON representation
Quart-Trio is an extension for Quart to support the Trio event loop.
- Host: GitHub
- URL: https://github.com/pgjones/quart-trio
- Owner: pgjones
- License: mit
- Created: 2022-04-10T14:27:36.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-09T21:04:48.000Z (over 1 year ago)
- Last Synced: 2025-03-31T17:18:42.559Z (about 1 year ago)
- Topics: quart
- Language: Python
- Homepage:
- Size: 86.9 KB
- Stars: 23
- Watchers: 2
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
Quart-Trio
==========
|Build Status| |docs| |pypi| |python| |license|
Quart-Trio is an extension for `Quart
`__ to support the `Trio
`_ event loop. This is an
alternative to using the asyncio event loop present in the Python
standard library and supported by default in Quart.
Quickstart
----------
QuartTrio can be installed via `pip
`_,
.. code-block:: console
$ pip install quart-trio
and requires Python 3.8 or higher (see `python version support
`_
for reasoning).
A minimal Quart example is,
.. code-block:: python
from quart import websocket
from quart_trio import QuartTrio
app = QuartTrio(__name__)
@app.route('/')
async def hello():
return 'hello'
@app.websocket('/ws')
async def ws():
while True:
await websocket.send('hello')
app.run()
if the above is in a file called ``app.py`` it can be run as,
.. code-block:: console
$ python app.py
To deploy in a production setting see the `deployment
`_
documentation.
Contributing
------------
Quart-Trio is developed on `GitHub
`_. You are very welcome to
open `issues `_ or
propose `merge requests
`_.
Testing
~~~~~~~
The best way to test Quart-Trio is with Tox,
.. code-block:: console
$ pip install tox
$ tox
this will check the code style and run the tests.
Help
----
The `Quart-Trio `__ and `Quart
`__ documentation are the best
places to start, after that try searching `stack overflow
`_, if you still
can't find an answer please `open an issue
`_.
.. |Build Status| image:: https://github.com/pgjones/quart-trio/actions/workflows/ci.yml/badge.svg
:target: https://github.com/pgjones/quart-trio/commits/main
.. |docs| image:: https://img.shields.io/badge/docs-passing-brightgreen.svg
:target: https://quart-trio.readthedocs.io
.. |pypi| image:: https://img.shields.io/pypi/v/quart-trio.svg
:target: https://pypi.python.org/pypi/Quart-Trio/
.. |python| image:: https://img.shields.io/pypi/pyversions/quart-trio.svg
:target: https://pypi.python.org/pypi/Quart-Trio/
.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://github.com/pgjones/quart-trio/blob/main/LICENSE