1 of 16

Let's have fun building APIs with Starlette: The Asynchronous Python Web Framework

Hemangi Karchalkar

2 of 16

Outline

  • Installation
  • Request
  • Response
  • Routing
  • Path Parameters
  • Http Methods
  • Jinja Templating
  • DB creation with SQLAlchemy
  • Creating table definition
  • Queries
  • API  Schema
  • Configuration
  • Testing APIs and wrapping up!

  • Add your second bullet point here
  • Add your third bullet point here

3 of 16

Starlette

4 of 16

Installation

  1. Setting up the virtual env
  2. Requirements: Python 3.8+ 
  3. Installing starlette and uvicorn(ASGI server)
  4. Code editor – VSCode, Atom, Pycharm etc
  5. Postman

5 of 16

Requests

6 of 16

7 of 16

8 of 16

9 of 16

10 of 16

Jinja2 templates

11 of 16

Creating a database with SQLAlchemy

12 of 16

Creating table definition

13 of 16

14 of 16

API Schemas

  • Starlette supports generating API schemas, such as the widely used OpenAPI specification. (Formerly known as "Swagger".)

15 of 16

Configuration

16 of 16

Testing the API endpoints and Wrapping up!