A Python asyncio web microframework with the same API as Flask
Project description
Quart
=====
|Build Status| |docs| |pypi|
Quart is a Python asyncio web microframework with the same API as
`Flask <https://github.com/pallets/flask>`_. Quart should provide a
very minimal step to use `Asyncio
<https://docs.python.org/3/library/asyncio.html>`_ in a Flask app.
See the `docs <https://pgjones.gitlab.io/quart/>`_.
Quart accepts requests and serves responses via HTTP/1.1 or
HTTP/2. The HTTP/2 support includes the ability to server push.
Quickstart
----------
Quart can be installed via `pip
<https://docs.python.org/3/installing/index.html>`_ ``pip install quart``
and requires Python 3.6+. A minimal Quart example would be
.. code-block:: python
from quart import Quart
app = Quart(__name__)
@app.route('/')
async def hello():
return 'hello'
app.run()
if the above is in a file called ``app.py`` can be run via ``python app.py``.
To deploy in a production setting see the `docs
<https://pgjones.gitlab.io/quart/deployment.html>`_.
API Compatibility with Flask
----------------------------
The Flask API can be described as consisting of the Flask public and
private APIs and Werkzeug upon which Flask is based. Quart is designed
to be fully compatible with the Flask public API (aside from async and
await keywords). Thereafter the aim is to be mostly compatible with
the Flask private API and to provide no guarantees about the Werkzeug
API.
Migrating from Flask
~~~~~~~~~~~~~~~~~~~~
It should be possible to migrate to Quart from Flask by a find and
replace of ``flask`` to ``quart`` and then adding ``async`` and
``await`` keywords. See the `docs
<https://pgjones.gitlab.io/quart/flask_migration.html>`_ for full
details.
.. |Build Status| image:: https://gitlab.com/pgjones/quart/badges/master/build.svg
:target: https://gitlab.com/pgjones/quart/commits/master
.. |docs| image:: https://readthedocs.org/projects/docs/badge/?version=latest
:target: https://pgjones.gitlab.io/quart/
.. |pypi| image:: https://badge.fury.io/py/quart.svg
:target: https://badge.fury.io/py/quart
=====
|Build Status| |docs| |pypi|
Quart is a Python asyncio web microframework with the same API as
`Flask <https://github.com/pallets/flask>`_. Quart should provide a
very minimal step to use `Asyncio
<https://docs.python.org/3/library/asyncio.html>`_ in a Flask app.
See the `docs <https://pgjones.gitlab.io/quart/>`_.
Quart accepts requests and serves responses via HTTP/1.1 or
HTTP/2. The HTTP/2 support includes the ability to server push.
Quickstart
----------
Quart can be installed via `pip
<https://docs.python.org/3/installing/index.html>`_ ``pip install quart``
and requires Python 3.6+. A minimal Quart example would be
.. code-block:: python
from quart import Quart
app = Quart(__name__)
@app.route('/')
async def hello():
return 'hello'
app.run()
if the above is in a file called ``app.py`` can be run via ``python app.py``.
To deploy in a production setting see the `docs
<https://pgjones.gitlab.io/quart/deployment.html>`_.
API Compatibility with Flask
----------------------------
The Flask API can be described as consisting of the Flask public and
private APIs and Werkzeug upon which Flask is based. Quart is designed
to be fully compatible with the Flask public API (aside from async and
await keywords). Thereafter the aim is to be mostly compatible with
the Flask private API and to provide no guarantees about the Werkzeug
API.
Migrating from Flask
~~~~~~~~~~~~~~~~~~~~
It should be possible to migrate to Quart from Flask by a find and
replace of ``flask`` to ``quart`` and then adding ``async`` and
``await`` keywords. See the `docs
<https://pgjones.gitlab.io/quart/flask_migration.html>`_ for full
details.
.. |Build Status| image:: https://gitlab.com/pgjones/quart/badges/master/build.svg
:target: https://gitlab.com/pgjones/quart/commits/master
.. |docs| image:: https://readthedocs.org/projects/docs/badge/?version=latest
:target: https://pgjones.gitlab.io/quart/
.. |pypi| image:: https://badge.fury.io/py/quart.svg
:target: https://badge.fury.io/py/quart
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Quart-0.3.0.tar.gz
(56.2 kB
view hashes)
Built Distribution
Quart-0.3.0-py2.py3-none-any.whl
(57.7 kB
view hashes)
Close
Hashes for Quart-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d98064aee94e77fca6095e44036e653ce0f3b8a824924e3d2a93dc6525c0c32 |
|
MD5 | 9d5ab867195ad3b3d953051b7bddb2b3 |
|
BLAKE2b-256 | d2712b975130aa3f8333c03cdf41ead860f97a736b16e6f570ae581adc57f11d |