Build The Next Generation Of Python Web Applications With FastAPI

The Python Podcast.__init__

Episode | Podcast

Date: Sun, 19 Apr 2020 22:00:00 -0400

<div class="wp-block-jetpack-markdown"><h3>Summary</h3> <p>Python has an embarrasment of riches when it comes to web frameworks, each with their own particular strengths. FastAPI is a new entrant that has been quickly gaining popularity as a performant and easy to use toolchain for building RESTful web services. In this episode Sebastián Ramirez shares the story of the frustrations that led him to create a new framework, how he put in the extra effort to make the developer experience as smooth and painless as possible, and how he embraces extensability with lightweight dependency injection and a straightforward plugin interface. If you are starting a new web application today then FastAPI should be at the top of your list.</p> <h3>Announcements</h3> <ul> <li>Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.</li> <li>When you&#8217;re ready to launch your next app or want to try a project you hear about on the show, you&#8217;ll need somewhere to deploy it, so take a look at our friends over at Linode. With 200 Gbit/s private networking, node balancers, a 40 Gbit/s public network, fast object storage, and a brand new managed Kubernetes platform, all controlled by a convenient API you&#8217;ve got everything you need to scale up. And for your tasks that need fast computation, such as training machine learning models, they&#8217;ve got dedicated CPU and GPU instances. Go to <a href="https://www.pythonpodcast.com/linode?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com/linode</a> to get a $20 credit and launch a new server in under a minute. And don&#8217;t forget to thank them for their continued support of this show!</li> <li>Your host as usual is Tobias Macey and today I&#8217;m interviewing Sebastián Ramirez about FastAPI, a framework for building production ready APIs in Python 3</li> </ul> <h3>Interview</h3> <ul> <li>Introductions</li> <li>How did you get introduced to Python?</li> <li>Can you start by describing what FastAPI is? <ul> <li>What are the main frustrations that you ran into with other frameworks that motivated you to create an entirely new one?</li> </ul> </li> <li>What are some of the main use cases that FastAPI is designed for?</li> <li>Many web frameworks focus on managing the end-to-end functionality of a website, including the UI. Why did you focus on just API capabilities? <ul> <li>What are the benefits of building an API only framework?</li> <li>If you wanted to integrate a presentation layer, what would be involved in that effort?</li> </ul> </li> <li>What API formats does FastAPI support? <ul> <li>What would be involved in adding support for additional specifications such as GraphQL or JSON-LD?</li> </ul> </li> <li>There are a huge number of web frameworks available just in the Python ecosystem. How does FastAPI fit into that landscape and why might someone choose it over the other options?</li> <li>Can you share your design philosophy for the project? <ul> <li>What are your main sources of inspiration for the framework?</li> <li>You have also built the Typer CLI library which you refer to as the little sibling of FastAPI. How have your experiences building these two projects influenced their counterpart&#8217;s evolution?</li> </ul> </li> <li>What are the benefits of incorporating type annotations into a web framework and in what ways do they manifest in its functionality?</li> <li>What is the workflow for a developer building a complex application in FastAPI?</li> <li>Can you describe how FastAPI itself is architected and how its design has evolved since you first began working on it? <ul> <li>What are the extension points that are available for someone to build plugins for FastAPI?</li> </ul> </li> <li>What are some of the challenges that you have faced in building an async framework that is leveraging the new ASGI specification?</li> <li>What are some sharp edges that users should keep an eye out for?</li> <li>What are some unique or underutilized features of FastAPI that users might not be aware of?</li> <li>What are some of the most interesting, unexpected, or innovative ways that you have seen FastAPI used?</li> <li>When is FastAPI the wrong choice?</li> <li>What are some of the most interesting, unexpected, or challenging lessons that you have learned in the process of building and maintaining FastAPI?</li> <li>What do you have planned for the future of the project?</li> </ul> <h3>Keep In Touch</h3> <p><a href="https://twitter.com/tiangolo?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">@tiangolo</a> on Twitter. <a href="https://github.com/tiangolo?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">@tiangolo</a> on GitHub.</p> <h3>Picks</h3> <ul> <li>Tobias <ul> <li><a href="https://en.wikipedia.org/wiki/Once_Upon_a_Time_(TV_series)?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Once Upon A Time</a> TV Show</li> </ul> </li> <li>Sebastián <ul> <li><a href="https://en.wikipedia.org/wiki/Cloud_Atlas_(film)?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Cloud Atlas Movie</a></li> <li><a href="https://en.wikipedia.org/wiki/Isaac_Asimov_short_stories_bibliography?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Isaac Asimov&#8217;s robot short stories</a></li> <li><a href="https://github.com/samuelcolvin/python-devtools?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Python devtools debug function</a></li> <li><a href="https://www.python-httpx.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">async compatible requests with HTTPX</a></li> <li><a href="https://www.rescuetime.com/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">RescueTime for automatic time tracking</a></li> <li><a href="https://joplinapp.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Joplin for Notes</a></li> </ul> </li> </ul> <h3>Closing Announcements</h3> <ul> <li>Thank you for listening! Don&#8217;t forget to check out our other show, the <a href="https://feeds.fireside.fm/pythonpodcast/rss">Data Engineering Podcast</a> for the latest on modern data management.</li> <li>Visit the <a href="https://www.pythonpodcast.com?utm_source=rss&amp;utm_medium=rss">site</a> to subscribe to the show, sign up for the mailing list, and read the show notes.</li> <li>If you&#8217;ve learned something or tried out a project from the show then tell us about it! Email <a href="mailto:hosts@podcastinit.com">hosts@podcastinit.com</a>) with your story.</li> <li>To help other people find the show please leave a review on <a href="https://itunes.apple.com/us/podcast/podcast.-init/id981834425?mt=2&amp;uo=6&amp;at=&amp;ct=&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">iTunes</a> and tell your friends and co-workers</li> <li>Join the community in the new Zulip chat workspace at <a href="https://www.pythonpodcast.com/chat?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com/chat</a></li> </ul> <h3>Links</h3> <ul> <li><a href="https://fastapi.tiangolo.com/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">FastAPI</a></li> <li><a href="https://typer.tiangolo.com/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Typer</a></li> <li><a href="https://typer.tiangolo.com/typer-cli/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Typer CLI</a></li> <li><a href="https://fastapi.tiangolo.com/alternatives/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">FastAPI Alternatives, Inspiration and Comparisons</a></li> <li><a href="https://spacy.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Explosion&#8217;s spaCy</a></li> <li><a href="https://prodi.gy/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Explosion&#8217;s Prodigy</a></li> <li><a href="https://www.starlette.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Starlette</a></li> <li><a href="https://pydantic-docs.helpmanual.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Pydantic</a></li> <li><a href="https://www.uvicorn.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Uvicorn</a></li> <li><a href="https://pgjones.gitlab.io/hypercorn/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Hypercorn</a></li> <li><a href="https://github.com/dmontagu/fastapi-utils?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">fastapi-utils</a> <ul> <li><a href="https://fastapi-utils.davidmontague.xyz/user-guide/class-based-views/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Class Based Views</a></li> </ul> </li> <li><a href="https://github.com/mirumee/ariadne?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">GrahQL Ariadne</a></li> <li><a href="https://github.com/ExpDev07/coronavirus-tracker-api?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Coronavirus Tracker API</a></li> <li><a href="https://github.com/cs01/termpair?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Terminals from browser: termpair</a></li> <li><a href="https://xpublish.readthedocs.io/en/latest/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">XPublish</a></li> <li><a href="https://uber.github.io/ludwig/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Uber&#8217;s Ludwig</a></li> <li><a href="https://github.com/Netflix/dispatch?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Netflix Dispatch</a></li> <li><a href="https://en.wikipedia.org/wiki/Colombia?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Colombia</a></li> <li><a href="https://en.wikipedia.org/wiki/Berlin?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Berlin Germany</a></li> <li><a href="https://explosion.ai/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Explosion AI</a></li> <li><a href="https://docs.python.org/3/library/typing.html?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Python Type Annotations</a></li> <li><a href="https://www.django-rest-framework.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Django Rest Framework</a></li> <li><a href="https://flask.palletsprojects.com/en/master/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Flask</a></li> <li><a href="https://github.com/OAI/OpenAPI-Specification?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Swagger/OpenAPI</a></li> <li><a href="https://sanic.readthedocs.io/en/latest/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Sanic</a></li> <li><a href="https://nodejs.org/en/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">NodeJS</a></li> <li><a href="https://json-schema.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">JSON Schema</a></li> <li><a href="https://oauth.net/2/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">OAuth2</a></li> <li><a href="https://github.com/swagger-api/swagger-ui?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Swagger UI</a></li> <li><a href="https://github.com/Redocly/redoc?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">ReDoc</a></li> <li><a href="https://reactjs.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">React</a></li> <li><a href="https://vuejs.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">VueJS</a></li> <li><a href="https://angular.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Angular</a></li> <li><a href="https://en.wikipedia.org/wiki/Representational_state_transfer?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">REST == REpresentational State Transfer</a></li> <li><a href="https://en.wikipedia.org/wiki/JSON-LD?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">JSON-LD</a></li> <li><a href="https://golang.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Go Language</a></li> <li><a href="https://hugapi.github.io/hug/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Hug</a> API framework</li> <li><a href="https://click.palletsprojects.com/en/master/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Click</a> CLI Framework</li> <li><a href="https://flask.palletsprojects.com/en/master/blueprints/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Flask Blueprints</a></li> <li><a href="https://www.tomchristie.com/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Tom Christie</a> <ul> <li><a href="https://www.pythonpodcast.com/apis-sustainable-open-source-and-the-async-web-with-tom-christie/?utm_source=rss&amp;utm_medium=rss">Podcast Interview</a></li> </ul> </li> <li><a href="https://en.wikipedia.org/wiki/Dependency_injection?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Dependency Injection</a></li> <li><a href="https://asgi.readthedocs.io/en/latest/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">ASGI</a> <ul> <li><a href="https://www.pythonpodcast.com/django-channels-and-the-asynchronous-web-with-andrew-godwin-episode-180/?utm_source=rss&amp;utm_medium=rss">Podcast Episode</a></li> </ul> </li> <li><a href="https://wsgi.readthedocs.io/en/latest/index.html?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">WSGI</a></li> <li><a href="https://docs.python.org/3/library/threading.html#thread-local-data?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Thread Local Variables</a></li> <li><a href="https://docs.python.org/3/library/contextvars.html?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Context Vars</a></li> <li><a href="https://fastapi.tiangolo.com/advanced/security/oauth2-scopes/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">OAUTH2 Scopes</a></li> <li><a href="https://pipxproject.github.io/pipx/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">PipX</a></li> <li><a href="https://xarray.pydata.org/en/stable/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">XArray</a></li> <li><a href="https://jamstack.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">JAM Stack</a></li> <li><a href="https://nextjs.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">NextJS</a></li> <li><a href="https://gohugo.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Hugo</a></li> <li><a href="https://www.gatsbyjs.org/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">GatsbyJS</a></li> <li><a href="https://fastapi.tiangolo.com/project-generation/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">FastAPI Project Templates</a></li> </ul> <p>The intro and outro music is from Requiem for a Fish <a href="http://freemusicarchive.org/music/The_Freak_Fandango_Orchestra/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">The Freak Fandango Orchestra</a> / <a href="http://creativecommons.org/licenses/by-sa/3.0/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">CC BY-SA</a></p> </div> <img alt="" height="0" src="https://analytics.boundlessnotions.com/piwik.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fwww.pythonpodcast.com%2Ffastapi-web-application-framework-episode-259%2F&amp;action_name=Build+The+Next+Generation+Of+Python+Web+Applications+With+FastAPI+-+Episode+259&amp;urlref=https%3A%2F%2Fwww.pythonpodcast.com%2Ffeed%2F&amp;utm_source=rss&amp;utm_medium=rss" style="border: 0; width: 0; height: 0;" width="0" />