Python FastAPI Tutorial: How to build modern RESTful APIs with Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 35

  • @rstiekema
    @rstiekema 5 หลายเดือนก่อน

    awesome tutorial. I wouldn't use a for-loop btw. Rather use something like:
    # Find the index of the item to delete
    item_index = next((index for (index, d) in enumerate(books) if d.id == book_id), None)
    # Check if book exists
    if item_index is None:
    raise HTTPException(status_code=404, detail=f"Id {book_id} does not exist")

    books[item_index] = book
    return book

  • @waldschratler
    @waldschratler ปีที่แล้ว

    Very good tutorial! For PUT (update) and DELETE you can use "for i, x in enumerate(BOOKS):" instead of the counter and then use "i" as the index e.g. del BOOKS[i]. "enumerate" automatically counts for you in a for loop. It's a bit cleaner than using a counter.

  • @akshaikumar7966
    @akshaikumar7966 2 หลายเดือนก่อน

    I loved your explanation , it was so precise

    • @codingwithroby
      @codingwithroby  2 หลายเดือนก่อน

      Woot woot - thank you 🙂

  • @SaraLeaGorenshtein
    @SaraLeaGorenshtein ปีที่แล้ว

    Great tutorial! i needed exactly those two videos for my project dwo tommorow, and i had no hope on finishing it on time... thank you very very much!

    • @codingwithroby
      @codingwithroby  ปีที่แล้ว

      I am glad you were able to do your project in time!

  • @Frangelo90
    @Frangelo90 ปีที่แล้ว

    Hello couple of questions about your course...
    -Can it teach me how to get requests from commercial APIs and store them to a database?
    -Does it teach about custom styling the API data on the front end?
    -Does it teach at least some JavaScript DOM manipulation or event listeners?
    I'm interested on playing around different public APIs and display them on the browser with custom styling and click events. Thanks

    • @codingwithroby
      @codingwithroby  ปีที่แล้ว

      Hey friend! It does not show those things unfortunately. It is 100% focused on getting someone from beginner to advanced topics. It will cover many things about FastAPI (Request Methods, Authentication, Authorization, JWTs, Security, status codes, responses, data validation, and a ton more!) but does not go over too much JavaScript, or how to communicate with different APIs from different applications.

    • @Frangelo90
      @Frangelo90 ปีที่แล้ว +1

      @@codingwithroby Thanks for the response!
      I guess the better question is can FastAPI in general able to do what I want to do? I'm looking at your other videos and it seems it's possible I just need to stich them together.
      Or should I just go with another framework?

    • @codingwithroby
      @codingwithroby  ปีที่แล้ว

      @@Frangelo90 Oh yeah, FastAPI can definitely do what you want complete!

  • @ramdanebachir9659
    @ramdanebachir9659 2 ปีที่แล้ว

    VERY NICE , WITH A GOOD EXPLANATIONS , THINK YOU

  • @chriskeo392
    @chriskeo392 2 ปีที่แล้ว +1

    Can you make a SQLModel video with
    Select where(single, multiple condition), joins, etc???

    • @codingwithroby
      @codingwithroby  2 ปีที่แล้ว +1

      I sure can! I will be adding new videos.

    • @chriskeo392
      @chriskeo392 2 ปีที่แล้ว

      @@codingwithroby subscribed and clicked the notification!

  • @TheNovaManagement
    @TheNovaManagement 9 หลายเดือนก่อน

    Good explainations bravo !!

  • @bharathchandrapanasa7997
    @bharathchandrapanasa7997 9 หลายเดือนก่อน

    This takes same book multiple times. How to resolve this

  • @marcgold424
    @marcgold424 2 ปีที่แล้ว

    Great tutorial!

  • @checkmate7780
    @checkmate7780 2 ปีที่แล้ว +1

    Hi Roby, Just a doubt.. Why the same UUID is showing for every item posted. Why do we need to manually change the same? Can't it be uniquely generated?

    • @codingwithroby
      @codingwithroby  ปีที่แล้ว

      That is just what Swagger does. You can change it on each request.

    • @larrybowers45
      @larrybowers45 6 หลายเดือนก่อน

      To auto-generate the ID, you can update the id field definition in the class to this:
      id: UUID = Field(default_factory=uuid4)
      You also need to import uuid4:
      from uuid import UUID, uuid4
      You will notice when you look at the swagger doc, that 'id' is no longer a required field and the id has been automatically generated in the POST response.

  • @hasnaouiacademy7899
    @hasnaouiacademy7899 9 วันที่ผ่านมา

    For while, I thought that you will talk about Ruby on rails 😂

    • @codingwithroby
      @codingwithroby  9 วันที่ผ่านมา

      haha why is that?

    • @hasnaouiacademy7899
      @hasnaouiacademy7899 9 วันที่ผ่านมา

      @@codingwithroby you said coding with roby, I am new to the channel 😅

    • @codingwithroby
      @codingwithroby  8 วันที่ผ่านมา

      Ahh, I understand lol

  • @samianisbouchbout7185
    @samianisbouchbout7185 2 ปีที่แล้ว

    I have an OCR python program and i want to use it in my electron project can i ?

  • @chriskeo392
    @chriskeo392 2 ปีที่แล้ว

    Was swagger renamed OpenAPI?

    • @codingwithroby
      @codingwithroby  2 ปีที่แล้ว

      Swagger is the actual tool, OpenAPI is the specification in which it follows :)

    • @chriskeo392
      @chriskeo392 2 ปีที่แล้ว

      @@codingwithroby you the 👑
      Can't wait to go through your content this weekend!

  • @gold-junge91
    @gold-junge91 6 หลายเดือนก่อน

    Only http ?

    • @codingwithroby
      @codingwithroby  6 หลายเดือนก่อน

      You mean versus HTTPS?