100 days of code - day 35

 I've been a bit remiss of late, I've been doing coding every day, but not writing anything down about it.

This makes it harder to remember what I did and when, but also doesn't help cement the knowledge.

So this is me trying to be better and making sure I document more of what I learn.

Today (following my 100 days of code course - 100 Days of Code - The Complete Python Pro Bootcamp for 2021 | Udemy) I built a small script that can be used daily to check what the weather will be like for the next 12 hours and send me an SMS to tell me if im going to need an umbrella.

This tapped into a few things I've done before but expanded on them.

Sure I've used APIs, and sure I've used environment variables, but they aren't something I use often.

The course started with looking at a weather API (HTTP://api.openweather.org). This involved creating an account, getting an api key and making calls to that API endpoint using credentials which i stored as params.

I went a little above the course as i was already aware that i shouldn't be putting my api key into my script that would be uploaded to github. So i ensured that i created a .env file and put my credentials there. I then added that to my gitignore and created a sample_env file for anyone else looking at my code (Thanks Bob!)

As something different, I also created a requirements.txt file for Anthony (my accountability partner), which i made a typo in, so will have to go and fix that later.

Moving on from there I started looking at the Twilio documentation. It was mostly a copy paste of the code, but i was sensible and put it into a function

It isn't exciting, but it was a building. Check out the code i wrote at udemy-100days/35_exercises at master · fuzzygwalchmei/udemy-100days (github.com)

Comments

Post a Comment

Popular Posts