Skip to main content

Quart

Quart logo

Build Status docs pypi python license chat

Quart is an async Python web microframework. Using Quart you can,

  • render and serve HTML templates,

  • write (RESTful) JSON APIs,

  • serve WebSockets,

  • stream request and response data,

  • do pretty much anything over the HTTP or WebSocket protocols.

Quickstart

Quart can be installed via pip,

$ pip install quart

and requires Python 3.8.0 or higher (see python version support for reasoning).

A minimal Quart example is,

from quart import Quart, render_template, websocket

app = Quart(__name__)

@app.route("/")
async def hello():
    return await render_template("index.html")

@app.route("/api")
async def json():
    return {"hello": "world"}

@app.websocket("/ws")
async def ws():
    while True:
        await websocket.send("hello")
        await websocket.send_json({"hello": "world"})

if __name__ == "__main__":
    app.run()

if the above is in a file called app.py it can be run as,

$ python app.py

To deploy this app in a production setting see the deployment documentation.

Contributing

Quart is developed on GitHub. If you come across an issue, or have a feature request please open an issue. If you want to contribute a fix or the feature-implementation please do (typo fixes welcome), by proposing a merge request.

Testing

The best way to test Quart is with Tox,

$ pip install tox
$ tox

this will check the code style and run the tests.

Help

The Quart documentation or cheatsheet are the best places to start, after that try searching stack overflow or ask for help on discord. If you still can’t find an answer please open an issue.

Relationship with Flask

Quart is an asyncio reimplementation of the popular Flask microframework API. This means that if you understand Flask you understand Quart.

Like Flask, Quart has an ecosystem of extensions for more specific needs. In addition a number of the Flask extensions work with Quart.

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 for more help.

Metadata

Release files for Quart 0.19.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Quart 0.19.1
File Size Uploaded Provenance Actions
quart-0.19.1.tar.gz 65.1 kB Without provenance Details for quart-0.19.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Quart 0.19.1
File Interpreter ABI Platform Actions
quart-0.19.1-py3-none-any.whl Python 3 none any Details for quart-0.19.1-py3-none-any.whl

Total release size: 142.8 kB

Release files / quart-0.19.1.tar.gz

Download URL quart-0.19.1.tar.gz
Size 65.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6ba8c653bdb8a042937e6c35631ed24625db9e04c77d35b2c40258d1e4ea21ae
BLAKE2b-256 checksum
How to use checksums
31be6161c6932e30aaa390e48bfa06445f2a2a4e063643bb945c07007ec1512e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / quart-0.19.1-py3-none-any.whl

Download URL quart-0.19.1-py3-none-any.whl
Size 77.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3c5ebbb6f6c932f9ffa53ebb67039bb419e08f40172dad81a4bd7b82e11ba0c
BLAKE2b-256 checksum
How to use checksums
c936481af69e2cbe21bffbefa180cc278e34b5a9b49659d6266f907cfc7b9a51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Security for Quart 0.19.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.19.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page