nonstopio
Published in

nonstopio

Python Web Frameworks — A Comparative Study

One of the challenges for a software developer has always been choosing the right framework/technology stack to adopt. It is important to cater to the right parameters when such a choice is to be made. A few factors that help gauge a framework are:

  1. Github stars & forks — Helps get an idea of adoption of the framework, and the community support
  2. Open issues — Helps identify how frequently the framework is debugged and maintained
  3. License type — Helps understand the implication of using the framework in order to build commercial or private applications
  4. Last commit — Helps identify how frequently the framework is updated. Note: This story is written on 04Aug’22
  5. Documentation — Helps with the reference material you would need to build applications using the framework
  6. Languages — Helps identify what languages are used to build the framework

Let’s look at Python’s top-10 frameworks used today to build web applications, and see how they fare on the above-mentioned parameters

1. Django

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design.

  • License Type: BSD 3-Clause
  • Open Issues: Not Available
  • Last Commit: 04Aug’22

2. Flask

Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications.

  • License Type: BSD 3-Clause
  • Open Issues: 2
  • Last Commit: 04Aug’22

3. FastAPI

FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints. It has a very high performance, on par with NodeJS and Go

  • License Type: MIT License
  • Open Issues: 1.1K
  • Last Commit: 21Jul’22

4. Tornado Web Server

Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user.

  • License Type: Apache-2.0 license
  • Open Issues: 199
  • Last Commit: 04Jul’22

5. Sanic

Sanic is a Python 3.7+ web server and web framework that’s written to go fast. It allows the usage of the async/await syntax added in Python 3.5, which makes your code non-blocking and speedy. Sanic is also ASGI compliant, so you can deploy it with an alternative ASGI webserver.

  • License Type: MIT License
  • Open Issues: 52
  • Last Commit: 2Aug’22

6. Dash

  • License Type: MIT License
  • Open Issues: 614
  • Last Commit: 2Aug’22

7. AIOHTTP (Async http client/server framework)

AIOHTTP is a python based web server that supports Client and HTTP Server. It supports Server WebSockets and Client WebSockets out-of-the-box without the Callback Hell, and the web-server has Middlewares, Signals, and pluggable routing.

  • License Type: Apache-2.0 license
  • Open Issues: 356
  • Last Commit: 04Aug’22

8. Falcon

Falcon is a minimalist ASGI/WSGI framework for building mission-critical REST APIs and microservices, with a focus on reliability, correctness, and performance at scale. When it comes to building HTTP APIs, other frameworks weigh you down with tons of dependencies and unnecessary abstractions. Falcon cuts to the chase with a clean design that embraces HTTP and the REST architectural style. Falcon apps work with any WSGI or ASGI server and run like a champ under CPython 3.5+ and PyPy 3.5+ (3.6+ required for ASGI).

  • License Type: Apache-2.0 license
  • Open Issues: 168
  • Last Commit: 28Jul’22

9. Bottle

Bottle is a fast, simple, and lightweight WSGI micro web framework for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.

  • License Type: MIT License
  • Open Issues: 234
  • Last Commit: 03Aug’22

10. Hug

Hug aims to make developing Python-driven APIs as simple as possible, but no simpler. As a result, it drastically simplifies Python API development. Hug is Python 3+ only and built upon Falcon’s high-performance HTTP library

  • License Type: MIT License
  • Open Issues: 161
  • Last Commit: 10Aug’20

— — —

References

  1. Django
  2. Flask
  3. FastAPI
  4. Tornado
  5. Sanic
  6. Dash
  7. AIOHTTP
  8. Falcon
  9. Bottle
  10. Hug

We are here to make the community stronger by sharing our knowledge. Follow us to stay updated on the latest and greatest in the web & mobile tech world.

--

--

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