Building a REST API in Python | Home Automation #02

Поделиться
HTML-код
  • Опубликовано: 19 июл 2018
  • Learn how to think like a Computer Scientist at brilliant.org/jakewright
    In this video I build the device registry service as a Flask app in Python.
    Code
    github.com/jakewright/tutoria...
    My actual home automation repository
    github.com/jakewright/home-au...
    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

Комментарии • 305

  • @samanthaperry4543
    @samanthaperry4543 5 лет назад +14

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

  • @ledirigeant
    @ledirigeant 3 года назад +3

    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.

  • @McTechnoPvP
    @McTechnoPvP 3 года назад +1

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

  • @themarksmith
    @themarksmith 5 лет назад +21

    Keep them coming Jake - this is a great series!

  • @jesseinit
    @jesseinit 5 лет назад +12

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

  • @ioda006
    @ioda006 4 года назад +1

    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!

  • @mayanxoni
    @mayanxoni 5 лет назад +15

    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!

  • @fredericmarchiol4953
    @fredericmarchiol4953 4 года назад +14

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

  • @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!

  • @NierAutomata2B
    @NierAutomata2B 5 лет назад +1

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

  • @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!

  • @fmontone
    @fmontone 4 года назад +2

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

  • @AnsweredTech
    @AnsweredTech 5 лет назад +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 5 лет назад

      yeah! its turning interesting!

  • @chamithjanaka6040
    @chamithjanaka6040 5 лет назад +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!!

  • @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.

  • @jakobsimonsen7718
    @jakobsimonsen7718 5 лет назад +1

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

  • @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..

  • @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.

  • @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!

  • @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

  • @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 !

  • @Berryss
    @Berryss 5 лет назад +5

    Looks really interesting. Hope you continue with the series!

  • @ChristosLouridas
    @ChristosLouridas 5 лет назад +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 !!

  • @armena2866
    @armena2866 4 года назад

    Great production quality, keep it up mate

  • @dxwoodwardx
    @dxwoodwardx 5 лет назад

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

  • @granson38
    @granson38 5 лет назад +1

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

  • @Perspectologist
    @Perspectologist 5 лет назад +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 RUclips 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.

  • @ACM112PT
    @ACM112PT 5 лет назад

    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 5 лет назад

      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!

  • @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.

  • @keithcrain
    @keithcrain 5 лет назад +1

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

  • @Explorium
    @Explorium 5 лет назад

    Hey man, thanks so much for posting these great videos! This really helped me understand a lot of the basics with Docker and REST APIs.

  • @golam14
    @golam14 5 лет назад

    Great job dude I really enjoy ur videos everytime you upload and keep up the great work...😀😁

  • @GreenDayandMuse
    @GreenDayandMuse 5 лет назад +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

  • @rosieb2610
    @rosieb2610 4 года назад

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

  • @merlijnvanlent
    @merlijnvanlent 5 лет назад

    Really good explanation. Keep up the good work!

  • @ivankatalenic
    @ivankatalenic 5 лет назад

    Great video Jake! I learned something new today.

  • @HarshTruthAbout
    @HarshTruthAbout 4 года назад

    Great explanation and guidelines Jake

  • @3monsterbeast
    @3monsterbeast 3 года назад +1

    Another day, another great coding youtuber found.

  • @WaylonWalker
    @WaylonWalker 5 лет назад +5

    👍 starting with documenting the interface.

  • @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.

  • @franciskisiara
    @franciskisiara 5 лет назад +9

    You said "Idempotent" and I subscribed

  • @MrShidimaOne
    @MrShidimaOne 4 года назад

    Very nice video, clear and concise!

  • @yishahai1798
    @yishahai1798 5 лет назад

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

  • @PainDive1
    @PainDive1 5 лет назад

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

  • @NoahWexler84
    @NoahWexler84 3 года назад

    I love the detail...great work 👍 👌

  • @enricosaccheggiani3192
    @enricosaccheggiani3192 3 года назад

    Excelent !!! Very useful explanation !!!

  • @oussamaboumaad4613
    @oussamaboumaad4613 4 года назад

    man you're great i like all your videos

  • @dekim7979
    @dekim7979 4 года назад +1

    Very educational with easy english.

  • @TheAnimystro
    @TheAnimystro 5 лет назад

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

  • @gauravphagre7509
    @gauravphagre7509 5 лет назад

    Wow. Subscribed you. Awesome video. Best video so far... So precise, so crisp, to the point, and explained whole system knowledge. Looking for more.

  • @greenfieldbyit-dialog4827
    @greenfieldbyit-dialog4827 4 года назад

    Excellent presentation, easy to follow.

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt 5 лет назад

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

  • @raffaelrameh14
    @raffaelrameh14 5 лет назад

    You are a very great teacher! Thanks!

  • @qeuickshots
    @qeuickshots 4 года назад +2

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

  • @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

  • @chas123bish
    @chas123bish 2 года назад

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

  • @ChristopherTalke
    @ChristopherTalke 5 лет назад

    Waiting patiently Jake, want to see more of this series. Let’s see it!!! ✌️👌

  • @mr_cupcakes1808
    @mr_cupcakes1808 3 года назад

    dude this is so informational
    thank you and congratulations

  • @mueez.mp4
    @mueez.mp4 5 лет назад

    Wow, bro! Really well done video.

  • @AmauryOrtega
    @AmauryOrtega 5 лет назад

    Anxious to see more

  • @gloc_mike
    @gloc_mike 5 лет назад +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  5 лет назад +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).

  • @svdfxd
    @svdfxd 4 года назад

    I have just one word - Awesome

  • @ForsmanTomas
    @ForsmanTomas 4 года назад

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

    • @ForsmanTomas
      @ForsmanTomas 4 года назад

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

    • @ForsmanTomas
      @ForsmanTomas 4 года назад

      ​@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 4 года назад

      @valmach2 =) Likewise mate.

  • @johnwhitehead5932
    @johnwhitehead5932 5 лет назад

    Great videos man. Do you use Solidity? Would love to see a video of it from you. :)

  • @aritrachatterjee8057
    @aritrachatterjee8057 4 года назад

    Amazing and awesome. You are smart like jason bourne

  • @MahmoodHussain1818
    @MahmoodHussain1818 4 года назад +1

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

  • @jeremy4737
    @jeremy4737 4 года назад

    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

  • @TarunPrasadKottary
    @TarunPrasadKottary 5 лет назад

    Simple and precise .

  • @albertosetim6526
    @albertosetim6526 4 года назад

    Great video !!

  • @nikitaantonenko8474
    @nikitaantonenko8474 4 года назад +3

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

  • @venkateshprasad4775
    @venkateshprasad4775 5 лет назад

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

  • @CamStansell
    @CamStansell 4 года назад

    no idea what just happened there but was awesome to watch

  • @kunalshah1002
    @kunalshah1002 5 лет назад

    Smooth. This will make me switch back to python.

  • @praveenkumar-gd1mf
    @praveenkumar-gd1mf 3 года назад

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

  • @thenewway416
    @thenewway416 5 лет назад

    Nice job jack

  • @dtrimm1
    @dtrimm1 3 года назад

    Really good - thanks

  • @almostworthy2973
    @almostworthy2973 4 года назад

    Nice! You are my motivation now! This shows me that there's a lot to learn . All the Best to you and All the Best to me!

  • @jonathanconte1395
    @jonathanconte1395 4 года назад +342

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

    • @dominiccordeiro9257
      @dominiccordeiro9257 4 года назад +42

      I can't unsee it now

    • @ManjunathManja1227
      @ManjunathManja1227 4 года назад

      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

  • @JohnWeland
    @JohnWeland 5 лет назад

    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.

  • @Herman-ge2ux
    @Herman-ge2ux 5 лет назад +1

    Love the vids❤️

  • @BrendanMetcalfe
    @BrendanMetcalfe 3 года назад

    Cool video thanks!

  • @JasonAvronSamuels
    @JasonAvronSamuels 5 лет назад

    Thanks Jake!

  • @alexmassy
    @alexmassy 4 года назад

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

  • @joeljoseph6917
    @joeljoseph6917 5 лет назад

    Nice and short!

  • @malayaleeking
    @malayaleeking 5 лет назад

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

  • @davidorr947
    @davidorr947 5 лет назад

    Well done!

  • @cy_wareye7395
    @cy_wareye7395 5 лет назад

    Briefly & clear explanation. Even for Russian guest here.

  • @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?...

  • @amishashukla1944
    @amishashukla1944 4 года назад

    Good job 👍

  • @mariehaikel-elsabeh4329
    @mariehaikel-elsabeh4329 4 года назад

    Great video

  • @Finite8614
    @Finite8614 5 лет назад

    Fantastic thanks for sharing

  • @Confusedcapybara8772
    @Confusedcapybara8772 4 года назад

    dude you're awesome

  • @socialhits1239
    @socialhits1239 4 года назад

    quet informative thank you

  • @BondedAlmond49
    @BondedAlmond49 5 лет назад

    Nice video, very informative! Quick question, at ~ 10:30 you open the README file, but you prepend the full path using os.path.dirname.
    Why did you do it that way instead of just opening the README using a relative path, which would just be README.md since it's in the same directory?

  • @wchen2340
    @wchen2340 4 года назад

    pure gold.

  • @kasra_dr
    @kasra_dr 3 года назад

    that was perfect!😍😍😎

  • @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.

  • @prabuw
    @prabuw 5 лет назад

    Hey Jake - what software do you use for screen recording and video editing?

  • @haroldcavendish4382
    @haroldcavendish4382 5 лет назад

    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.

  • @mitotv6376
    @mitotv6376 Год назад

    Very nice