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.

Source Distribution

weatherbroker-0.0.2.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file weatherbroker-0.0.2.tar.gz.

File metadata

  • Download URL: weatherbroker-0.0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for weatherbroker-0.0.2.tar.gz
Algorithm Hash digest
SHA256 704bc6b2f48fd8f1374a1cbf110ef21b501dbd29d299590f5dfbb57f0fd50015
MD5 b05bd7a7bf037d9f00e4df52fa592378
BLAKE2b-256 fcda20b5b9f9a4d39c2c3ef0cd9c9f89c1e7382a81c8808af436af64c7edcdf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page