4 ms·
Flask is missing... pydantic, dependency injection, openapi, swagger, real async.
by odie5533 1y ago
Flask is missing... pydantic, dependency injection, openapi, swagger, real async.
- nop_slide 1y agohttps://github.com/pallets-eco/flask-pydantic https://github.com/pallets-eco/flask-pydantic https://luolingchun.github.io/flask-openapi3/v4.x/ https://luolingchun.github.io/flask-openapi3/v4.x/ > dependency injection While nice I never found this to be a critical deciding factor of using a technology. > real async If you really want it there is Quart which is real async https://github.com/pallets/quart https://github.com/pallets/quart I'm not a huge async fan in python anymore so not it's not a huge issue for me. But there are definitely options for Flask if you want to use async.
- odie5533 1y agoflask-openapi3 looks good but has only 246 stars. Would be worried using it in production. flask-pydantic has no openapi tie-in. Oh look, there's me bumping the openapi request that's been an issue since 2020: https://github.com/pallets-eco/flask-pydantic/issues/17 https://github.com/pallets-eco/flask-pydantic/issues/17 which has an open PR since 2022. It's possible between Quart and svcs (for DI) and some Pydantic/Marshmallow/OpenAPI extension you might be able to mimic what FastAPI does. But I'd just use FastAPI. I use async too. It's a lot easier to scale in my opinion. Do none of these pieces matter to you? Like do you not do any data validation or care about OpenAPI?
- nop_slide 1y agoAt $JOB we're using both flask-pydantic and flask-openapi via those libraries and they are serving us just fine. But yes async does not matter to me.
- wiseowise 1y agoOf course you can assemble FastAPI scrim scratch, that’s not the point. The selling point is everything integrated, like Django.
- Exoristos 1y agoSo nothing of importance.
- odie5533 1y agoWhat do you do for data validation?
- callamdelaney 1y agoDependency injection in fastapi honestly feels like a horrible afterthought. Flask's g is much easier to reason about, and 99% of projects don't need the 'performance improvements' of async.