woob.capabilities.weather

class woob.capabilities.weather.BaseWeather(id='', url=NotLoaded, backend=None)

Bases: woob.capabilities.base.BaseObject

Variables
  • precipitation – (str) Precipitation type

  • precipitation_probability – (float) Probability of precipitation (ratio)

  • wind_direction – (str) Wind direction

  • wind_speed – (float) Wind speed (in km/h)

  • humidity – (float) Relative humidity (ratio)

  • pressure – (float) Atmospheric pressure (in hPa)

  • visibility – (float) Horizontal visibility distance (in km)

  • cloud – (int, int) Cloud coverage (in okta (0-8))

class woob.capabilities.weather.CapWeather

Bases: woob.capabilities.base.Capability

Capability for weather websites.

get_current(city_id)

Get current weather.

Parameters

city_id – ID of the city

Return type

Current

Look for a city.

Parameters

pattern (str) – pattern to search

Return type

iter[City]

iter_forecast(city_id)

Iter forecasts of a city.

Parameters

city_id – ID of the city

Return type

iter[Forecast]

class woob.capabilities.weather.City(id='', name=None, url=None)

Bases: woob.capabilities.base.BaseObject

City where to find weather.

Variables

name – (str) Name of city

exception woob.capabilities.weather.CityNotFound

Bases: woob.capabilities.base.UserError

Raised when a city is not found.

class woob.capabilities.weather.Current(date=NotLoaded, temp=None, text=None, unit=None, url=None)

Bases: woob.capabilities.weather.BaseWeather

Current weather.

Variables
  • date – (date, datetime) Date of measure

  • text – (str) Comment about current weather

  • temp – (Temperature) Current temperature

class woob.capabilities.weather.Direction(*args, **kwargs)

Bases: woob.capabilities.base.Enum

E = 'East'
ENE = 'East-Northeast'
ESE = 'East-Southeast'
N = 'North'
NE = 'Northeast'
NNE = 'North-Northeast'
NNW = 'North-Northwest'
NW = 'Northwest'
S = 'South'
SE = 'Southeast'
SSE = 'South-Southeast'
SSW = 'South-Southwest'
SW = 'Southwest'
W = 'West'
WNW = 'West-Northwest'
WSW = 'West-Southwest'
class woob.capabilities.weather.Forecast(date=NotLoaded, low=None, high=None, text=None, unit=None, url=None)

Bases: woob.capabilities.weather.BaseWeather

Weather forecast.

Variables
  • date – (datetime, date, str) Date for the forecast

  • low – (Temperature) Low temperature

  • high – (Temperature) High temperature

  • text – (str) Comment on forecast

class woob.capabilities.weather.Precipitation(*args, **kwargs)

Bases: woob.capabilities.base.Enum

DZ = 'Drizzle'
GR = 'Hail'
GS = 'Small hail'
IC = 'Ice cristals'
PL = 'Ice pellets'
RA = 'Rain'
SG = 'Small grains'
SN = 'Snow'
UP = 'Unknown precipiation'
class woob.capabilities.weather.Temperature(value=NotLoaded, unit='', url=None)

Bases: woob.capabilities.base.BaseObject

Variables
  • value – (float) Temperature value

  • unit – (str) Input unit

ascelsius()
asfahrenheit()