Registry / web-framework / quart
library0.22.0pypypi✓ verified 26d ago

Quart is a Python ASGI (Asynchronous Server Gateway Interface) web microframework, designed to be fully API compatible with Flask while providing native asynchronous functionality. It supports HTTP/1.1, HTTP/2, and WebSockets, making it suitable for modern, high-performance web applications. Currently at version 0.20.0, Quart maintains a regular release cadence with a focus on bug fixes and new features.

pip install quart
INSTALL
IMPORT
SIG · QUART
Q
quart
web-frameworkpythonv0.22.0
Install
3.0s avg
Import
1480ms
Disk
25MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.20.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 1.511s · 26.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.0s · import 1.450s · 27MB
25MB installed
● package 25MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Quart
from quart import Quart
from flask import Flask
Quart's API is Flask-compatible, but imports must be from `quart`.
request
from quart import request
from flask import request
Use `quart.request` for the global request object within Quart applications.

A minimal 'Hello, World!' Quart application. Routes are defined using `@app.route` decorators on `async def` functions, returning a string. For production, it's recommended to run with an ASGI server like Hypercorn (e.g., `hypercorn app:app`).

from quart import Quart app = Quart(__name__) @app.route('/') async def hello(): return 'Hello, Quart!' # To run this, save as app.py and execute: hypercorn app:app
quart --version
Debug
Known issues
breakingQuart 0.20.0 dropped support for Python 3.8. Users on Python 3.8 or earlier must upgrade their Python version to 3.9+ before upgrading to Quart 0.20.0.
fix
Upgrade Python to version 3.9 or higher.
affects: >=0.20.0
gotchaMigrating from Flask requires explicitly making view functions `async def` and using `await` for asynchronous operations. While Quart maintains Flask's API, its ASGI foundation mandates `async`/`await` for non-blocking I/O within view functions. Many Flask extensions may not work directly without `quart_flask_patch` or an async-compatible alternative.
fix
Rewrite view functions to be `async def` and ensure all I/O bound operations within them use `await`. For extensions, check for `quart_` prefixed versions or use `quart_flask_patch` for compatibility where possible.
affects: All versions
gotchaThe `app.run()` method is for development purposes only and should not be used in production. For production deployments, an ASGI server like Hypercorn (which is a dependency) or Uvicorn must be used to serve the Quart application.
fix
Run your application with an ASGI server, e.g., `hypercorn app:app` or `uvicorn app:app` (if Uvicorn is installed).
affects: All versions
gotchaCalling synchronous/blocking I/O operations (e.g., traditional database drivers, `requests` library) directly within an `async def` view function without `await` or offloading them to a thread pool will block the event loop, severely degrading performance. Quart's async nature benefits from truly asynchronous libraries.
fix
Use async-native libraries for database access (e.g., `asyncpg`, `motor`, `databases`), HTTP requests (`httpx`), and file operations (`aiofiles`). Alternatively, offload blocking calls to a thread pool (e.g., `loop.run_in_executor`).
affects: All versions
gotchaFor features like caching, specific database integrations, or WebSocket functionality, additional libraries are often required beyond the basic `quart` install. For example, `quart-session` for sessions, `redis` or `python-memcached` for caching backends, or an async ORM.
fix
Consult Quart's documentation or community resources to identify and install the correct async-compatible libraries for desired functionality (e.g., `pip install quart-session redis`).
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'quart'
The Quart library is not installed in the current Python environment.
fix
pip install quart
Error: Could not locate a Quart application.
The `quart run` command could not find an application instance, either because the `QUART_APP` environment variable is not set, or the app object is not named `app` in a common module like `app.py` or `wsgi.py`.
fix
Ensure your application object is named `app` (e.g., `app = Quart(__name__)`) in a file like `app.py` in your current directory, or set the `QUART_APP` environment variable: `export QUART_APP=your_module:your_app_instance`
SyntaxError: 'await' outside async function
Attempting to use the `await` keyword within a function that is not defined as an asynchronous function using `async def`. This is a common mistake when migrating synchronous Flask code to Quart.
fix
Define the function as an asynchronous function using `async def`: `async def my_view(): await some_async_call()`
TypeError: 'coroutine' object is not subscriptable
This error often occurs in Quart when an awaitable attribute like `request.json` or `request.form` is accessed without `await`, and the resulting coroutine object is then treated directly as a dictionary or list.
fix
Always `await` asynchronous request attributes before accessing their content: `data = await request.get_json()` or `data = await request.json`
Upgrade
Version history
0.22.0latest on PyPI · released Aug 19, 2026
Audit
Dependencies
aiofilesrequiredTo load files in an asyncio compatible manner.
blinkerrequiredTo manage signals.
clickrequiredTo manage command-line arguments.
hypercornrequiredRecommended ASGI server for development and production.
itsdangerousrequiredFor signing secure cookies.
jinja2requiredFor template rendering.
markupsaferequiredFor markup rendering.
werkzeugrequiredAs the basis of many Quart classes.
python-dotenvoptionalSupport for loading environment variables from .env files.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
quart — pip install quart · libregistry