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.7

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.7
File Size Uploaded Provenance Actions
quart-0.19.7.tar.gz 65.6 kB Without provenance Details for quart-0.19.7.tar.gz

Built distribution (wheel)

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

Total release size: 143.9 kB

Release files / quart-0.19.7.tar.gz

Download URL quart-0.19.7.tar.gz
Size 65.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6edb81c19346a63cac6bcc7cea9fbb312fe19db2977c6e98d28c931f1d354fad
BLAKE2b-256 checksum
How to use checksums
7cd36d82ed0991d93edd9f87a812b98f641e04c8c121e7ee7007f9eae5f03be6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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

Download URL quart-0.19.7-py3-none-any.whl
Size 78.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c605e4f1378c3ba12bd39311735f9245d128c1149631a561f5b976596423088
BLAKE2b-256 checksum
How to use checksums
9c34f78942f50d5d1f9d94ef2be00242cd887e64099ce0eb0c1dab66218bea78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Security for Quart 0.19.7

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.7 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