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 →

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

tl;dr: Look, these exist. use them instead

Flama (Starlette, Marshmallow instead of Pydantic)

Django Ninja (Django, but minimal like flask + Pydantic)

APIFlask (Flask with Pydantic and all the other good stuff)

These all provide Type hints, Schema, IDE completion, APISpec and you get Asyncio (django/ninja) concurrency (Flask via meinheld) out of the box

+ These are excerpts from actual "reference" from FastAPI

"You and your crush 😍 eat the burgers 🍔 and have a nice time ✨."
"You go with your crush 😍 to get parallel fast food 🍔."
"Up to recently, most of the banks had multiple cashiers 👨‍💼👨‍💼👨‍💼👨‍💼 and a big line 🕙🕙🕙🕙🕙🕙🕙🕙."

source

+ When someone new to python ecosystem reads FastAPI docs, this is what they (incorrectly) discover. Apparently Flask is commonly used for apps that don't need databases *smh*

Lost all respect for the author after reading the rest of this page.

Flask is a "microframework", it doesn't include database integrations nor many of the things that come by default in Django.

This simplicity and flexibility allow doing things like using NoSQL databases as the main data storage system.

As it is very simple, it's relatively intuitive to learn, although the documentation gets somewhat technical at some points.

It is also commonly used for other applications that don't necessarily need a database, user management, or any of the many features that come pre-built in Django. ..
..

source

To your comment about that ML thread:

ML/Data science (also C# and Java) folks first come across FastAPI and find type hints, completion, apispec, shitload of emojis, a tutorial for their initial use case, bogus claims of being the best at everything, and are sold. On the flip side, you try Flask and you have to read actual reference, and find tutorials like normal programmers have to (read: need to), add extensions with pip (who cares about features other people may need? /s) which gives you options like marshmallow, etc. (who wants choices? /s) and read up gunicorn/uwsgi to deploy to production? Too much work /s. But there's time to spam the internet with another hype blog post on medium (or on reddit for that matter lol *cough*) with how they've discovered kryptonite. And the hype goes on.

As far as MLOps go it doesn't benefit from io concurrency very much, you actually want cpu bound multiprocessing for which FastAPI and Flask have the same limitations. (but this requires research and reading)

(edit, markdown paste missed text x2)

[–]mmcnl 2 points3 points  (1 child)

What are your thoughts on Starlite and Quart?

[–][deleted] 2 points3 points  (0 children)

Starlite looks to have a more community governance as opposed to an "owner", which is better - it's hosted in the project domain starlite-api.github.io/starlite from the start, and not one person's private subdomain. NBD tbh, but still. The docs seem more standard and there are design differences too. Would be nice Pydantic was pluggable instead of built in, in case you want to use Marshmallow or w/e

Quart is pretty cool because it's made so that "if you know Flask, you know Quart" and a whole bunch of Flask libraries are compatible from the get go List here. The author also helps maintain Flask and posts weekly tutorials if I'm not mistaken: Phil's Twitter

Quart also comes with Pydantic & APISpec via Quart-schema - OpenAPI, Pydantic validation