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
I’ve never seen someone explain so many different advanced topics and make it understandable completely. Amazing content, keep doing you.
Your smile when you talk about cs is actually contagious I love your vids
I liked the video in 35sec. Dude has got a smile going on while explaining them terminologies. Awesome content
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.
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!
Clever chap! The explanantion is so clear that it makes it very easy to do!
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!
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!
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!
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
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!
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
Keep them coming Jake - this is a great series!
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.
Yeap! The way you explain opened my mind for small things I'm struggling to learn. Cheers mate!!
Another day, another great coding youtuber found.
You said "Idempotent" and I subscribed
If you can also note the type of variables like arr:List[int] =[11,12] it could improve the readability
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.
Very educational with easy english.
👍 starting with documenting the interface.
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!!
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 !
Awesome succinct delivery of some extremely high-quality content! Instantly subscribed.
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.
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 !!
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.
no idea what just happened there but was awesome to watch
I have just one word - Awesome
Great video. Really to the point and right speed. Sounds like a Gordon Ramesy giving a tutorial. LOL
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!
Great production quality, keep it up mate
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!
Excelent !!! Very useful explanation !!!
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?
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..
Dude you mad tis look easy! I definitely have a better understanding of building api's and also devnet automation! Thank you!
Genius working in action. Creating RESFul API in python - a quick tour. Since I have done it, I liked the way you explained.
Didn't understand a word. "Liked" anyway because, well, Jake Wright. :)
love the format this was presented in! and a good video as always
Very nice video, clear and concise!
You can tell that you really know what your talking about quite well!
man you're great i like all your videos
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
Got me locked in. Keep them coming. Rang the bell for real-time notifications
I love the detail...great work 👍 👌
Can't get any butter...Thanks for this awesome tutorial.... Subscribed
Some people are just so cute they can make you feel better just by looking at you through a screen.
Great explanation and guidelines Jake
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
passive income* lol
Looks really interesting. Hope you continue with the series!
Anxious to see more
Very nice
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
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?...
Love the way you explain things! Great video (Y)
dude this is so informational
thank you and congratulations
Excellent presentation, easy to follow.
Thanks for suggesting that website at the end of the video. and you should do more of those type of videos.
So helpful to see this built from scratch! Thank you ✨
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.
Really good - thanks
Good job 👍
You are a very great teacher! Thanks!
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.
Great video !!
Briefly & clear explanation. Even for Russian guest here.
Smooth. This will make me switch back to python.
Simple and precise .
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
Great video Jake! I learned something new today.
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).
Hi jake! May I suggest a summarized flowchart to allow newer audience to grasp the flow better? Thanks for the video! Was great
Python has this syntactic sugar where you can type foo not in bar, which is slightly more readable than not (foo in bar).
Joel Hedtjärn god I love python.
Cool video thanks!
Great video
What did he use to do that an ide or a code edit?
This is a different language right? I’m here for your looks 😂😂😂
It was worth being confused for a few minutes
Callum Fletcher yes it’s a rare language, only known to those who don’t take selfies in the mirror.
This is just what i was looking for. Keep this up. Subscribed!
Nice and short!
Why not use open API for documentation(formerly known as Swagger) ?
Hi Jake - have you seen Flask-rest-plus. It allows you to create your endpoints in python and then generate docs in swagger.
Thnaks a lot ! Great explanation ! Question Eric ? Are you back with Donna ?
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.
Really good explanation. Keep up the good work!
quet informative thank you
Esta guapísimo este tío
Great info. Instead of shelf, what would be used in a production like environment?
Amazing! I'm glad I hit play on your video. Thank you!
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)]
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.
I watch him coz of his accent that am in love with lol I hope I understand what he is teaching.. hahaha
dude you're awesome
Your'e a great typer
Jake, you're very good explanator, move forward, be great. From Russia with love/
Nice 👍
Wonderful (y) ... Great Job .... Learned A Lot from this video and got too many goodies... :-)
Nice job jack
Thank you for this awesome video and series, I am waiting for next video
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.