Quart

Quart is an async Python web framework based on Flask

Overview

Quart is an async version of Flask that maintains Flask compatibility while adding async support

Key Features

Flask Compatibility

Quart has the same API as Flask

from quart import Quart

app = Quart(__name__)

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

app.run()

Async Support

Full async/await support

@app.route('/data')
async def get_data():
    data = await fetch_data()
    return jsonify(data)

WebSocket Support

@app.websocket('/ws')
async def ws():
    while True:
        data = await websocket.receive()
        await websocket.send(f"Echo: {data}")

Installation

pip install quart

Common Use Cases

Advantages

Disadvantages

Official Documentation

Quart Documentation

Version Information