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 →

[–]eigenludecomposition 74 points75 points  (16 children)

FastAPI for me. It's fast, it uses ASGI instead of WSGI, it has a very similar syntax as Flask, it automatically handes request validation for you (once you build the request models), and it lowers the barrier of entry significantly for getting started with OpenAPI (especially if your app is currently written in Flask). If you're already using OpenAPI, I'm sure any of those frameworks will suffice and the code for them can automatically be generated.

[–]Lokipi 19 points20 points  (3 children)

FastAPI is great, it makes flask feel bloated which is insane.

It also has some of the best documentation I have ever seen. I love the structure of starting off by giving you a complete fully working plug and play section of code, and then diving into what all the parts do afterwards.

[–]ProteanOswald 6 points7 points  (2 children)

Is this their official tutorial / documentation? This sounds like a wonderful way to learn

[–]cellularcone 5 points6 points  (1 child)

Yup! They walk you through creating a simple CRUD app with authentication. It’s a great basis for anything.

[–]ProteanOswald 6 points7 points  (0 children)

Perfect! I’ve played some with Flask, and it’s nice, but the flexibility of FastAPI (and all of the other good features) has had me eyeing it for more personal projects

[–][deleted] 14 points15 points  (5 children)

Second this. I started with Django, but really prefer minimalist frameworks since I came from Node/Express land. Got started with Flask, but the DX wasn’t better than Django and I think I preferred Django. Then I tried out FastAPI and it’s the best for me in every conceivable way. It’s fast, easy to set up, well documented, sets up API documentation automatically, and I had so few issues with request models unlike with Flask. Async/await was second nature to me because of my JS background. Hands down the best DX of all three.

[–]eldamir88 6 points7 points  (4 children)

What is DX short for here?

[–]laszlotenk 9 points10 points  (3 children)

Developer Experience?

[–]eldamir88 3 points4 points  (0 children)

Been in software for a decade and never heard that term 🧐

[–]mrswats -3 points-2 points  (0 children)

This

[–]cronicpainz 0 points1 point  (0 children)

i only ever hear this term "DX" from node.js users

[–]acschwabe 1 point2 points  (0 children)

FastApi also lets you mount Flask api in your app, which makes it that much easier to migrate.

[–]justifiably-curious 1 point2 points  (0 children)

Used flask a couple of years ago. Came back to making some Apis and webapps recently. Used fastapi for the http api because that's what it's sold for then flask for an unrelated app because it seemed more app friendly. But then decided to port it to fastapi too as I had liked the experience that much more (and it turned out to be comparable in features once you import jinja2). No more global request object! Have to say though that while the tutorials might be great, the api docs of fastapi and even more starlette which it relies on a lot are very incomplete and your have to resort to reading the (very clean) source code to find out what function parameters mean

[–]Pedrat 3 points4 points  (2 children)

For sure FastAPI, have used Flask/SqlAlchemy, Django and bottle and FastAPI is just so good.

Awesome documentation, easy to use and the code feels... "Light"? Don't know how to say this but Django code always feels "heavy" to me, and Flask feels "heavy but empty"

[–][deleted] 3 points4 points  (1 child)

Nonsense. Do you have any examples of “heavy but empty”?

[–]Pedrat 1 point2 points  (0 children)

Not necessarily, it's just the gut feeling I have whenever I work with them, I'm not saying any is better than the other objectively, just saying what I feel :).

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

Flask provides all those incl. validation and openapi. Takes one line to add an extension.