Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DevOpsPorto Meetup 38: Intro to FastAPI by Sebastián Ramírez

DevOpsPorto Meetup 38: Intro to FastAPI by Sebastián Ramírez

A2c14a1c4e16aa337c7d36abe7d1cf8f?s=128

DevOpsPorto

August 06, 2020
Tweet

More Decks by DevOpsPorto

Other Decks in Technology

Transcript

  1. Intro to High performance, easy to learn, fast to code,

    ready for production
  2. Who am I? Sebastián Ramírez github.com/tiangolo linkedin.com/in/tiangolo twitter.com/tiangolo Dev at

    Explosion Berlin, Germany Explosion created: I created: tiangolo.com
  3. About FastAPI • 19K GitHub stars (about 1K+ per month)

    • Used by Microsoft, Uber, Netflix, etc. • Performance in the top rank for Python @tiangolo
  4. Based on standards • OpenAPI • JSON Schema • OAuth2

    ✨ Automatic API docs ✨ @tiangolo
  5. Based on standards - for free @tiangolo

  6. Based on Python type hints • Autocompletion everywhere • Type

    checks and type errors @tiangolo
  7. Types provide autocompletion @tiangolo

  8. Easy and short @tiangolo

  9. Less API code @tiangolo

  10. Basic FastAPI app @tiangolo https://somedomain.com/items/5?q=some+query

  11. Basic FastAPI app - docs @tiangolo https://somedomain.com/docs

  12. Automatic docs @tiangolo

  13. Basic FastAPI app with body @tiangolo

  14. Basic FastAPI app with body - docs @tiangolo

  15. Basic FastAPI app with body - docs @tiangolo

  16. Basic FastAPI app with body @tiangolo

  17. Basic FastAPI app with body and query @tiangolo

  18. Basic FastAPI app with body and query - docs @tiangolo

    https://somedomain.com/food/?delivery=true
  19. Basic FastAPI app with body and query @tiangolo

  20. JSON array of objects in body @tiangolo

  21. JSON array of objects in body - docs @tiangolo

  22. JSON array of objects in body @tiangolo

  23. JSON array of objects in body - invalid data @tiangolo

  24. JSON array of objects in body - validation @tiangolo

  25. JSON array of objects in body - validation @tiangolo

  26. FastAPI auto-completion @tiangolo

  27. Type checks @tiangolo

  28. All based on standard Python types @tiangolo

  29. Metadata @tiangolo

  30. Metadata in docs @tiangolo

  31. Metadata in docs @tiangolo

  32. Required query @tiangolo

  33. Required query in docs @tiangolo

  34. Required query validation @tiangolo

  35. Required query in docs - valid @tiangolo https://somedomain.com/food/?quantity=2

  36. Required query in docs - response @tiangolo

  37. Required query in docs @tiangolo

  38. Validation @tiangolo

  39. Validation in docs @tiangolo

  40. Validation in docs - response @tiangolo

  41. Data validation @tiangolo

  42. FastAPI - Performance @tiangolo

  43. FastAPI - Performance @tiangolo

  44. FastAPI - Other features @tiangolo • Dependency Injection • Security

    - OAuth2 • WebSockets • Files • Background Tasks • Easy GraphQL integration • More...
  45. FastAPI - When not to @tiangolo • Stable • No

    new features • Not an API
  46. Other tools @tiangolo Build great CLIs. Easy to code. Based

    on Python type hints. Functional deep learning with types, compatible with your favorite libraries. typer.tiangolo.com thinc.ai
  47. Thank you! Sebastián Ramírez github.com/tiangolo linkedin.com/in/tiangolo twitter.com/tiangolo tiangolo.com Questions? fastapi.tiangolo.com