Skip to main content

Wrapper for WeatherBug Spark API

Project description

WeatherBug Spark

A library for interacting with the WeatherBug Spark service to get the lightning strike locations and closest lightning strike distance.

WeatherBug Spark is a service that can detect both cloud-to-ground and in-cloud lightning made possible by the WeatherBug's proprietary Total Lightning Network™.

Installation

Linux:

python3 -m pip install weatherbug_spark

Windows:

py -m pip install weatherbug_spark

Usage

import asyncio
import weatherbug_spark

async def main():
    data = await weatherbug_spark.get_data(latitude=42.3601, longitude=-71.0589)

    # Get the closest strike distance
    print(data.closestPulseDistance) # float

    # Get the local lightning strike locations
    print(data.pulseListAlert) # List of LightningStrike objects

    # Get the global lightning strike locations
    print(data.pulseListGlobal) # List of LightningStrike objects

    # Get the short message
    print(data.shortMessage) # Monitor Storms

    # Get the long message
    print(data.safetyMessage) # You are not in immediate danger now, but stay alert and frequently check WeatherBug ...

    # Get the hex code for the color of the alert
    print(data.alertColor) # #F0D701

if __name__ == "__main__":
    asyncio.run(main())

Classes

get_data returns a SparkResult object, with included LightningStrike objects.

SparkResult

Field Type Description
alertCode int The alert code. The higher the number, the closer the strikes.
alertColor str The hex code for the color of the alert.
closestPulseDistance float The closest lightning strike distance in miles.
closestPulseDirection float The closest lightning strike direction in degrees.
pulseListAlert list[LightningStrike] The local lightning strike locations.
pulseListGlobal list[LightningStrike] The global lightning strike locations.
shortMessage str The short message.
safetyMessage str The long message.

LightningStrike

Field Type Description
latitude float The latitude of the lightning strike.
longitude float The longitude of the lightning strike.
dateTimeUtc int The date and time of the lightning strike in UTC.
dateTimeUtcStr str The date and time of the lightning strike in UTC as a string.
dateTimeLocalStr str The date and time of the lightning strike in local time as a string.

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

weatherbug_spark-0.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weatherbug_spark-0.0.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file weatherbug_spark-0.0.1.tar.gz.

File metadata

  • Download URL: weatherbug_spark-0.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

File hashes

Hashes for weatherbug_spark-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5fa80fab2cffec8a91efcb8ff329f22909b4fe6c9732a3e5e0f75df172cb644c
MD5 f2c22e8ad8b2e14f495577ef6fe8bc4a
BLAKE2b-256 1ad83b24063c874b01565c881da86ba45156e429dbed67d5fea76bf2df95a162

See more details on using hashes here.

File details

Details for the file weatherbug_spark-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: weatherbug_spark-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

File hashes

Hashes for weatherbug_spark-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f2bf00e91c5b8799f968ada259e08603d484d36c928e8673cd3e83b9203b19b
MD5 6e6faf5ef24d10c766a81f61f05f8417
BLAKE2b-256 80c9918596dd55ca9d887a890932835ebe9f967afb1d00b4d9f646617975677c

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