langchain_community.utilities.openweathermap.OpenWeatherMapAPIWrapper¶

class langchain_community.utilities.openweathermap.OpenWeatherMapAPIWrapper[source]¶

Bases: BaseModel

Wrapper for OpenWeatherMap API using PyOWM.

Docs for using:

  1. Go to OpenWeatherMap and sign up for an API key

  2. Save your API KEY into OPENWEATHERMAP_API_KEY env variable

  3. pip install pyowm

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param openweathermap_api_key: Optional[str] = None¶
param owm: Any = None¶
run(location: str) str[source]¶

Get the current weather information for a specified location.

Parameters

location (str) –

Return type

str

Examples using OpenWeatherMapAPIWrapper¶