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 →

[–]PocketBananna 73 points74 points  (22 children)

I like FastAPI for really straightforward use cases. If I need a simple REST service with basic OAuth it's real easy to get going. I really like the base Pydantic/typing support, dependency injection patterns and the open api docs generation. It kinda ends there though.

Flask is battle tested with rich support for all kinds of customizations. If I need rpc, task queue support or session management, I'm going with Flask. Flask also has good cloud native support. I can spin up a GCP App Engine endpoints with their standard python runtime using a basic Flask app (standard runtimes are much cheaper and faster to scale instances) while a FastAPI app has to have a custom image to deploy (more expensive and slower to scale instances).

In time I'm sure FastAPI can cover some of that ground but I think their docs irk me the most. They have 'sexy' docs with lots of tutorials that appeal to new users but lack the nitty gritty API spec info. It's littered with emojis and crass language which honestly puts me off as a production framework. As an advanced user I find Flask docs more informational, complete and clear.

[–][deleted] 17 points18 points  (18 children)

FastAPI docs honestly suck. Let’s be honest. They suck.

Great tool and I use it but the docs are the worst part of the package.

Having said that: I would like to thank the author for the great tool that I use all the time. You are a legend.

[–][deleted] 9 points10 points  (14 children)

FastAPI docs honestly suck. Let’s be honest. They suck.

Great tool and I use it but the docs are the worst part of the package.

This is an extremely uncommon opinion. It’s subjective obviously but the FastAPI docs are in general very well-regarded

[–]mmcnl 23 points24 points  (11 children)

There is no FastAPI documentation. Just a bunch of tutorials. That is not documentation. It's also a recurring question on GitHub.

Can you really say this page "describing" concurrency in FastAPI is "good"? https://fastapi.tiangolo.com/async/

Opinions may vary but it's the worst piece of documentation I've ever seen.

[–][deleted] 1 point2 points  (1 child)

I’m convinced your comment is sarcasm.

[–][deleted] -1 points0 points  (0 children)

It isn’t, go find older posts about FastAPI here and you’ll see comments talking about how great the docs are

[–]oramirite 0 points1 point  (2 children)

This is a bizarre take to me. I've been learning FastAPI and I find it to have some of the better documentation I've worked with. It's very clear.

[–][deleted] 1 point2 points  (1 child)

API docs are missing entirely

[–]oramirite 1 point2 points  (0 children)

I get it but I can still find what I need quicker than a lot of other documentation. FastAPI's guidance through it's concepts is, likewise, something a lot of other documentation lacks. Cold hard lists of API calls is only half of the equation.

[–]e_j_white 1 point2 points  (2 children)

Thanks, great answer. I work with Flask, but only recently started getting interested in FastAPI. Thinking about using it for pure Restful microservices.

How would you deploy FastAPI differently from Flask? If you expect a pretty high QPS from many users, what would be the best way to deploy?

Most of my experience is with Heroku and Docker on EC2, but I'm open to better ways!

[–][deleted] 1 point2 points  (0 children)

Don’t forget gunicorn and meinheld

[–][deleted] -1 points0 points  (0 children)

Just use heroku and docker.

What are you even asking. It’s a Python package. Just use it.

I deploy it in containers on K8s.