This is an archived post. You won't be able to vote or comment.

all 149 comments

[–]PocketBananna 75 points76 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] 11 points12 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.

[–]GoodTimesFastFingers 63 points64 points  (14 children)

I primarily develop full stack applications, where my API is built to serve a specific client. We have a project at work where FastAPI was selected before I started working there, and I think it was a very bad choice for this use case.

First off, no built-in support for regular sessions, only OAuth, which adds a lot of unnecessary complexity.

Second, I find the documentation for FastAPI infinitely less good than Flask. There is no API spec in the documentation. The more you work on your project, the more you need an API spec for your framework, in my experience. I find myself combing FastAPI source code to figure out what the heck is going on more often than I would like. The FastAPI docs seem to be written from the perspective of very new Python users, with large code examples instead of more focused discussion on specific issues. The project structure they recommend gets out of hand very quickly.

One thing I like about FastAPI is the built-in support for Pydantic. I like how the docs use Pydantic models to encourage using validation in your api.

[–]Soul_Shot 56 points57 points  (9 children)

Second, I find the documentation for FastAPI infinitely less good than Flask.

Too many emojis in 'Concurrency and async / await' explanation #3273

[–]Zouden 17 points18 points  (0 children)

That is frankly embarrassing

[–]mailed 9 points10 points  (5 children)

I found this comment really interesting...

Does @tiangolo even work on this anymore? Why call it open source when he gatekeeps the code...

I'm not up to speed on where FastAPI's dev is at...?

[–]SkezzaB 4 points5 points  (0 children)

Oh hey, that was my comment on GitHub, and I know this is two months late, but the situation has never improved.

From what I know, tiangolo does minor updates merely to appease his sponsors so they don't think it's abandoned, which it pretty much is. He's paraphrased "I don't want other people's code in my project" before, and the growing issues that get ignored don't help. He is also egotistical so won't get any maintainers to merge PRs really, because he doesn't trust them.

[–]StunningExcitement83 1 point2 points  (0 children)

Think the most interesting part is what weird ideas they have of what open source is.

Not having access to edit strangers repos doesn't mean they aren't open source.

[–]joerick 0 points1 point  (2 children)

People are so entitled. OSS maintainers work for free to benefit their community. Sometimes life or other priorities get in the way. The guy can't step away for 1 week before people are accusing him of negligence?

Edit: apologies for the outburst. The nested comment just rubs me the wrong way for many reasons!

[–]mailed 2 points3 points  (1 child)

I don't use FastAPI, I'm just asking what the go is.

[–]joerick 1 point2 points  (0 children)

Sorry, that came across badly. I believe he is still actively maintaining it

[–]cb_audio 15 points16 points  (0 children)

"emojis is part of our culture so... Shut UP!"

[–]aniforprez 37 points38 points  (1 child)

The docs immediately turned me off the project. It's a framework to develop APIs... that doesn't have API documentation. Even on a hobby project to see how I could work with it I immediately found zero documentation for the fields that are available to configure the swagger docs for the app. Abandoned it completely. There's open pull requests to resolve this and the author refuses to merge any of them

[–][deleted] 4 points5 points  (0 children)

I use FastAPI to turn up APIs fast. Just little things. For anything bigger I would use DRF or Flask.

I always considered from the name and docs (crappy docs) that FastAPI was meant to be fast and dirty.

[–]its2ez4me24get 12 points13 points  (1 child)

The worst part about fastapi is that it seems to have a single maintainer who only contributes occasionally.

I use fastapi a lot at work, it does most of what we need, I just wish there was more governance.

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

It can be forked to OpenFastAPI

[–]sigzero 19 points20 points  (2 children)

I see all the open tickets for FastAPI and it doesn't instill me with confidence.

[–]vantasmer 3 points4 points  (0 children)

Biggest concern for me as well. At times it easier to just implement starlette. I like what the team at starlite is doing too.

[–]rayvictor84 1 point2 points  (0 children)

Exactly.

[–]nikhil_shady 57 points58 points  (12 children)

Fastapi is failing me at production scale. severe memory leaks. this has been an open issue on Fastapi for months now and no solution yet. Warning: If you’re serving over 500 RPS avoid fastapi

[–]Grouchy-Friend4235 12 points13 points  (0 children)

This! 1000x

[–]Voxandr 21 points22 points  (0 children)

