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. |
Metadata
Release files for weatherbug-spark 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| weatherbug_spark-0.0.3.tar.gz | 4.1 kB | Without provenance | Details for weatherbug_spark-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| weatherbug_spark-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for weatherbug_spark-0.0.3-py3-none-any.whl |
Total release size: 8.8 kB
Release files / weatherbug_spark-0.0.3.tar.gz
| Download URL | weatherbug_spark-0.0.3.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3816c8406acd43d2c9ba6dd9faa8222e3e3b0dfeca8ff9838a7ac0c8983bfd84
|
|
BLAKE2b-256 checksum How to use checksums |
9e138e4d6b6e0030405d5f2eabf637d5d5a76bd972bedf201e83cb41514126fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / weatherbug_spark-0.0.3-py3-none-any.whl
| Download URL | weatherbug_spark-0.0.3-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d229a6748be53462248590ad852339a8964351d339582cd9f0211f96f33a06a3
|
|
BLAKE2b-256 checksum How to use checksums |
cda0998513228c2b6a0f0832bbe41f34a9c14c7292dcb189a6398f1b783c918c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for weatherbug-spark 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.