Fun with MetOffice API’s

Standard

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s