A new print-css.rocks release is available with support for some new tools: Typeset.sh
We are building web applications since the mid-90s with Python.
Historically, we have used a bunch of related technologies and frameworks like
- Plone (of course, for CMS-ish applications)
All technologies and web frameworks had their time, their pros and cons (which I do not want to discuss here). Now, we are moving on to FastAPI for new web applications.
FastAPI is one of the most modern Python web frameworks for building applications and services. The primary focus of FastAPI is on micro-services or REST services, but you can of course plug-in your own template language for generating HTML and serving static content.
The reasons for picking up FastAPI are these:
- modern code base (based on the Starlette framework for Python)
- native support for asynchronous operations
- schemas for incoming and outgoing data can be defined using Python type annotations or using the pydantic package for complex data models
- validation of incoming and outgoing data according to their schema definition
- OpenAPI/Swagger integration out-of-the-box
- support for websockets
- good documentation and tutorials
- vibrant developer community
- fully tested
- optional support for GraphQL via graphene
Comparison with Flask? Flask had its time. It is still a good web framework, but you feel its age at all corners (still true with Flask 2). It is in general not a huge problem to move a web application from one framework to another (if it was written properly). I clearly like the built-in features like strong validation of incoming and outgoing data and the OpenAPI support which makes FastAPI the best available option for building micro-services.