There's also a lot to love about Pydantic alone. For me, the best thing about Pydantic is that I get performant, strongly validated objects. When I create Python apps, I try to make sure functions receive and return Pydantic models. That way, if the function does not fail, I'm 100% sure about the data coming in and out. It also saves me from writing many if statements.
Those Pydantic objects can also be dynamically created without losing the data validation parts. By using it, I feel very "secure" about my types and objects, but keeping the simplicity of Python for my whole app.
here's a fully functional gist - https://gist.github.com/sandys/671b8b86ba913e6436d4cb22d04b1...
- Auto-generated docs and simple front end for your API allow you to examine and interact with your endpoints with essentially no added work or tools
- Feature rich and performant
- Tight pairing with Pydantic makes specifying and validating data models easy
Basically, FastAPI (and pydantic under the hood) just abstracts away a lot of the work you would need to do to build a relatively fully-featured API on your own, and adds quality of life features that one generally couldn’t justify building/setting up for themselves, especially for smaller projects. Plus, the docs are solid and it’s a pretty simple library to get started with. It’s very much been an “it just works” library for me in most cases.
Also, the doc is great and the maintainers are very helpful on github.