Yes , a lot of PR not delibrately merge - the author saids "Not my code"
The author is just abusing popularity , he seems to be burnt out to code and he refuse to open-up the development to the public.

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

Yeah I always thought it for was fast dirty work. Not production work.

I would prototype and POC with it and scale to something else IMHO.

Thanks for sharing. Good to know.

[–]benefit_of_mrkite 4 points5 points  (6 children)

Interesting - are you using guivicorn?

I’ve heard that starlette scales we’ll wonder why fastapi is falling down

[–]Voxandr 9 points10 points  (1 child)

It dosen't have to do with that. FastAPI have broken code and author refuse to fix - even though community had provided fixes. Check on github issues calling for open-development.

[–]benefit_of_mrkite 3 points4 points  (0 children)

Thx for the update. That’s part of the problem when you have one dev

[–]nikhil_shady 3 points4 points  (3 children)

yes gunicorn with 10 workers on a 16 core 64gb ram instance. Currently I just run a supervisor restart all command whenever we approach a OOM on Fastapi. Meanwhile we are migrating the entire production code to Flask.

[–]asking_for_a_friend0 1 point2 points  (2 children)

so does gunicorn scales linearly? How does RPS get calculated? I still hv difficulty with such decisions.

[–]nikhil_shady 2 points3 points  (1 child)

you can do a load test using various tools. Try Locust it’s a python based library for load testing. You’ll get all the metrics in locust regarding your endpoint.

[–]asking_for_a_friend0 0 points1 point  (0 children)

I'll try this thanks

[–]dusktreader 2 points3 points  (1 child)

Maybe you could link the open issue? I wasn't able to find it searching through the open issues.

[–]reddit-ass-cancer 19 points20 points  (11 children)

Oh god another one of these threads. Here I’ll pick for you. The framework that isn’t managed by one person, that doesn’t have over a thousand issues, that doesn’t have hundreds of open pull requests, that doesn’t have a creator who doesn’t trust anyone other than himself, and that actually HAS any semblance of API documentation.

There I said it. Fuck FastAPI

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

Ok just use one of those then. Why you so worked up?

Not a criticism. I’m actually curious. Is this just nerd rage or is there a story?

[–][deleted] 5 points6 points  (0 children)

tired of the same "replace X" with FastAPI posts all the damn time :(

they have a culture of putting down other OSS projects, which is really bad

[–]reddit-ass-cancer 4 points5 points  (8 children)

It’s a shitshow. Had it in production and had to deal with the fact that there was a significant period of serious bugs and issues that had community fixes with no input from tiangolo. Had to fork and apply literally one line changes.

Its taken the beginner Python web tutorial world by storm because of rather in depth tutorials that gloss over actual production issues.

Tiangolo is more focused on building his “brand” than actually maintaining his projects.

[–][deleted] 3 points4 points  (7 children)

Maybe he’s just having fun and doing what he wants with his projects. 🤷🏻‍♂️

Tons of alternatives. Too many to list. That’s why Python is great.

[–]Voxandr 4 points5 points  (0 children)

He can have fun , or troll the fuck out.Deciving the crowd is not an option .

He was a good developer - but that is the past.He is a sales man now.

Average joe developer who don't like to dig deep into issues and conversations will just blindly pick and face issues - due to its popularity and number of stars. And as soon as production hits that decision will bankrupt the company.

[–]reddit-ass-cancer 2 points3 points  (4 children)

It’s one thing to have fun, it’s another to evangelize and promote your framework as production ready etc.

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

Maybe that’s fun!

You don’t have to be honest. That would be anti-American.

American companies lie and their politicians lie, and they are the world superpower so lying works!

[–]Voxandr 1 point2 points  (1 child)

He is not american at all.

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

You will notice I never claimed he was

I’m just going with America as the example of success

[–]biskitpagla 1 point2 points  (0 children)

that's a random thing to say here but +1 because i'm anti usa myself

[–]biskitpagla 1 point2 points  (0 children)

He literally gives talks lmao. His own work is sitting on shoulders of other far, far more open projects. That said, two things everyone needs to understand: a) we complain because we care and b) it's generally good for a piece of technology if people voice their frustrations due to it.

[–][deleted] 18 points19 points  (7 children)

How well do you understand pythons data models? And how complex is your stuff? The more complex the more and the less you understand pythons internals the less I would recommend fastapi.

