Building A Simple REST API with FastAPI in Python

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

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

  • @user-zlcksu4asdv
    @user-zlcksu4asdv 2 ปีที่แล้ว +2

    Man, exactly what I was looking for. Implemented what I wanted in 5 minutes "while" watching your video! Thanks heaps!

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

    amazing tutorial👏👏. It has helped me understand a lot about fastapi. cheers mate🥂

  • @andrewmenshicov2696
    @andrewmenshicov2696 3 ปีที่แล้ว +6

    i liked the tutorial but i think some of the code coulda been more thought through, like adding proper guard clauses, doctsrings and less ugly id usage 😅😅

  • @gorge9774
    @gorge9774 3 ปีที่แล้ว +4

    you're reading in my mind🤩

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

    Great tutorial, Thank you so much. I feel so confident in REST API now :)

  • @Sam-tg4ii
    @Sam-tg4ii ปีที่แล้ว

    Thanks for the great explanation. I have one question. Imagine I have the data and the API code on a raspberry pi as a server. How can I give a client access to it over the internet? I mean, I need the client to be able for example to fetch data (get) either using the header method or preferrably the FastAPI's documentation interface that you showed here. Thanks

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

    is that a chrome extension for your json viewing?

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

    I there!!! Great videos and great work. Just dropping suggestion of similar video with Django Rest library

  • @buixuanhung8273
    @buixuanhung8273 3 ปีที่แล้ว +2

    i see your json file has been changed when you do add_person() part. I think you should change the code where you call people, you have to change it to people["people"] .

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

    Great tutorial man, im grateful for your work here. Really concise vid.

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

    does anyone know if there is a way to take the ID out of the sample when you "Try It out" since we are not assigning it back. I find it pretty confusing.

  • @Hanson-e4m
    @Hanson-e4m ปีที่แล้ว +1

    I believe that you didn't consider problem with ID after deletion. If you remove something from the middle you will get bad indexes. Anyway thx for this video I find it's really useful.

  • @RohitSaini-t4r
    @RohitSaini-t4r ปีที่แล้ว

    your intro is nice

  • @AnshuSharma-g8r
    @AnshuSharma-g8r หลายเดือนก่อน

    Great video

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

    Also, for everyone....
    Is there not a more efficient way of doing this?
    def search_provider(accepting: Optional[int] = Query(None, title="Accepting", description="Is the Doctor accepting new patients?"),
    gender: Optional[str] = Query(None, title="Gender", description="Gender of the Doctor")):
    accepting_providers = [p for p in providers if accepting.lower() == p['accepting']]
    if gender is None:
    if accepting is None:
    return providers
    else:
    return accepting_providers
    else:
    gendered_providers = [p for p in providers if gender.lower() in p['gender']]
    if accepting is None:
    return gendered_providers
    else:
    combined_condition = [p for p in accepting_providers if p in gendered_providers]

  • @vikashvashishat4011
    @vikashvashishat4011 3 ปีที่แล้ว

    Hi! can you plz help to use postgres for data for the same

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

    Dude this was fantastic ! Great Job.

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

    Thank you so much 🙂❤

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

    thanks that was great!

  • @gx3mz
    @gx3mz 3 ปีที่แล้ว

    How about of make this api asynchronous? Is there any video you could recommend?

    • @kobakoba321
      @kobakoba321 3 ปีที่แล้ว

      Read about graphene-python or ariadne graphql. Both are asynchronous but they are using GraphQL not REST

  • @jairajsahgal5062
    @jairajsahgal5062 3 ปีที่แล้ว

    Thank you

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

    Aw$m :)

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

    Why Python's so slow?

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

      its an interpreted language not compiled and there is threading but its kinda fake and there is not true concurrency in python

  • @rabibasukala7816
    @rabibasukala7816 3 ปีที่แล้ว

    bruh

  • @kavitharajni8962
    @kavitharajni8962 3 ปีที่แล้ว

    M

  • @disrael2101
    @disrael2101 3 ปีที่แล้ว

    Make it with an actual project please

    • @jairajsahgal5062
      @jairajsahgal5062 3 ปีที่แล้ว

      You can make this a project by taking a date from the user and returning interesting facts about that date.

    • @Krishnaheredd
      @Krishnaheredd 3 ปีที่แล้ว

      Are you from Israel

  • @binkuspinkus8400
    @binkuspinkus8400 3 ปีที่แล้ว

    First!

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

    Fix for add_person():
    ...
    people.append(new_person)
    people_write = {"people": people}
    with open("people.json", "w") as f:
    json.dump(people_write, f)

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

    just in case anyone's getting a TypeError: Object of type Person is not JSON serializable at add_person(), you need to do this json.dump(dict(people), f)