Skip to main content

An asyncio web microframework with Flask's API

Project description

Quart is a microframework for Python based on Flask and asyncio.

Quickstart

from quart import Quart

app = Quart(__name__)

@app.route('/')
async def hello():
    return 'hello'

app.run()

API Compatibility with Flask

The Flask API can be described as consisting of the Flask public and private API 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 aims is to be mostly compatible with the Flask private API and without guarantees with the Werkzeug API.

Design decisions

The asyncio callback create_server approach is faster than the streaming start_server approach, and hence is used. This is based on benchmarking and the uvloop research.

Deploying

This isn’t ready for production. To deploy use gunicorn as follows gunicorn --worker-class quart.worker.GunicornWorker ... or gunicorn --worker-class quart.worker.GunicornUVLoopWorker ....

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.1.0.tar.gz (30.1 kB view hashes)

Uploaded Source

Built Distribution

Quart-0.1.0-py2.py3-none-any.whl (34.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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