The class this integration contains allows you to make calls to OpenWeather’s One Call API 1.0.
Access to the API is controlled by key. You will need to register for developer access to obtain your key.
Note This class does not parse the incoming data, which is highly complex. It is up to your application to extract the data you require.
The library uses the Python Requests
module or equivalent to issue HTTP requests to the API and process the responses. Your code will need to import Requests
and pass an instance into the library’s constructor.
The library does not import requests
itself in order to support different species of Python, such as MicroPython and CircuitPython which have different implementations of Requests
. For instance:
# MicroPython example
import urequests as requests
ow = OpenWeather(requests, secrets["apikey"], True
# CircuitPython example
import adafruit_requests as requests
ow = OpenWeather(requests, secrets["apikey"], False)
The library uses Requests
’ get()
method, and works with Response
instances created by requests.
You can find full library documentation at smittytone.net.
OpenWeather-Python is © 2022 by Tony Smith and is licensed under the terms of the MIT licence.
The OpenWeather One Call API is © 2012—2022, OpenWeather.