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
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
Built Distribution
Hashes for Quart-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4c0e116ac59edae466c77e68ea6bd89ef94f282e09abb797502a0f118bf69ee |
|
MD5 | e36b5726bf51983bcfac59db7cc14407 |
|
BLAKE2b-256 | a44aef7c2612a41db9da49d6a9aa33bf7995fd15554fd7d1291fd6bdb686683c |