Building a REST API in Python | Home Automation #02

Поділитися
Вставка
  • Опубліковано 22 вер 2024
  • Learn how to think like a Computer Scientist at brilliant.org/...
    In this video I build the device registry service as a Flask app in Python.
    Code
    github.com/jak...
    My actual home automation repository
    github.com/jak...
    Part 1 Introduction
    • Building A Custom Home...
    Learn Docker in 12 Minutes
    • Learn Docker in 12 Min...
    ----------------------------------------
    4K CAMERA amzn.to/2EGMQRi
    MICROPHONE amzn.to/2B0KqKS
    CHEAPER MIC amzn.to/2EGFZHo
    VLOGGING CAMERA amzn.to/2EGqGhZ
    SMALLER CAMERA amzn.to/2EHMPg7
    LED LIGHT amzn.to/2AZgMpB
    TINY LIGHT amzn.to/2B0KJFx
    SOCIAL MEDIA
    twitter / jakewrightuk
    facebook / jakewrightuk
    instagram / jakewrightuk
    snapchat jakewrightuk
    jakewright.net

КОМЕНТАРІ • 304

  • @McTechnoPvP
    @McTechnoPvP 3 роки тому +3

    I’ve never seen someone explain so many different advanced topics and make it understandable completely. Amazing content, keep doing you.

  • @samanthaperry4543
    @samanthaperry4543 6 років тому +15

    Your smile when you talk about cs is actually contagious I love your vids

  • @jesseinit
    @jesseinit 5 років тому +13

    I liked the video in 35sec. Dude has got a smile going on while explaining them terminologies. Awesome content

  • @ledirigeant
    @ledirigeant 3 роки тому +4

    You presented this really well, especially with how you always started with a MVP, running it after each change, and building it out from there. It's the principle of testing-driven development without wasting screen time showing us the test writing code. Bravo.

  • @ioda006
    @ioda006 4 роки тому +2

    wish you would do more of these. i love the simplicity of your tutorials and the way you present it with the drawings. very helpful!

  • @fredericmarchiol4953
    @fredericmarchiol4953 5 років тому +15

    Clever chap! The explanantion is so clear that it makes it very easy to do!

  • @mayanxoni
    @mayanxoni 5 років тому +16

    Dude! This video has been one the most interesting one as I learned the whole concept of the APIs. Initially, I thought REST is some kind of category or a part, but now I got it. Thank you so much.
    Going to show this video in my workshop to the students when I get started with building the APIs.
    Don't stop making these great videos!

  • @spence3523
    @spence3523 4 роки тому +1

    Thank you so much for this! It helped me a butt-ton and I made my own API to rip the grades and assignment off my school's website. My school doesn't have an app for my grades and the website is absolutely terrible on phones. So creating this API was the first step in making an app to make my life easier.
    Again. Thank you so much! Keep doing what you do man!

  • @reachammad
    @reachammad 5 років тому +2

    First time watching you and as an upcoming Programmer, I have to say that you should do more like this. Your method of explaining is real simple to grasp for people, at least for me. Keep it up!

  • @GreenDayandMuse
    @GreenDayandMuse 6 років тому +3

    I don't even do compsci, watching it because Jake has clearly put so much effort into this, how am I finding it so interesting whilst not really knowing what is going on

  • @AnsweredTech
    @AnsweredTech 6 років тому +22

    Love the content as always, Jake. As a comp sci student myself, I can’t wait to see more videos in this series! Keep up the good work.

    • @lucariodiez
      @lucariodiez 6 років тому

      yeah! its turning interesting!

  • @jonathanconte1395
    @jonathanconte1395 5 років тому +342

    Is It me or It feels like he is about to laugh every time ? ahah

    • @dominiccordeiro9257
      @dominiccordeiro9257 5 років тому +42

      I can't unsee it now

    • @ManjunathManja1227
      @ManjunathManja1227 5 років тому

      Yeah right? Ha ha

    • @xfrostbite8328
      @xfrostbite8328 4 роки тому

      Jonathan Conté lol

    • @pierrechevaliergeol
      @pierrechevaliergeol 4 роки тому +4

      Well, I hadn't noticed on other videos where you don't see his face (docker stuff), but with this one, now that you said it...
      I've almost got the feeling that Mr Jake is making fun out of me. Probably because of the misteack I do while typing (slower than him)?...

    • @kaidzz
      @kaidzz 4 роки тому +1

      why you do this, I can't get it out of my head now

  • @themarksmith
    @themarksmith 6 років тому +21

    Keep them coming Jake - this is a great series!

  • @TheRoostersGarage
    @TheRoostersGarage 5 років тому

    I came here to learn how to create a Python API. Very nice tutorial. Might I suggest a couple things? 1) For your home automation look into Home Assistant. It's written in Python and open source. I've been using it at my house for years and am learning Python to add some functionality to it. Someone like you would be a great asset for the community. I understand you wrote this to learn Python and there's many apps I wrote while learning languages that I later abandoned in favor of something better. 2) To document your APIs, look at Swagger. It's the easiest thing I've used to document an API.

  • @fmontone
    @fmontone 5 років тому +2

    Yeap! The way you explain opened my mind for small things I'm struggling to learn. Cheers mate!!

  • @3monsterbeast
    @3monsterbeast 4 роки тому +1

    Another day, another great coding youtuber found.

  • @franciskisiara
    @franciskisiara 5 років тому +9

    You said "Idempotent" and I subscribed

  • @spicy_wizard
    @spicy_wizard 4 роки тому +1

    If you can also note the type of variables like arr:List[int] =[11,12] it could improve the readability

  • @Perspectologist
    @Perspectologist 6 років тому +2

    Wow! This was very intense, fast and informationally dense. I found myself hitting rewind and pause a lot just to digest some of this. If I were more experienced with these technologies I might have been better able to keep up. Someone new to this will have to watch this a few times with some pausing and googling in between. I don’t think I would say that is a bad thing, the nice thing about a personal video viewing experience in UA-cam is that you can control the video (rewinding and pausing as needed). This kind of rapid delivery is inspiring, and may be better for people with more background knowledge.
    Thanks for making this. I really enjoyed it. I particularly like the way Jake wrote the documentation first. I do some of that, but not as completely as Jake did. I’ll be interested to see how he manages the security of his automation system.

  • @dekim7979
    @dekim7979 5 років тому +1

    Very educational with easy english.

  • @WaylonWalker
    @WaylonWalker 6 років тому +5

    👍 starting with documenting the interface.

  • @chamithjanaka6040
    @chamithjanaka6040 6 років тому +1

    This so awesome Jake Keep this is up...:) We have a lot of things to learn from you. also You have good speaking style to the audience ready for Part 3. Whoe!!

  • @kamolrahimov117
    @kamolrahimov117 5 років тому +1

    Your shooting video is very wonderfull, and also pleased that you leave useful links under the video. Thanks for all and good luck in your future !

  • @NierAutomata2B
    @NierAutomata2B 6 років тому +1

    Awesome succinct delivery of some extremely high-quality content! Instantly subscribed.

  • @TheTessatje123
    @TheTessatje123 4 роки тому +1

    Hi Jake!
    Great tutorial (quick and clear). Please add this: to your open('README.md', 'r', encoding='utf-8') the encoding part, otherwise there are codec problems.

  • @ChristosLouridas
    @ChristosLouridas 6 років тому +1

    Hope I could understand more. I’m into shipping not coding. But that was a nice one Jake well done, very analytical and to the point !!

  • @geoffreyanderson4719
    @geoffreyanderson4719 4 роки тому

    Good vid. Thanks for teaching me flask, docker, and api dev in the python world. I did it in C# before. You went nice and fast no time for sleep.

  • @CamStansell
    @CamStansell 4 роки тому

    no idea what just happened there but was awesome to watch

  • @svdfxd
    @svdfxd 4 роки тому

    I have just one word - Awesome

  • @qeuickshots
    @qeuickshots 4 роки тому +2

    Great video. Really to the point and right speed. Sounds like a Gordon Ramesy giving a tutorial. LOL

  • @ACM112PT
    @ACM112PT 6 років тому

    I have no clue what you're talking about but i like your explanations, great video as usual! Looking forward to the rest of the series

    • @ACM112PT
      @ACM112PT 6 років тому

      Hello _ I actually know the basics of python from university as I'm studying industrial engineering so I do understand a bit of what he's doing but not much ahah I might look up some of those resources though, thanks!

  • @armena2866
    @armena2866 4 роки тому

    Great production quality, keep it up mate

  • @michaelbarrows9153
    @michaelbarrows9153 5 років тому +2

    This video was actually so helpful! Helped me to understand Flask enough to create an API for some natural language processing as a small part of my dissertation. Thank you!

  • @enricosaccheggiani3192
    @enricosaccheggiani3192 3 роки тому

    Excelent !!! Very useful explanation !!!

  • @kubapuchalski8633
    @kubapuchalski8633 5 років тому +7

    I don't know why I'm here, I don't understand a word of it but I did enjoy watching it... Maybe I should start learning programming?

  • @VijaySweden
    @VijaySweden 5 років тому +1

    Awesome pace.. this is really awesome as it covered all necessary areas and one can always explore more on need basis. I like the tips you offer such as flask resource etc.. please keep going..

  • @chas123bish
    @chas123bish 3 роки тому

    Dude you mad tis look easy! I definitely have a better understanding of building api's and also devnet automation! Thank you!

  • @kirthiramaniyer4866
    @kirthiramaniyer4866 5 років тому

    Genius working in action. Creating RESFul API in python - a quick tour. Since I have done it, I liked the way you explained.

  • @vexer2942
    @vexer2942 6 років тому +81

    Didn't understand a word. "Liked" anyway because, well, Jake Wright. :)

  • @jakobsimonsen7718
    @jakobsimonsen7718 6 років тому +1

    love the format this was presented in! and a good video as always

  • @MrShidimaOne
    @MrShidimaOne 5 років тому

    Very nice video, clear and concise!

  • @TheAnimystro
    @TheAnimystro 5 років тому

    You can tell that you really know what your talking about quite well!

  • @oussamaboumaad4613
    @oussamaboumaad4613 4 роки тому

    man you're great i like all your videos

  • @jeremy4737
    @jeremy4737 5 років тому

    Very good. Should look at at swagger/openapi to provide a definition for your api, then you can use swaggerui to render out documentation and allow you to test the interface

  • @granson38
    @granson38 6 років тому +1

    Got me locked in. Keep them coming. Rang the bell for real-time notifications

  • @NoahWexler84
    @NoahWexler84 4 роки тому

    I love the detail...great work 👍 👌

  • @praveenkumar-gd1mf
    @praveenkumar-gd1mf 4 роки тому

    Can't get any butter...Thanks for this awesome tutorial.... Subscribed

  • @rainworld-f3i
    @rainworld-f3i 2 роки тому

    Some people are just so cute they can make you feel better just by looking at you through a screen.

  • @HarshTruthAbout
    @HarshTruthAbout 5 років тому

    Great explanation and guidelines Jake

  • @hananii3485
    @hananii3485 5 років тому +16

    Hey Jake, ever considered creating more structured tutorial videoss or livestreaming your random coding process and make that a past income? I mean I can watch Jake talking for hours no kidding

  • @Berryss
    @Berryss 6 років тому +5

    Looks really interesting. Hope you continue with the series!

  • @AmauryOrtega
    @AmauryOrtega 6 років тому

    Anxious to see more

  • @mitotv6376
    @mitotv6376 Рік тому

    Very nice

  • @Danieru13
    @Danieru13 5 років тому

    Loved this video. I know the basic things of Python and it was pretty easy to understand how to make an easy REST API with Flask

  • @softrek
    @softrek 4 роки тому +6

    When i see your smiled face, I see in memory the scene from Godfellas: How am I funny, like a Clown? What is so funny about me?...

  • @keithcrain
    @keithcrain 5 років тому +1

    Love the way you explain things! Great video (Y)

  • @mr_cupcakes1808
    @mr_cupcakes1808 3 роки тому

    dude this is so informational
    thank you and congratulations

  • @greenfieldbyit-dialog4827
    @greenfieldbyit-dialog4827 5 років тому

    Excellent presentation, easy to follow.

  • @yishahai1798
    @yishahai1798 6 років тому

    Thanks for suggesting that website at the end of the video. and you should do more of those type of videos.

  • @rosieb2610
    @rosieb2610 4 роки тому

    So helpful to see this built from scratch! Thank you ✨

  • @JohnWeland
    @JohnWeland 6 років тому

    count me in. currently using an open source thing but not all my smart devices can be paired to it so once I figure out what you do for that, I'll be following suit.

  • @dtrimm1
    @dtrimm1 4 роки тому

    Really good - thanks

  • @amishashukla1944
    @amishashukla1944 4 роки тому

    Good job 👍

  • @raffaelrameh14
    @raffaelrameh14 5 років тому

    You are a very great teacher! Thanks!

  • @Abdullah97484
    @Abdullah97484 6 років тому +2

    Jake you've put the controller gateway as a incorrect invalid IP. It's under responses heading within the json section. On the readme file.

  • @albertosetim6526
    @albertosetim6526 4 роки тому

    Great video !!

  • @cy_wareye7395
    @cy_wareye7395 5 років тому

    Briefly & clear explanation. Even for Russian guest here.

  • @kunalshah1002
    @kunalshah1002 6 років тому

    Smooth. This will make me switch back to python.

  • @TarunPrasadKottary
    @TarunPrasadKottary 6 років тому

    Simple and precise .

  • @alvaro811994
    @alvaro811994 3 роки тому

    Can you make an example on how to use the POST method using Postman but sending a file/attachment instead? I can’t seem to find a way to use argparse to receive a file from PM

  • @ivankatalenic
    @ivankatalenic 6 років тому

    Great video Jake! I learned something new today.

  • @gloc_mike
    @gloc_mike 6 років тому +9

    Loving your approach to this, and it's great seeing first-hand how someone else goes through the design and build of a system.
    One thing though, why did you decide to put the 'flask' code in the __init__.py file? I've been looking into this in the past week or so, and I've seen a few other cases where this has been done, but I have yet to discover why one would use the __init__.py file this way.

    • @jakewrightnet
      @jakewrightnet  6 років тому +4

      I want to point out that I've never built anything in Python before this so I don't know how accurate my opinions are. But, it seems like you have to have a __init__.py file in a package, so if I put my code in a different file I'd end up with two files. If the init file is there anyway, it seems cleaner to just use it? Maybe someone else here can provide more insight.

    • @the_berzi
      @the_berzi 5 років тому +5

      @@jakewrightnet The init file serves to tell python that the directory it's in is a package (among other things, this means you can use that directory in something like `import my_thing.my_package`). Whenever a package is imported, the code in the init file is run, if any code is there.
      You don't want to put your actual program code there because you don't want potentially unwanted things to happen, and because that's not where a developer would expect your code to be. Normally for applications with just one module, you just call the module with the same name of your application.
      The python ecosystem relies a lot on conventions (see the whole concept of PEP) because the language is very powerful and flexible, so it's really easy to confuse anyone who might stumble upon your code otherwise (including the yourself from the future).

  • @Hun940
    @Hun940 4 роки тому

    Hi jake! May I suggest a summarized flowchart to allow newer audience to grasp the flow better? Thanks for the video! Was great

  • @joelhedtjarn9
    @joelhedtjarn9 6 років тому +1

    Python has this syntactic sugar where you can type foo not in bar, which is slightly more readable than not (foo in bar).

  • @BrendanMetcalfe
    @BrendanMetcalfe 4 роки тому

    Cool video thanks!

  • @mariehaikel-elsabeh4329
    @mariehaikel-elsabeh4329 5 років тому

    Great video

  • @cesarcadizrivero5351
    @cesarcadizrivero5351 4 роки тому +2

    What did he use to do that an ide or a code edit?

  • @callumfletcher2684
    @callumfletcher2684 6 років тому +7

    This is a different language right? I’m here for your looks 😂😂😂
    It was worth being confused for a few minutes

    • @comiccalvin5124
      @comiccalvin5124 6 років тому +11

      Callum Fletcher yes it’s a rare language, only known to those who don’t take selfies in the mirror.

  • @dxwoodwardx
    @dxwoodwardx 5 років тому

    This is just what i was looking for. Keep this up. Subscribed!

  • @joeljoseph6917
    @joeljoseph6917 6 років тому

    Nice and short!

  • @bigdlamz
    @bigdlamz 5 років тому +1

    Why not use open API for documentation(formerly known as Swagger) ?

  • @Rachelebanham
    @Rachelebanham 4 роки тому

    Hi Jake - have you seen Flask-rest-plus. It allows you to create your endpoints in python and then generate docs in swagger.

  • @alexmassy
    @alexmassy 4 роки тому

    Thnaks a lot ! Great explanation ! Question Eric ? Are you back with Donna ?

  • @haroldcavendish4382
    @haroldcavendish4382 6 років тому

    Apologies if you've already explained it somewhere but why did you decide to use such a bloated protocol for home automation? Wouldn't something like MQTT be much better for this task? I've got a similar project in mind and would like to consider all options. In any case, good job, I very much like your videos because they're clear, concise, and well thought-out and edited. Found you through the Docker in 12 minutes one.

  • @merlijnvanlent
    @merlijnvanlent 6 років тому

    Really good explanation. Keep up the good work!

  • @socialhits1239
    @socialhits1239 4 роки тому

    quet informative thank you

  • @eduardosaberin2785
    @eduardosaberin2785 5 років тому

    Esta guapísimo este tío

  • @malayaleeking
    @malayaleeking 5 років тому

    Great info. Instead of shelf, what would be used in a production like environment?

  • @PainDive1
    @PainDive1 6 років тому

    Amazing! I'm glad I hit play on your video. Thank you!

  • @whitefire3569
    @whitefire3569 5 років тому +1

    GUYS!! ANYONE WATCHING THIS VIDEO AND TRYING TO CODE THIS:
    Make sure that you change anything with the variable identifier or shelf[identifier], or args['identifier'], and add str() around it. This will save you so much time debugging because I just wasted all that time for you! For example shelf[identifier] becomes shelf[str(identifier)]

  • @ForsmanTomas
    @ForsmanTomas 5 років тому

    You are brilliant mate. Very clear tutorial. Impressed and grateful.

    • @ForsmanTomas
      @ForsmanTomas 5 років тому

      @valmach2 So, where do you have your clear tutorial of how you did it that puts him to shame?

    • @ForsmanTomas
      @ForsmanTomas 5 років тому

      ​@valmach2 You said he is merely replicating work done by you. I complimented him on being a brilliant educator managing to make a very clear tutorial. Your framework is simply something built on the back of other peoples work, who in turn has only managed to accomplish their creations thanks to people before them. In the same fashion Jake here has built on other peoples creations and created a piece of educational material. I'm very sorry if my standards of what I consider to be brilliant isn't up to par with what you deem worthy of such accolades. I hope you get all praise you deserve for your contributions in code, be them brilliant or not.

    • @ForsmanTomas
      @ForsmanTomas 5 років тому

      @valmach2 =) Likewise mate.

  • @salma_techie
    @salma_techie 3 роки тому +1

    I watch him coz of his accent that am in love with lol I hope I understand what he is teaching.. hahaha

  • @Confusedcapybara8772
    @Confusedcapybara8772 4 роки тому

    dude you're awesome

  • @sexayboiee
    @sexayboiee 4 роки тому +1

    Your'e a great typer

  • @nikitaantonenko8474
    @nikitaantonenko8474 5 років тому +3

    Jake, you're very good explanator, move forward, be great. From Russia with love/

  • @farhanahmad5934
    @farhanahmad5934 2 роки тому

    Nice 👍

  • @MahmoodHussain1818
    @MahmoodHussain1818 5 років тому +1

    Wonderful (y) ... Great Job .... Learned A Lot from this video and got too many goodies... :-)

  • @thenewway416
    @thenewway416 6 років тому

    Nice job jack

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt 6 років тому

    Thank you for this awesome video and series, I am waiting for next video

  • @venkateshprasad4775
    @venkateshprasad4775 6 років тому

    Hey there is a typo in controller_gateway inside README.MD file. BTW a great tutorial after a long time in UA-cam, hoping for few more... Great work! Crisp and clear.