Quart the Asyncio web framework

Node.js has changed the JS world forever, So as a python developer at that time I thought hey why can’t we bring that architecture to python (we already had generators ), even though it was a bit late the asyncio feature was released on the 3.4 version.

So what does it do, compare to JS async/await statement

Let us see an example of how asyncio works in python

ok, so what happens when we run the program

Now we are seeing something that we have only seen in a browser console. This is now officially supported in python 😌

So the heading was about Quart?

Let’s get down with what Quart is, to be frank, its an exact fork of Flask the minimal web framework for python, for the past few months I have been working on a project to do some System-Level I/O stuff,

It has proved its worth on Event-Driven systems such and the benchmark was so promising and the performance is notable.

3X faster than flask to be exact with minimal response time’s (Tested with PostgreSQL)

The only thing to keep in mind is that it can’t do heavy computation similar to JS. But could make a hell of an HTTP server and has build-in support for

  • HTTP/1.1 requests streaming.
  • Websockets.
  • HTTP/2 server push.
  • HTTP/3 (I think it's already in work)

If you plan to migrate your old flask codebase to Quart it’s easy as pie, See the Code for yourself.

So guys why not give it a trie, plus don't try to block the event loop 😝

Visit https://gitlab.com/pgjones/quart for more info

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store