Insights from my Software Engineering Radio interview with Marcelo Trylesinski
Introduction
In a recent episode of the Software Engineering Radio podcast, I interviewed Marcelo Trylesinski, a senior software engineer at Pydantic and a maintainer of open-source Python tools including Starlette and Uvicorn. Our conversation focused on the unique features of FastAPI, a modern and high-performance web framework for building APIs with Python 3.6+ based on standard Python type hints. I’m thankful that Marcelo talked with me about the design, implementation, and use of FastAPI — it was a fun and fast-paced conversation!
Insights
These three questions overview my discussion with Marcelo about FastAPI:
What is FastAPI and why is it important?
“FastAPI, it’s a framework that’s used to build APIs in Python. It leverages type hints and it’s very fun to develop with.”
How does FastAPI ensure high performance and developer productivity?
“So for me I always saw, I mean even if I’m the maintainer of Uvicorn, the server that makes is one of the reasons that FastAPI to be fast on my perspective, the fast is more about the user perspective. Because in any case you’re still working with Python and there are certain limitations but the idea is that since you’re leveraging the async world, you don’t need to use the threads. So you can have more tasks running in a single thread and then you have more capacity to run more tasks and that means that you can receive and process more requests and that makes the server faster I would say.”
How does FastAPI handle authentication and authorization?
“So FastAPI does not handle that for you. So you need to implement the layer yourself. What it does is you can define a way for how to interpret some data that comes from the request. So for example, you have HTTP basic class, which it’s used for FastAPI to get the authorization header and then get the username and the password and it provides that to your endpoint. So you have, you use that class just to kind of parse that data for you, but it does not handle that for you.”
Listen
In conclusion, if you’re interested in learning more about the design and implementation of FastAPI or approaches to building APIs in Python, I highly recommend that you listen to Marcelo Trylesinski on FastAPI from Software Engineering Radio! You can find it on your favorite podcast player, Apple Podcasts, Spotify, YouTube, or listen to it with this handy podcast player.