As a data scientist I often have to extract data from RESTful API’s this was something I’m admittedly not very good at.
So I decided to look at the MetOffice Datapoint API which provides weather information in the United Kingdom. You can visit that website to get your own API key if you wish.
Being from near Newry in Northern Ireland I decided to write a simple API call to extract data from that API.
The aim of this short gist is just to illustrate how you’d write a short OOP friendly snippet in Python.
In the future, I’ll write up something on how to mock out this API since that’s a big interest for me. Pytest looks like one of the best ways to do that.
These kinds of API’s are of interest if your model depends on weather information – which a lot of models do.
Thanks to Maciej Kula for providing some much needed code review.