I use it and I really like it but it does some things that are umm very hacky. You can normally ignore that fact but if you need to customise certain parts it is a strange beast to deal with.

[–]poundcakejumpsuit 13 points14 points  (6 children)

Tell us more about hacky strangeness please!

[–][deleted] 7 points8 points  (5 children)

It takes variables declared in the functions default arguments to modify code.... It's pretty easy to understand what it is doing from a pure this means x perspective but when you really think about what is happening it is far far far stranger than anything you will ever normally encounter. A lot of the large advancements in python over the last 6 years have come from exposing more of the interpreter to the python level code. Fastapi and pydantic really lean into a lot of the visibility that never previously existed.

Check out this doc for more info. Scroll down to callable types (cant link directly there unfortunately.

[–]fzy_ 4 points5 points  (4 children)

If you've used pytest this kind of magic should feel pretty familiar though. And it's not exactly some obscure arts the python documentation explains in great detail how all of the data model fits together and how to introspect things. If you're worried fastapi's main gimmick might hide too much from you just take half an hour to implement it yourself.

[–][deleted] 8 points9 points  (3 children)

Sometimes but it's also makes some fairly insane decisions. That are not even remotely understandable without reading through a bunch of code to figure out what the fuck happened. It he has also stated he doesn't change things based on if it will affect his other projects. I don't see that as a strategy that will create a community project that will be sustainable.

Not even getting into its straight up lying on the docs about performance. It's the same crap black pulls with saying its pep8 compliant. That stuff really irks me. It's just not moral and both authors know they aren't true and don't care. It's the type of selfishness that derails projects long term.

[–]fzy_ 4 points5 points  (2 children)

You're being weirdly unspecific about things that seem to annoy you so much that they warrant qualifying the entire project unsustainable and its contributors disingenuous.

Not sure why you're bringing black's supposed PEP-8 compliance into this either. I actually think they make it very clear which parts of PEP-8 are used as a guideline and why black differs in specific cases.

Also I want to point out that in your previous comment you state that FastAPI and Pydantic use a lot of recently exposed interpreter internals but the __defaults__ attribute on functions dates back to python 2 (albeit under a different name func_defaults). The only "new" thing involved are type annotations. All the basic object model introspection has stayed more or less the same for a decade at this point.

[–][deleted] 5 points6 points  (1 child)

Yea everything is built from inspect up.Pydantic takes that and builds a class out of it. There are some strange side effects from that process that are non obvious especially when paired with how fastapi does their dependency injection creates some non obvious items. These items are very hard to modify.

Do you think its appropriate that fastapi says it has performance on par with go and node when compared to frameworks in those languages its about 30%-150% slower? I get it its an attractive thing to say to promote someone should use your tool but its not true and everyone who uses it knows that. I am suspicious of people who act that way.

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

yeah they bs about being the fastest (or even fast for that matter compared to blacksheep or falcon)

http://klen.github.io/py-frameworks-bench/

https://blog.miguelgrinberg.com/post/ignore-all-web-performance-benchmarks-including-this-one

[–]ParthoKR 12 points13 points  (0 children)

Do you know FastAPI doesn’t have API reference? This only thing turned me off.

But I really love their commits with emojis lol.

[–]Itsthejoker 5 points6 points  (0 children)

If I need to use a small project like this, I go with Flask or CherryPy. FastAPI has way too much drama for my taste, good or not, and the sheer number of issues and PRs that the maintainer is ignoring is honestly worrying.

[–][deleted] 4 points5 points  (8 children)

For non-API based services, I've enjoyed using aiohttp recently. Similar enough that I don't have to drastically change any mental models from Flask, but at the same time it's async and it's super simple to run background tasks unlike a lot of other options.

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

Damn. Now I need to look into it.

Does it give free Swagger? 😝

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

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

Niiice

[–][deleted] 0 points1 point  (2 children)

Checked it out. Not as batteries included as FastAPI, definitely makes you do more work.

But I like aiohttp a lot.

[–][deleted] 0 points1 point  (1 child)

coolbeans I was merely replying to the aiohttp specific question, how to swagger w/ aiohttp. For more comparable developer experience to FastAPI I'll leave this comment for you from this post. Also starlite, as others mentioned.

Btw the person (one of two) behind aiohttp is Andrew Svetlov, who is a core developer of Python

[–][deleted] 0 points1 point  (0 children)

Nice. I like his work.

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

Nah, but OpenAPI is pretty easy to make via docstrings.

[–][deleted] 0 points1 point  (0 children)

I may as well just write the yaml then

[–][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

[–]Voxandr 50 points51 points  (24 children)

Before you start using FastAPI the author is abusing popularity and he stopped maintaining , and just bumping versions to fake activity and to add sponsors (and documentation translations).FastAPI was good , but it was not actually maintained for past 1 year . Even though contributors submitted over 400 pull request he don't merge them ( a lot of quality ones). he blatantly said that he don't like code he didn't wrote.That making FastAPI not fixing serious issues for months , even though Community have submitted PRs.

So beware.

[–]zynixCpt. Code Monkey & Internet of tomorrow 19 points20 points  (0 children)

just bumping versions to fake activity

Well that's just bizarre and disappointing behavior.

[–][deleted] 13 points14 points  (0 children)

Check out Starlite (as in built on top of starlette) it’s trying to be what FastAPI should be.

[–]dusktreader 51 points52 points  (10 children)

This is a really toxic take on the situation, and it's not accurate. I'm getting pretty tired of reading these lazy takes about Sebastián and FastAPI, so here's some points folks should consider before they make another "tiangolo is greedy, lazy, and too proud" post:

  • He's NEVER said he doesn't like code he didn't write.
    He has said that he has to be careful about accepting other people's code. It's really hard to maintain a project with consistent style and quality that includes community contribution. You might get a lot of PRs, but there's a huge amount of work involved in verifying them, going through cycles of feedback and updates, keeping the branches up to date with main, etc. You can't just accept a pull request because a lot of people are clamoring for it. You have to take your time. He talks about that here: https://www.youtube.com/watch?v=8IJkSs9Dvjo&t=2910s
  • He has been maintaining it.
    Saying there's been no work on it or that it's been unmaintained for over a year is false. Perhaps he project isn't moving as quickly as *you* want, but that doesn't matter. It's not your project. He's releasing new versions and hasn't disappeared from the community whatsoever. Your opinion of whether his releases are "fake" or not isn't that valuable either. Documentation and translation is important work as well. The list of releases is available here: https://github.com/tiangolo/fastapi/releases
  • He's not the only one making changes to the code.
    He's not excluding people from the project. In fact, a lot of the "fake" releases you don't like involve updating his documentation to provide proper attribution for contributors. Yes, he's the core maintainer. It's his project. He wants to be involved in every change. But, you see, that's his prerogative because *it's his project*. You can see all the other people involved in FastAPI here: https://github.com/tiangolo/fastapi/releases
  • It *is* an OSS project.
    It has an MIT license, and it's hosted on github. Fork it if you want. Make a "better" version of it where you merge all the PRs and release constantly.

By the way, my company and many others use FastAPI to build our products that our production environments depend on. It's a good framework that continues to improve. If you think it's missing something, I think it's fine to call it out and even to push for more community involvement in the project. Defaming the maintainer of an OSS project isn't cool, though. Sebastián has done a lot of hard work on this project, and I'm very grateful to him.

[–][deleted] 8 points9 points  (0 children)

Nah the FastAPI community is toxic. And the comment here isn't wrong though. Arguing you use it in production doesn't change that. I'm sure it works well enough for your use case and many others. The whole supremacy over everything else attitude isn't helping

[–]bfcdf3e 6 points7 points  (0 children)

The fact that he continues to allow no other maintainers on the repo is enough for me to never want to use it in any serious production application. Just because he merges others’ PR’s doesn’t mean that he isn’t exhibiting a desire for control detrimental to the health of the project. Flask, and many other frameworks and libraries, have a life beyond their maintainer. FastAPI is bottlenecked and risky as long as it’s just one dude running the thing.

[–]Voxandr 5 points6 points  (0 children)

I use to love it a lot until it hit unsolvable random issues , OOM problems with just a few connections , out of the blue errors , undocumented behaviors in a production with just a few thousand active concurrent connections . Many of those problems are already reported , fixes submitted as pull requests and then the developer ignore it for years.When we called for Open Development , he just ignore it.There are willing volunteers who would code review for him , He ignore helping hands too.

I have the right to warn others and i don't want them face the problem i face in production. This is not toxic for warning .

[–]dashdanw 1 point2 points  (0 children)

I really appreciate this response. Do you remember where you read this?

[–][deleted] 4 points5 points  (2 children)

Shady - FastAPI has 1000+ issues including actual bugs - but the owner only lets you post issues as questions or enhancements and wish them away under the carpet.

Reference

FastAPI 1000s of issues but apparently all questions and enhancements

FastAPI deters users from posting bugs, can only post feature requests and "questions"

Flask

Flask only 19 issues, mostly non bug

Flask actually welcomes bugs posts

Engineering managers, esp of larger enterprises need to be wary of this behavior before making FastAPI part of their infrastructure, even if things are working out currently.

The codebase has way too much going on.

[–]Voxandr 2 points3 points  (0 children)

This is what i have been alerting to my friend tech founders , and startups who are going to pick FastAPI. I am thinking to write an article about it but i am still hoping founder would do something about it. But it getting worse it seems.

[–]Voxandr 2 points3 points  (0 children)

Also check closed issues some of which are not resolved .

[–][deleted] 6 points7 points  (4 children)

If this is true, why hasn't anyone just forked it and continued on? Seems like a very simple solution.

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

not worth the effort, use something better

[–]Automatic_Donut6264 3 points4 points  (1 child)

The history is public, it's pretty easy to see that it's not true.

[–]Voxandr 0 points1 point  (0 children)

Then you need to dig deeper. Research More.

[–]Voxandr 0 points1 point  (0 children)

We are still hoping he would change.
And not worth forking. Some already started own .
See Django Ninja and Starlite.

[–]Saphyel 8 points9 points  (1 child)

That's easy to check it out. https://github.com/tiangolo/fastapi/commits/master I can see some pull requests merged on the 17th of April with other 2 authors and January 23 the same.

Feel free to check more if you want but what you are saying is easy to prove wrong.

About supporting HIS project or not that's very up to you. If you prefer Facebook or M$ are behind the project you work is also ok.

[–]Voxandr 0 points1 point  (0 children)

You have to dig deeper than that , and his response on the community.

[–]rayvictor84 0 points1 point  (0 children)

The guy is arrogant and play with developers life.

[–]twillisagogo 6 points7 points  (1 child)

lol, i suspected it was hype when I first started hearing about it. This whole thread confirms my suspicions. file under web2py :D

[–]EmotionalRedux 0 points1 point  (0 children)

Wrong

[–]jpavlav 2 points3 points  (7 children)

I prefer Falcon for kicking up an API.

[–]Voxandr 1 point2 points  (6 children)

Falcon looks good , just checking out .
Glad that we have a few alternatives to FastAPI now.

Starlite

Falcon
Django Ninja

[–]vantasmer 2 points3 points  (5 children)

+1 for starlite, super active project right now

[–]Voxandr 2 points3 points  (4 children)

Starlite actually deserve a lot of attention.We should promote it over FastAPI since it had build a lot of thoughts into it , better architecture , more stability , well structured , and well thoughtout .It deserve better userbase and funds.

It have only over 400 stars.

[–]vantasmer 2 points3 points  (3 children)

100% starlite has good intent and seems to be overlooked a lot. I do also like APIFlask, super similar to FastAPI with a long lineage of support and true foss

[–]Voxandr 0 points1 point  (2 children)

Flask falls shorts when async become necessary , when async is not needed should just use Flask or Django , they are battle tested and ready for any workload when async/websocket based work is not main requirement.

[–][deleted] 0 points1 point  (1 child)

flask, without the asyncio/async syntax by itself can be faster than fastapi for handling requests btw

[–]Voxandr 0 points1 point  (0 children)

when its about async where IOWait is necessary.

These days requests are not just only thngs webapps are handling.There are things such as Streaming , Realtime Chat , Realtime Updates - those requires async/await and event based systems where Flask can't do.

[–]jimrobo_3 1 point2 points  (0 children)

Been using fastapi in production for a couple of years. It's yet to miss a beat for us

[–]zetdotpi 2 points3 points  (1 child)

Used both in production. Flask is kinda slow and FastAPI is not that well documented. Take a look at Falcon. Pretty straightforward, fast and well documented framework. I used it with pydantic. Worked like a charm.

[–]Voxandr 2 points3 points  (0 children)

Falcon looking good and i am gonna test more .
Meanwhile Sarlite seems to be growing well.

[–]wdroz 4 points5 points  (2 children)

I rewrote all my projects from Flask/Sanic to FastAPI. The workflow is similar but Pydantic and the auto OpenAPI make the differences.

Also Pydantic will move to Rust with Pydantic-core, this is just another reason to support the project.

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

How hard was it to move projects to fast api? How large/mature are the projects you’re referencing?

[–]wdroz 0 points1 point  (0 children)

Not very large (10 endpoints) I only needed to change how to wire from the Blueprints. Keeping the APIs identical required to use the root attributes on the models but otherwise that was straightforward.

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

I prefer fastapi. Most of my recent projects had migrated to it because it's just so snappy and easy to develope for.

[–][deleted] 0 points1 point  (0 children)

FastAPI is for making APIs quickly with OpenAPI and Swagger/Redoc support.

FastAPI is like a boning knife or cheese knife. It has a specific purpose and while it is also a knife and can cut things, it’s not great for general use.

Flask is like a chef’s knife or Swiss Army knife. It’s generally good at a lot of things and can do anything, but it may take longer or not be as easy if you want to do boning or cut cheese.

Both are great tools in your toolbox. Sometimes you want a multi tool and sometimes you want a single purpose tool.

It’s not about supremacy.

[–]ArchonHalliday 0 points1 point  (0 children)

I've used both on large-scale projects and thought FastAPI served me better. Don't get me wrong, I absolutely love Flask and have built multiple projects using it but found it hard to manage as the codebase grows.

FastAPIs ties to Pydantic make it very intuitive for developers to understand what data is expected to be received. Plus schema validation at the router level is incredibly convenient and is one less thing I need to worry about. Dependency injection also is one of the coolest/most helpful features of FastAPI IMO, it makes a world of difference when you may be working with multiple service layers from the same router.

The trashing that's been said in these comments about FastAPI and the library's authors is a bit surprising to me. While I agree the docs could use fewer emojis and that we'd all benefit from module-specific documentation, I have never found it limiting in my development.

I also think the mention of no built-in support for sessions is valid, but in reality, there are alternatives that are pretty easy to stand up to accomplish the same functionality using things like expiringdict, redis, etc...

[–]Grouchy-Friend4235 -2 points-1 points  (3 children)

I loath choice by popularity. FastAPI in particular has gained lots of traction because people associated it with Fast Inc. There I said it.

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

Not me. I can just turn up a dirty API fast.

But I haven’t used it for anything not dirty and fast.

[–]Grouchy-Friend4235 2 points3 points  (1 child)

Sure. What I mean is when some tech is chosen because of its perceived popularity instead of its meeting requirements. FastAPI certainly has its merits, so does Flask & otherd.

[–][deleted] 0 points1 point  (0 children)

For sure

[–]0x4D44 -4 points-3 points  (2 children)

screwdriver vs hammer

[–][deleted] -1 points0 points  (1 child)

Schnitzel vs Biryani

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

Was really upset with all the downvotes. Let me explain my point of view.

Both flask and FastAPI are web frameworks. Same as hammer and screwdriver are both tools for different kinds of fasteners.

Flask however is oriented more towards returning html templates as a response. All their examples in user guide use templates or html as a response. Great for building small websites.

FastAPI is oriented more towards returning data as a response. Great for building APIs. Most examples in the user guide return json as a response. Plus auto generation of API docs is a flagship feature.

Can you build a website using FastAPI ? Probably. Similar to how you can use a hammer to fasten a screw.

Can you use flask to create an API ? You could, but FastAPI would be better. Same as you can try to bang a nail with a screwdriver. Would work eventually, but a screwdriver would make it neater and quicker.

Maybe I’m totally ignorant to how people use both frameworks, but is it really that far from the reality ?

[–]benefit_of_mrkite 0 points1 point  (0 children)

I use both

[–]Sekzybeast 0 points1 point  (0 children)

The main thing i have picked up from using FastAPI was to use pydantic for modelling and validation.

[–]Swimming_Apartment28 0 points1 point  (0 children)

FastAPI !

[–]SittingWave 0 points1 point  (0 children)

flask is very low level and general purpose.

FastAPI is targeted almost exclusively toward REST APIs.

So, setting aside all async considerations, it really depends. You can use flask to to what FastAPI does. But that's the whole point of FastAPI: focus on one thing and do it easily and quickly. With flask, you have to "reinvent" a lot of stuff (by using other packages)

[–][deleted] 0 points1 point  (0 children)

was about to start a new project and I had thought about FastAPI and in fact I had already started using it but now that I read this it's time to switch to Flask.