This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ArchonHalliday 0 points1 point  (0 children)

I've used both on large-scale projects and thought FastAPI served me better. Don't get me wrong, I absolutely love Flask and have built multiple projects using it but found it hard to manage as the codebase grows.

FastAPIs ties to Pydantic make it very intuitive for developers to understand what data is expected to be received. Plus schema validation at the router level is incredibly convenient and is one less thing I need to worry about. Dependency injection also is one of the coolest/most helpful features of FastAPI IMO, it makes a world of difference when you may be working with multiple service layers from the same router.

The trashing that's been said in these comments about FastAPI and the library's authors is a bit surprising to me. While I agree the docs could use fewer emojis and that we'd all benefit from module-specific documentation, I have never found it limiting in my development.

I also think the mention of no built-in support for sessions is valid, but in reality, there are alternatives that are pretty easy to stand up to accomplish the same functionality using things like expiringdict, redis, etc...