Flask
Flask is a minimal Python framework for small APIs, webhooks and internal tools; I know it, though for new APIs I usually choose FastAPI.
How I use Flask
Its core is small, covering routes, requests and responses, and everything else comes from extensions as needed.
For a small job, like receiving payment notifications or a simple internal tool, Flask means little code and few dependencies, so the service is easy to understand and maintain. I can also take over an existing Flask project and extend it without a rewrite.
When working with Flask, I group routes into blueprints, keep settings and secret keys in environment variables, and validate input by hand or with a separate library, since Flask doesn't do it on its own. I don't have a portfolio project built on Flask, so I count it among the tools I use less often.
For new Python APIs I usually choose FastAPI, because it validates input and produces documentation on its own, and I package the service in Docker when it needs to run on a server.
Frequently asked questions about Flask
What is Flask?
Flask is a small Python framework for web apps and APIs that provides the basics, routes, requests and responses, while everything else comes from extensions. Thanks to its simplicity, it's often used for small services, webhooks, prototypes and internal tools.
Flask or FastAPI: what's the difference?
Flask is simple and long established, with many extensions, while FastAPI is newer, validates input through Python type hints and produces interactive docs on its own. FastAPI supports asynchronous code from the ground up, which suits APIs with many concurrent requests.
Do you build projects in Flask?
Rarely. I know Flask and can take over and extend an existing Flask project, but I don't have a portfolio project built on it. For new Python APIs I usually choose FastAPI.