What are the Most Important Frameworks for Python?
Universal, fast, easy to learn, open-source – Python is many things. The first version was released in 1991. It was initially created as a competitor of the ABC programming language, and successor of Perl for writing scripts. It came with exciting features which ABC didn’t have, such as exception handling.
And it was named after the cult British series Monty Python. Which is ironic, because recent growth of interest in this particular technology is almost as ludicrous as some of their sketches.
Why has the popularity of Python grown so much recently?
For a technology that’s been around for so long, it seems weird that last year was the first time that Python was included in the TIOBE index.
(the TIOBE index is an indicator of popularity for programming languages)
Once the IT world realised how powerful Python is for modern applications, the community around it became stronger. And corporate sponsors came along, who make it possible to push the boundaries of what Python can do.
There are many advantages:
- It is readable, the code syntax is not hard to understand
- Developers can use different programming paradigms
- There is a vast ecosystem of add-ons, extensions and libraries
- It’s relatively easy to maintain a Python codebase
- It’s easy to learn, making it usable even for those who don’t code full-time
- It’s mature, so it’s much less buggy than new technologies
- There are a lot of materials available to learn and master Python
Does Python have any major flaws when you compare it to other programming languages? The most common complaint is that it’s slower.
The thing is, you can use a screwdriver to drive a nail, but it will take a lot of time. Which is why you use a hammer. A tool that is designed specifically to drive nails.
Same thing with programming – Python can be slow if you use it for things that it’s not designed for. And the number of ways you can apply Python is growing thanks to frameworks.
Why are frameworks important?
There are 185,397 different tools to download from PyPI, the official library of Python packages. It’s a huge ecosystem full of possibilities.
PyPI lists 45 frameworks. Combined with all the different tools, this makes Python programming easier in different scenarios – web development, data science, or scripting and machine learning.
The most popular frameworks are built with web development in mind. No wonder – web is the most important platform today.
“A Web framework is a collection of packages or modules which allow developers to write Web applications or services without having to handle such low-level details as protocols, sockets or process/thread management.” – Python wiki
Frameworks enable programmers to speed up development. When budgets are limited and deadlines are pressing, cutting production time by even a few percent can be lifesaving.
And these are the conditions that most new products are built in. Using a framework, developers accept the paradigm of that framework. It offers ready-made templates for the basic parts of applications or websites, theoretically for the price of limited customization options.
In practice, with the amount of frameworks and extensions currently available, they are like a painter’s palette which includes all the colors in the visible spectrum. Depending on how you combine them, there are almost no limitations.
Game-changing Python frameworks
Python isn’t just about web development. One of the key drivers in it’s growth is actually TensorFlow.
It is an open-source, A-to-Z platform for creating machine learning solutions. It was built by Google’s smartest, and offers a “flexible ecosystem of tools, libraries and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML powered applications.” (source: TensorFlow)
This powerful tool set is used by developers at many major companies, like AirBnB, Coca-Cola, DeepMind, Inter, and Twitter. It enables developers and researchers to easily implement machine learning models, acquire data, train models and more – all on a large scale.
Because it’s created by Google, it has all the benefits of being backed by one of the most powerful tech companies in the world. It is constantly expanded, and new educational resources come out often.
Here’s another Python framework worth mentioning before we talk about the classic web dev ones : Matplotlib + Seaborn.
Matplotlib is a 2D plotting library for high-quality data visualizations. When you see graphs in scientific articles, there’s a chance they were plotted using this framework.
With a few lines of Python, Matplotlib generates various types of charts, histograms, or plots. Combined with Seaborn, which is a high-level interface based on Matplotlib, you have a powerful framework for creating highest-grade statistical graphics.
Let’s move on to web development frameworks for Python. They are sometimes separated into full-stack frameworks and microframeworks, although this might not be the best way to describe them. Like we sabefore – each framework (each programming language, each type of database, etc) is a tool designed with a specific purpose in mind.
The first one that comes to mind is Django. It has a broad community of experienced developers behind it, and is the most popular web dev framework for Python.
On the official website it is touted as the “Web framework for perfectionists (with deadlines)”. However this could apply to almost any framework, as they all pretty much serve the same purpose – to shorten development time.
Django is built for:
- Rapid development
- Clean, practical design
- High-performance web apps
- Automating as many processes as possible
- Scalability and security
With it’s popularity of use, Django can be a sort of benchmark for the usability of other frameworks.
Like TurboGears. Which is kind of like Django, but has several differences in design. There’s also Web2Py – which has an emphasis on backwards compatibility.
CherryPy is an oldie, but a goodie. It helps developers build a codebase without any additional fluff, very quickly. That’s because they can craft web applications with CherryPy almost the same way they would build an object-oriented Python application.
Bottle and Flask are two examples of microframeworks. Like the name suggests, they are perfect for situations with low budget, projects with a tiny scope, or for Python developers who want to build a quick prototype or simple web app.
And on the list goes. There are so many frameworks and extensions for Python, that you can build almost any type of web application with it. It only depends on how you mix them, how you code, and what other technologies you use.
(for more information about all web frameworks officially available for Python, visit the Python wiki)
Should a good Python developer know all frameworks?
No, definitely not. It might be useful if they have a general idea about them, to know what can be achieved with Python.
Great developers learn new things quickly. And regardless of their favorite programming language, they know that the best technology is the one that’s right for the project. It’s governed by project requirements, the type of specialists who are on the project team, the budget, and multiple other factors.
So choose wisely!
Sources not mentioned in the article: