Created
July 16, 2019 00:36
-
-
Save moustachio-belvedere/066791bcff13c24da7d9456d55586acf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datapoint as met | |
# api key | |
apikey = "Insert your api key here!" | |
# set lattitude and longitude of Cambridge UK | |
latitude, longitude = 52.2053, 0.1218 | |
# initialise connection and get forecast with hour time-steps | |
conn = met.connection(api_key = apikey) | |
site = conn.get_nearest_forecast_site(latitude, longitude) | |
forecast = conn.get_forecast_for_site(site.id, "3hourly") | |
weathernow = forecast.now() | |
print("Temperature at {} is currently {} degrees celsius.".format(site.name, weathernow.temperature.value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment