Skip to main content

Weather broker for Python

Project description

weatherbroker

Weather broker for Python

License: Apache License 2.0

Warning: Refer to weather provider license about caching, storing and redistributing weather information.

Provides current weather information as an unified dict:

  • time: monitoring time, unix timestamp
  • lat: latitude
  • lon: longitude
  • clouds (%)
  • temp: temperature
  • hum: humidity (%)
  • pres: pressure
  • wind_spd: wind speed
  • wind_deg: wind degree
  • vis: visibility
  • dewp: dew point
  • uv: UV index
  • icon: icon code (provider specific)
  • description: human readable weather description
  • precip_type: precip type
  • precip_prob: precip probability (%)
  • precip_int: precip intensity
  • sunrise: HH:mm
  • sunset: HH:mm

Weather forecast is not implemented (yet).

Note: some providers may not provide certain data fields, in this case they are set to None.

The module contains providers for:

Usage example:

from weatherbroker import WeatherEngine

w = WeatherEngine()
w.set_provider('darksky')
w.key = 'my secret api key'
w.set_location(lat=50.08804, lon=14.42076)

# the code below sets the same location, but DarkSky supports only coordinates,
# so we use them instead

# w.set_location(city_id=3067696)
# w.set_location(city='Prague', country='CZ')

# w.lang = 'cs'

print(w.get_current())

(c) 2018 Altertech Group, https://www.altertech.com/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for weatherbroker, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size weatherbroker-0.0.2.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page