How to Use FastAPI: A Detailed Python Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • In this tutorial, I'll show you how to get started with FastAPI in Python. By the end of this video, you'll know everything you need to get started with developing your own APIs!
    GitHub repository: github.com/ArjanCodes/2023-fa...
    🚀 Next-Level Python Skillshare Class: skl.sh/3ZQkUEN
    💡 Get my FREE 7-step guide to help you consistently design great software: arjancodes.com/designguide.
    💻 ArjanCodes Blog: www.arjancodes.com/blog
    🎓 Courses:
    The Software Designer Mindset: www.arjancodes.com/mindset
    The Software Designer Mindset Team Packages: www.arjancodes.com/sas
    The Software Architect Mindset: Pre-register now! www.arjancodes.com/architect
    Next Level Python: Become a Python Expert: www.arjancodes.com/next-level...
    The 30-Day Design Challenge: www.arjancodes.com/30ddc
    🛒 GEAR & RECOMMENDED BOOKS: kit.co/arjancodes.
    👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
    💬 Discord: discord.arjan.codes
    🐦Twitter: / arjancodes
    🌍LinkedIn: / arjancodes
    🕵Facebook: / arjancodes
    📱Instagram: / arjancodes
    👀 Code reviewers:
    - Yoriz
    - Ryan Laursen
    - James Dooley
    - Dale Hagglund
    💻 Code example by Ilja Manakov - / imanakov
    🎥 Video edited by Mark Bacskai: / bacskaimark
    🔖 Chapters:
    0:00 Intro
    0:52 Installation
    1:35 Example
    2:40 Creating the app
    4:32 Path and query parameters
    10:30 Routing and requests
    14:16 FastAPI advantage 1
    15:07 FastAPI advantage 2.1
    16:52 FastAPI advantage 2.2
    18:14 FastAPI advantage 3
    19:23 Outro
    #arjancodes #softwaredesign #python
    DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!

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

  • @ArjanCodes
    @ArjanCodes  7 หลายเดือนก่อน +2

    💡 Get my FREE 7-step guide to help you consistently design great software: arjancodes.com/designguide.

    • @lorenczhuka
      @lorenczhuka 3 หลายเดือนก่อน

      Hello, got the error "can't reach this page" when trying to download the guide from the email. Any suggestion?

  • @donjohnson6063
    @donjohnson6063 ปีที่แล้ว +63

    fastapi + pydantic is a ultimate pleasure to work with.

    • @yomajo
      @yomajo 11 หลายเดือนก่อน

      *In the sphere of virgin pleasures

    • @aflous
      @aflous 8 หลายเดือนก่อน

      +SQLModel

  • @priyesbamne9112
    @priyesbamne9112 ปีที่แล้ว +135

    Need more of these full length tutorials ❤️

  • @TangoFoxtrotWhiskey
    @TangoFoxtrotWhiskey ปีที่แล้ว +12

    I'm a big fan of FastAPI. Thanks for doing this.

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

      You’re welcome Tom - glad you liked it!

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

    Great video! It's a really good intro, but there is so much good stuff yet to cover! What makes me really like this framework are also the way it handles dependency injection, the docs that let you test your app, the async support!! Really a great framework, since I discovered it I've never created an API with another python framework haha!

  • @yates_
    @yates_ ปีที่แล้ว +12

    I would also love to see videos about the best ways to deploy such an application, how to scale it, etc.

  • @mgrfans
    @mgrfans ปีที่แล้ว +44

    One of the other major point about fast api is that it is built to support async out of the box.
    So if you have blocking IO calls inside your API logic(db calls, file system interaction, other API calls etc), using async will improve your performance even more.
    In simple terms usually when 1 thread of python server will handle 1 API request. With async it would be able to serve more requests.
    One major thing is that, make sure to use async specific db library, requests module, file io modules etc. Then only we will have this advantage

    • @bilbo1337
      @bilbo1337 ปีที่แล้ว +9

      Just make sure your DB setup is also async, otherwise you're actually making things worse if you use async endpoints with a synchronous DB call.

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

      I have created worker threads to turn blocking calls into non-blocking.

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

    Cool video! Thanks! Would be nice to see video about integration FastApi and Dependency Injector, so interesting

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

    Good job Arjan, looking forward to watching this, loving the channel!

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

      Thank you Andrew!

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

    Thanks! It's very concise. I love the part where it provides an ORM-like validation feature.

  • @giuliareal3364
    @giuliareal3364 7 หลายเดือนก่อน

    Hi Arjan, this is incredible about how easy is to use the fast API compared to other frameworks (especially from Java). With few lines of code, I can get a good structure of an API. Thanks for the amazing tutorial and greetings from Brazil!!

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

    Hi Arjan, thank for the great tutorial! I remember suggesting it for you some time ago ... Thanks for delivering it!

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

      Hope you liked it!

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

    Great video! thanks :) I think it could be a really nice addition if you would demonstrate it with Postman for the http requests, or maybe use the Swagger UI built in for the FastAPI ! you still rocks !

  • @user-rc1dq9vu1s
    @user-rc1dq9vu1s ปีที่แล้ว

    Thank you!! Looking forward more and deep video!!!b

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

    Thanks for yet another awesome video @ArjanCodes❤
    I tried to code along some parts of your video without knowing your approach and I struggled a lot on the parameter query part.
    Even knowing your solution to the problem know, it still feels kinda hard to wrap my head around it.
    Any tips how I can improve that and solve such problems faster?
    Thinking about it.. is a video about problem solving something you want to do in the future?

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

    Have been recently playing around with flask and a little Django in the past. The learning curve and setup time is less steep with FastAPI. I like that templates (jinja2) can be added later.

  • @akhilparekh3941
    @akhilparekh3941 ปีที่แล้ว +7

    Will be very much helpful if you create a microservice series using fastAPI and django/ flask which can imetate the real life project scenario. So that we(entire ArjanCodes community) get to know better coding techniques as well as other understanding in details about that as well.

  • @gerozayas9425
    @gerozayas9425 11 หลายเดือนก่อน

    I love your videos! Thanks a lot for the great work and inspiration! Keep up the amazing content!!

    • @ArjanCodes
      @ArjanCodes  11 หลายเดือนก่อน +1

      Thank you! Will do!

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

    ...and in 20 minutes you can learn 80% of what is needed to use FastAPI ! Great introduction !
    I'm using FastAPI right now, and a lot of things about it are good, but, I've to say, I find the router pretty weak, compared to i.e. Pyramid, and also, something that bothers me are some of decision they made, i.e. HTTPBearer security scheme is returning 403 instead or 401 when not authenticated. Also, I find some things are really difficult with it (i.e. peeking request content before the endpoint, for i.e. logging). That said, the auto doc, async, and all bells and whistles are worth it, for the time being

  • @rayen_fekih
    @rayen_fekih ปีที่แล้ว +12

    It would be helpful to have a series of this and include a tutorial about the interaction between machine learning models and FastAPI (maybe you can include saved models using MLFlow).

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

    Thank's From France very nice share

  • @Asand3r
    @Asand3r 5 หลายเดือนก่อน +1

    Another thanks for such quality content, that's really cool. Keep going, please.

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

      Thank you for the kind comment!

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

    Very explained!

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

    Thanks for this Arjan! Great tutorial covering all you need to get started :) I wonder though why at 10:07 FastAPI doesn't crash with a validation error for you. Your return type of the function doesn't cover list[Item] which the "selection" part of your return value / response contains. I'd expect FastAPI to validate the data through Pydantic and failing to do so because of it containing a list of Item in the dict. Locally I do see this expected behaviour. Anyway, thanks again and greetings from Utrecht :)

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

    Your persistance in consistent type fixing is marvelous

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

      Every Python programmer should do that. You can start by typing new functions and slowly typing legacy code, gradually increasing coverage in the codebase. Type hints improve everything, from catching trivial bugs to helping your IDE make better suggestions, not to mention living documentation that can't get out of date if you have a type checker in your CI.

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

    Thank you for this so much Arjan. I was just about to learn about FastAPI. There are so many of your vids on my watchlist when I'm going to switch jobs soon. Take care.

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

      Glad it was helpful!

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

    Great content, thanks a lot and have a nice weekend! 🙂

  • @untildawn5714
    @untildawn5714 8 หลายเดือนก่อน

    Thank you for helping us. learned a lot from you and this tutorial gives me quick knowledge to ace my tech interview today.

    • @ArjanCodes
      @ArjanCodes  8 หลายเดือนก่อน

      Best of luck!

  • @akotronis
    @akotronis ปีที่แล้ว +18

    This is really great! Pydantic seems easier to use that marshmallow and enforces type-hints as best practice. Really love your videos about best practices/architecture stuff. A similar tutorial about Git best practices would be really nice!

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

      Thanks so much! 😊

  • @adrien-barret
    @adrien-barret ปีที่แล้ว +1

    a video like this one on api best practices would be really nice, like how to add authentication between two services, a authentication with azure directory, etc...

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

    FastAPI is the bets Python framework for building APIs.

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

    Great video! I would love to see a similar Django tutorial

  • @bernidacruz
    @bernidacruz 10 หลายเดือนก่อน

    as always great video! Your tutorials are alway a pleasure. A tutorial to SQLalchemy would be very much appreciated as well

  • @DeKeL_BaYaZi
    @DeKeL_BaYaZi 27 วันที่ผ่านมา

    BEST TEACHER EVER LIVED !

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

    Well to be fair the "A Detailed Python Tutorial" seems to be more of a clickbait than real description but thats a really clear and useful intro to FastAPI

  • @turokII
    @turokII 3 หลายเดือนก่อน

    This was great, thank you!

    • @ArjanCodes
      @ArjanCodes  3 หลายเดือนก่อน

      Glad you enjoyed it!

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

    another great advantage is the dependency injection approach

  • @_DRMR_
    @_DRMR_ ปีที่แล้ว +13

    Last year we ported our extensive Tornado based application to FastAPI. It was quite a learning experience. FastAPI really forced us to re-think some of our original customizations, but we ended up having full feature parity. Unfortunately we never managed to get it into production as the company eventually had to fold.
    You didn't even get to go into some of the neat tricks like Depends()! Future video? ;)

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

      Oh, and a nice trick with Pydantic models is that you can define separate Create/Update/Retrieve types. Then in your FastAPI route you can define a `response_model` that can help you filter results. Say your endpoint accepts certain data, but you only want to return some other data (instead of the exact same object, sometimes needed for enhanced security).

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

      How robust is FastAPI? could this handle thousands of transactions a second, for example? I'd like to work with something that can handle ~500k individual transactions a day (with max db hits being ~5k a second), and this looks pretty good :)

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

      ​@@obsidiansiriusblackheart There's no real way to know. It's going to depend on a number of factors including: the speed of the DB, the speed of the systems running the (API, DB) processes, the complexity of the API functions, any potential latency if the DB is remote, the list goes on. Almost anything will work if you throw enough processes at it or tune it correctly, it really depends on how much you want it to work.
      You're not going to get C++ or even Go levels of performance out of a Python app, but you can get performance that's on par with NodeJS. If you're curious to see if it suits you, I'd suggest setting up a small test environment and throwing some traffic at it. As you've seen from the video, it doesn't take long to set up a single endpoint for test purposes.
      If you don't mind me asking, what sort of thing has such a wild variance that it could have up to 5k requests per second, but only 500k per day?

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

    simple and sweet explanation

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

      Thank you so much 🙂

  • @hY-ug8vn
    @hY-ug8vn ปีที่แล้ว

    please make a full length tutorial for Typer like this video, working to build a CLI tool that manipulates a yaml / json file for example. You have excellent videos.

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

    Fastapi is mean to following the ASGI specification, same as Unicorn. It doesn't make sens to use Gunicorn who follow WSGI spec. Hypercorn is more adapted, however unicorn is robust enough to stay in production.

  • @l.kennethwells2138
    @l.kennethwells2138 ปีที่แล้ว

    Your style is fire. Where should I go to learn full-stack? What's your recommendation?

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

    Excellente vidéo !

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

      Thank you so much!

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

    Hey Arjan,
    thank you for making this video I'm a big fan of FastAPI!
    I noticed some problems:
    - at Path and query parameters, I got a JSONDecoder error, more exactly there was a problem at the return type, instead of dict[str, Selection] it should be dict[str, Selection | list[Item]] or other alternatives
    - in the Routing and requests, post and put endpoints had some unraised HttpExceptions
    I hope you make more videos using this framework in the future, thank you!

    • @lookingforbino
      @lookingforbino 8 หลายเดือนก่อน

      Thanks so much, i got the sam error repeatedly, fixed when added list[Item]. Why Arjan got no issue at all, a bit skeptical here

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

    Amazing video!

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

      Thanks Antonio, glad you liked it!

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

    The sheer volume of usages of the word 'fast' in the first 20 seconds compelled me to smash that thumbs up button.

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

    I've been trying to learn Python. I started programming more than forty years ago, and while I'm not a professional developer, I have experience with a dozen or more programming languages, including C# and Perl (to me, Python seems like an illegitimate love child of those two parents). So... trying to learn Python. So many "intro to Python" videos provide the basics of programming along with the rudimentary structures of the language (formatted strings, getting input, etc.), and they're not useful to someone who can glance at a command, recognize its C roots, and move on without several minutes' discussion about how "print" puts a message on the console.
    This is the first video I've seen that outlines enough of the way a serious piece of software is written (data structures, function calls, API development, etc.) that it has been the most useful video on Python development I've watched. So thank you. I subscribed, am looking forward to more videos, and will refer back to this one a lot.

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

      Wow! Thank you for sharing this!

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

    More FastAPI please. My main backend framework, it's the future and the creator has a sick mustache. Awesome video liked.

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

    Very good video

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

    In my current job we are developing a microsservice using fastapi, and everything is flowing nicely, in the next week the microsservice will gonna be deployed and if everything goes well we are gonna using for alot of things. Thanks for video, hope to see more fastapi around here

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

      Nice! I'll definitely touch more on FastAPI in the future.

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

    Really nice introduction to fastapi! Will you do (or have you done) an introduction to plotly/dash?

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

      Last summer I made Dash mini series!

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

    More FastApi with your unique style Arjan

  • @asadurrahmansifat
    @asadurrahmansifat 7 หลายเดือนก่อน +1

    It's a really nice and concise tutorial. For those who are struggling in list comprehension, part in the 'query_item_by_parametters()' function. What it does is, It's going through all the items in the global dictionary object items ( 2:17 ) and for each `item` it's calling 'check_item()' with the argument `item` if it returns true then the item added to the selection list object.( 9:29 )

    • @wtfbomb
      @wtfbomb 6 หลายเดือนก่อน +1

      Thanks for clarifying, the whole 'query_item_by_parameters()' part was the hardest to wrap my head around! 🧠

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

      Thanks, there is also a typo for count in the return all(). It has "item.count != count" when it should be "item.count == count". It threw me off for a bit.

  • @SajanKumar-mx2jg
    @SajanKumar-mx2jg ปีที่แล้ว

    How can we intercept those errors when we miss the params or send the the wrong param type? Thank you for the excellent explanation!

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

    Amazing intro to fastapi

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

    Were you using Python 3.11 for this? Would love to see a few FastAPI and HTMX tutorials.

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

    From my experience the "Fast" in FastAPI really shines during development. In practice, when running an optimized (not everything-by-default) application, the speed is comparable to Django or Flask. FastAPI has been my go-to framework for the past 3 years.

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

    Thanks Arjan for presenting a comprehensive look at FastAPI.Utilizing Pydantic's BaseModel allows you to design a request body schema that can accommodate multiple fields, and the validator decorator can be employed to validate each field individually.

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

    Do you have a full length tutorial for using Pydantic? That's something new to me that's quite common and I could use your extremely clean explanations!

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

      Not yet! But your suggestion is noted! :)

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

    What about dataclass_json library? I find it extremely neat to use. Adds a bit to regular Python dataclasses, like including/excluding additional fields, or providing default ones.

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

      fastapi comes with pydantic, this package already have this features

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

    Great tips! However, use "Optional" method from "typing" library instead of manually specifying an optional query param with "None=None"👌

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

      typing.Optional does not give you a default value though so you cannot really get around that. The other part is just preference. As of Python 3.10 you can use | instead of Union so specifically importing an additional class to write Optional[int] seems a bit pointless to me if you can simply write int | None.

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

    Love your videos! @ArjanCodes. What is the plugin in your terminal that suggests packages etc.? (timestamp: 1.23)

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

    FastAPI is amazing!

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

    I really like pydantic models. It's really convenient to be able to enforce models for data. I've worked with fast API before but mostly worked on Django. I really like how lightweight fast API is and the built in validation. I'm curious. Do you know how it validates under the hood? I have a project I'm working on now in which I'm using pydantic models, but I'm verifying by constructing the model objects. I'm sure there's an easier way.

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

    High quality stuff

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

    Just jam-packed with details and no fluff. Why can't every tutorial be this bandwidth-efficient?!?!

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

      Thanks, glad you liked it!

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

    hello arjan! can you do a django tutorial series just like this one?

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

    Hi,
    I'm checking FastAPI and I have to say that it has this kind of genious simplicity.
    Please, if you can, make a new video touching "Depends" and how FastAPI's async nature affects to db access.
    I've been having some blocking issues accessing an SQLite database with more than one uvicorn worker (I think they are
    fighting for the sweet love of the database). So, I'm concern about how the async nature of FastAPI can affect
    the db access.
    Thanks.

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

    Hey, thank you 💚 but more importantly, what mic are you using? Sound is great in your vids. Thank you!!

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

      Hi Thank you! You can find all of my video gear in the link in the description! :)

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

      @@ArjanCodes Found it, thank you! Definitely not in the budget this month but maybe soon.

  • @SP-bk7ns
    @SP-bk7ns ปีที่แล้ว

    감사합니다.

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

    Thanks!

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

      Thank you very much for teaching design patterns and architecture, I think these are critical components to be a good software engineer..

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

      Thank you so much, glad you like the content!

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

    Would you do a video on fastapi and async / await?

  • @jonecir
    @jonecir 10 หลายเดือนก่อน

    Hello Dr. Arjan, I'm glad I found this FastAPI tutorial, very well explained. I have a quick question: where should I install FastAPI? Globally on my PC or inside a Python Project in a virtual environment?

    • @thegrind9628
      @thegrind9628 8 หลายเดือนก่อน +1

      Its always a good idea to use virtual environments unless you want to pollute the system with several packages.

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

    I thought the big deal with FastAPI was that it was async and thats what makes it fast. Wanted to see more on that and how you'd use it with other async libs like sqlalchemy[asyncio].

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

    Great tutorial! Btw, will be great to see how fast is FastAPI... Something like side by side load tests with NodeJS-based API frameworks, like Express or Fastify, and maybe PHP-based frameworks (idk is there some similar, or not).
    I use FastAPI for my personal purposes, and small projects for my freelance clients, but I want to now how usable is FastAPI in highload, kinda what limit of this thing?

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

      Great suggestion!

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

    yes: fastapi, then pydantic and starlette and uvicorn and sqlalchemy and then vue.js for the admin and then the api for the communications between all the js and the api backend, then all the crud for all the objects.
    Or use Django and focus on the actual problem you want to solve.

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

    Can you do a web assembly section with python if at all possible?

  • @jairajsahgal7101
    @jairajsahgal7101 7 หลายเดือนก่อน

    Thank you

    • @ArjanCodes
      @ArjanCodes  7 หลายเดือนก่อน

      Glad it was helpful, Jaira!

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

    this is awesome. I'm currenty learning fast api, but I've been building apis with django rest so the database part is alluding me. I love your tutorials. could you possibly do another one of these but so a very simple full setup. like one endpoint, the pydantic model, and the database stuff. youtube is definitly missing out on this specific tutorial. currently all the tutorials I've found stop wtih using a dictionary. no one has done the full tutorial yet.

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

      I used similar to the Gino FastAPI tutorial for my team's implementations. Other than we used SqlAlchemy rather than Gino.
      The installation instructions are out of date but I like the FastAPI, db, and Alembic setup.

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

    at Grupo Sifra (BR company for credit) all the new python APIs are developed with FastAPI rather than Flask, when well developed they become faster!
    I already shared your channel with coworks, your videos are amazing

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

      Thanks so much for sharing!

  • @KhoaTran-tw5gs
    @KhoaTran-tw5gs หลายเดือนก่อน

    I have a question about the code in 10:03, you defined the Selection type is a dictionary but why you can return the selection value in the response object with a list :D

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

    Is there a reason not to use SQLModel instead of Pydantic and SQLAlchemy?

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

      Agree, SQLModel seems like the obvious choice if using SQLAlchemy, since SQLModel gives you a pydantic model for free.
      But not always “instead of” Pydantic. Sometimes the database model is not the same as the HTTP request and response models. In those cases, you’d want to use pydantic to model the request/response, and SQLModel to model what’s in the database.

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

    i wanted to know which formatter you are using for your code.

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

    Nice video, as always. However, I need to ask you: do you recommend the use of FastAPI over Flask? Do you use it in your projects?

    • @jonecir
      @jonecir 10 หลายเดือนก่อน

      Hey, did you figure out about the use of FastAPI over Flask?

  • @TheChihuhua
    @TheChihuhua 11 วันที่ผ่านมา

    really nice

    • @ArjanCodes
      @ArjanCodes  6 วันที่ผ่านมา

      Glad you enjoyed it!

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

    FastAPI looks pretty amazing

  • @apurbabiswas7218
    @apurbabiswas7218 11 หลายเดือนก่อน

    Would love to see a pandas-based data engineering course -> including software you've already talked about (pydantic, pandera, fastapi etc...)

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

    Rumor has it that this is F-A-S-T! Would that be a reference to the development timeline or performance? Anyway, loved the video (as usual) and can't wait to try it out myself.

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

      Performance, there are quite a few benchmarks online

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

    Hi,
    I have been using javascript for frontend and have a bit of practice of abckend with js. However, i have been thinking of moving to Python for fastapi and use it as my backend solution for any software that i create. I dont have much expreicne in Python.
    Whay would you suggest? Should i solidify my backend skills in js or move to Python and fast api and use it.
    I want to have a pleasant experience when bulidng backend and that is very good in security.
    Your response would be helpful.

  • @lookingforbino
    @lookingforbino 8 หลายเดือนก่อน

    @ArjanCodes At time of 13:42, if you change the item.id to a number that exist in items dict, the code not gonna throw an error, it just adds the item to items.
    Can you explain why ?
    Thanks

    • @lookingforbino
      @lookingforbino 8 หลายเดือนก่อน

      Fixed, in the code the key word 'raise' missed. Thanks anyway

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

    You haven't mentioned killer feature of FastAPI which is tight Swagger integration, which allows you to prototype your entire project's API in a single day and give it to both front and back end team. In other words front end team don't have to wait for API to be ready before starting to implement it.

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

    Hi need one clarification on function(query_item_by_parameters) you are using '|' what is can you explain about that? (name: str | None = None,)

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

    Hi may I ask you why in category visual studio show error? Thank you

  • @adid7737
    @adid7737 8 หลายเดือนก่อน

    Do you have a video for implementing based AuthN and AuthZ using FastAPI and App registration in Azure?

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

    Would like to see detailed tips and tricks on FastAPI

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

    this is a great tutorial and examples, however in the code you forgot to raise some exceptions. This could lead to unintended side effects like overwrite an existing item without any error message.

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

    Good video

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

    nice, do the same example using sqlalchemy. Does it only work with sqlite? why use it over sqlite3?

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

    Is this validation working only with pydantic, or can FastAPI also get the types form dataclasses?

  • @djangodeveloper07
    @djangodeveloper07 10 หลายเดือนก่อน

    postman or similar tool isn't easy to test Apis ? it also saves time