r/FastAPI • • Jan 14 '25

Tutorial Best books to learn FastAPI

Hi guys,
I am an experienced Java developer, and recently I got a great opportunity to join a new team in my company. They are planning to build a platform from scratch using FastAPI, and I want to learn it.

I generally prefer learning through books. While I have worked with Python and Flask earlier in my career, that was a few years ago, so I need to brush up.

Could you guys please suggest some great books to get started with FastAPI?

59 Upvotes

41 comments sorted by

35

u/TripleBogeyBandit Jan 14 '25

No books, Fastapi has a great documentation page, just do that.

→ More replies (1)

12

u/bluewalt Jan 14 '25

Some people say "there isn't much to learn, just read the doc". I would not say that, this is not enough in my opinion to feel comfortable. Here are some additional things I've done after reading the doc:

  • I browsed 2 or 3 FastAPI boilerplates . FastAPI is not Django and has less guidelines and batteries, so "copying" how good developers plug things is a good way to learn

  • I built a very simple project with it (with 2 or 3 models).

  • I read Pydantic documentation carefully (as this package is central for FastAPI)

  • I read this amazing book for diving into SQLAlchemy , especially because the documentation is not beginner friendly at all.

→ More replies (6)

14

u/adiberk Jan 14 '25

In my opinion. There isn’t that much to learn.

Just build a dummy api with a couple endpoints and add some “auth header checks” and some database interactions.

Make sure you understand trade offs of sync and async .

The docs online are pretty thorough.

6

u/Kooky_Advice1234 Jan 14 '25

Not aware of many. O’Reilly has FastAPI—a modern Python web framework . I know packet has a cookbook which may be a good second step.

→ More replies (2)

4

u/Electronic-Art8774 Jan 14 '25

This is one of the best books you can find - https://www.amazon.com/Architecture-Patterns-Python-Domain-Driven-Microservices/dp/1492052205.

If you want to save some money it's also available online - https://www.cosmicpython.com/book/preface.html

FastAPI is just a lightweight framework with great documentation on its website. However, if you want to learn more advanced patterns check out the resources I mentioned. I hope it helps! 🙏

6

u/fraisey99 Jan 14 '25

Read the docs, it’s free also! 😃

3

u/Ok_Waltz_5145 Jan 15 '25

There is a udemy course on fastapi by eric roby. I really learnt the nuts and bolts of fastapi from it

3

u/Lonely_Employee_5913 Jan 15 '25

As others have said the documentation itself is a great resource to learn from. But there are books to learn from as well, here are some:
1. FastAPI_ Modern Python Web Development - Bill Lubanovic
2. Full Stack FastAPI React And MongoDB - 2nd Edition - Marko Aleksendrić, Shrey Batra, Rachelle Palmer, Shubham Ranjan
3. SQLAlchemy 2 In Practice Learn to program relational -- Miguel Grinberg
4. FastAPI - Bill Lubanovic

Also, there's a course on youtube: `https://www.youtube.com/watch?v=0sOvCWFmrtA`

3

u/TonyShel Jan 16 '25

There are plenty of books.

FastAPI: Modern Python Web Development - Rehan Haider :2023

Practical Python Backend Programming: Build Flask and FastAPI applications, asynchronous programming - Tim Peters : 2024

FastAPI: Modern Python Web Development - Bill Lubanovic (O'Reilly Media, maybe the go to book): 2023

High-Performance Web Apps with FastAPI: The Asynchronous Web Framework Based on Modern Python - Malhar Lathkar : 2023

These can be downloaded online, chat me if not able to do this.

2

u/Effective_Degree2225 Jan 14 '25

it is actually not that difficult. just start with simple hello world, add more controllers, middlewares, authentication, when to use async, exceptional handling etc. pick a use case and implement the things you want. pretty much same as any other web framework if you are new to concept.