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

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

Built distribution (wheel)

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

Total release size: 185.2 kB

Release files / quart-0.18.4.tar.gz

Download URL quart-0.18.4.tar.gz
Size 85.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c1766f269cdb85daf9da67ba54170abf7839aca97304dcb4cd0778eabfb442c6
BLAKE2b-256 checksum
How to use checksums
c593be1bd58558bd2f026b75a147c814f5117617dbb9f1e1144849ed2852d6c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.8.2 Linux/5.4.0-1085-aws

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

Download URL quart-0.18.4-py3-none-any.whl
Size 100.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
578a466bcd8c58b947b384ca3517c2a2f3bfeec8f58f4ff5038d4506ffee6be7
BLAKE2b-256 checksum
How to use checksums
8f79ccd45c2374711b632647aad3dc27af4341c96a852049603493e33c288762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.8.2 Linux/5.4.0-1085-aws

Security for Quart 0.18.4

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