Having trouble deciding between FastAPI and Flask for a small project #209674
🏷️ Discussion TypeQuestion BodyHey everyone, I'm working on a small Python project and I'm trying to decide whether I should use FastAPI or Flask for the backend. I've used Flask a little before, but I'm new to FastAPI. I like FastAPI's automatic docs and type hints, but I'm not sure if it's worth switching for a relatively small application. For people who have used both, what would you recommend? I'm mainly wondering about:
Would be great to hear what you guys normally use and why. Thanks! Guidelines
|
Replies: 1 comment
|
I've used both, and for a small project I'd probably stick with Flask if you already know it. It's simple and doesn't force you into too many decisions. Personally, if I was starting a new API project today, I'd probably go with FastAPI. If it's a simple web app or something I'm prototyping quickly, Flask is still a great choice. |
I've used both, and for a small project I'd probably stick with Flask if you already know it. It's simple and doesn't force you into too many decisions.
That said, I prefer FastAPI when I'm building something that's mainly an API. The automatic Swagger docs, type hints, Pydantic validation, and async support make things really convenient as the project grows.
For a very small app, I don't think the performance difference should be the deciding factor. I'd choose based more on what you're comfortable maintaining.
Personally, if I was starting a new API project today, I'd probably go with FastAPI. If it's a simple web app or something I'm prototyping quickly, Flask is still a great choice.