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
Your smile when you talk about cs is actually contagious I love your vids
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.
I’ve never seen someone explain so many different advanced topics and make it understandable completely. Amazing content, keep doing you.
Keep them coming Jake - this is a great series!
I liked the video in 35sec. Dude has got a smile going on while explaining them terminologies. Awesome content
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!
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!
Clever chap! The explanantion is so clear that it makes it very easy to do!
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!
Awesome succinct delivery of some extremely high-quality content! Instantly subscribed.
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!
Yeap! The way you explain opened my mind for small things I'm struggling to learn. Cheers mate!!
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.
yeah! its turning interesting!
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!!
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.
love the format this was presented in! and a good video as always
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..
Genius working in action. Creating RESFul API in python - a quick tour. Since I have done it, I liked the way you explained.
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!
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
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 !
Looks really interesting. Hope you continue with the series!
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 !!
Great production quality, keep it up mate
This is just what i was looking for. Keep this up. Subscribed!
Got me locked in. Keep them coming. Rang the bell for real-time notifications
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.
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
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!
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.
Love the way you explain things! Great video (Y)
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.
Great job dude I really enjoy ur videos everytime you upload and keep up the great work...😀😁
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
Hulla Baloon I in
So helpful to see this built from scratch! Thank you ✨
Really good explanation. Keep up the good work!
Great video Jake! I learned something new today.
Great explanation and guidelines Jake
Another day, another great coding youtuber found.
👍 starting with documenting the interface.
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.
You said "Idempotent" and I subscribed
Very nice video, clear and concise!
Thanks for suggesting that website at the end of the video. and you should do more of those type of videos.
Amazing! I'm glad I hit play on your video. Thank you!
I love the detail...great work 👍 👌
Excelent !!! Very useful explanation !!!
man you're great i like all your videos
Very educational with easy english.
You can tell that you really know what your talking about quite well!
Wow. Subscribed you. Awesome video. Best video so far... So precise, so crisp, to the point, and explained whole system knowledge. Looking for more.
Excellent presentation, easy to follow.
Thank you for this awesome video and series, I am waiting for next video
You are a very great teacher! Thanks!
Great video. Really to the point and right speed. Sounds like a Gordon Ramesy giving a tutorial. LOL
If you can also note the type of variables like arr:List[int] =[11,12] it could improve the readability
Dude you mad tis look easy! I definitely have a better understanding of building api's and also devnet automation! Thank you!
Waiting patiently Jake, want to see more of this series. Let’s see it!!! ✌️👌
dude this is so informational
thank you and congratulations
Wow, bro! Really well done video.
Anxious to see more
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.
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.
@@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).
I have just one word - Awesome
You are brilliant mate. Very clear tutorial. Impressed and grateful.
@valmach2 So, where do you have your clear tutorial of how you did it that puts him to shame?
@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.
@valmach2 =) Likewise mate.
Great videos man. Do you use Solidity? Would love to see a video of it from you. :)
Amazing and awesome. You are smart like jason bourne
Wonderful (y) ... Great Job .... Learned A Lot from this video and got too many goodies... :-)
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
Simple and precise .
Great video !!
Jake, you're very good explanator, move forward, be great. From Russia with love/
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.
no idea what just happened there but was awesome to watch
Smooth. This will make me switch back to python.
Can't get any butter...Thanks for this awesome tutorial.... Subscribed
Nice job jack
Really good - thanks
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!
Is It me or It feels like he is about to laugh every time ? ahah
I can't unsee it now
Yeah right? Ha ha
Jonathan Conté lol
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)?...
why you do this, I can't get it out of my head now
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.
Love the vids❤️
Cool video thanks!
Thanks Jake!
Thnaks a lot ! Great explanation ! Question Eric ? Are you back with Donna ?
Nice and short!
Great info. Instead of shelf, what would be used in a production like environment?
Well done!
Briefly & clear explanation. Even for Russian guest here.
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?...
Good job 👍
Great video
Fantastic thanks for sharing
dude you're awesome
quet informative thank you
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?
pure gold.
that was perfect!😍😍😎
Hi Jake - have you seen Flask-rest-plus. It allows you to create your endpoints in python and then generate docs in swagger.
Hey Jake - what software do you use for screen recording and video editing?
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.
Very nice