Skip to main content

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


Project details


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Quart-0.3.0-py2.py3-none-any.whl (57.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file Quart-0.3.0.tar.gz.

File metadata

  • Download URL: Quart-0.3.0.tar.gz
  • Upload date:
  • Size: 56.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Quart-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6eb276d3e0f2e69dbf475de2fb438a55fb0214f075a76f9f57dbd535c900c522
MD5 5eb4ffe4a97699e7ee1c072071ea5934
BLAKE2b-256 3eaa4bf5d4db3e8821b9c003e219bdd0a66563499c2daa4e3a4e54b0eea82ce1

See more details on using hashes here.

File details

Details for the file Quart-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Quart-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1d98064aee94e77fca6095e44036e653ce0f3b8a824924e3d2a93dc6525c0c32
MD5 9d5ab867195ad3b3d953051b7bddb2b3
BLAKE2b-256 d2712b975130aa3f8333c03cdf41ead860f97a736b16e6f570ae581adc57f11d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page