A Python wrapper for the Australian Bureau of Meteorology's Space Weather API.
Project description
pyspaceweather
pyspaceweather
is a Python wrapper for the Australian Bureau of Metererology's Space Weather API.
The API provides access to near real-time data from the BOM's Australian Space Weather Forecasting Centre.
Installation
pip install pyspaceweather
Usage
An API key, which you can get from the BOM, is required to use the API:
import os
from pyspaceweather import SpaceWeather
sw = SpaceWeather(os.environ["SPACEWEATHER_API_KEY"])
Each API request method is available as a method of SpaceWeather
.
For example, to get details of any magnetic alert current for the Australian region.
alert_warnings = sw.get_mag_alert()
What's returned is a list of MagAlert
objects:
[MagAlert(start_time=datetime.datetime(2015, 2, 7, 8, 45),
valid_until=datetime.datetime(2015, 2, 7, 20, 45),
g_scale=1,
description='minor')
]
Or, to get historical A-index values, you can call get_a_index()
, passing a string or datetime
object to the relevant parameters:
a_index_data = sw.get_a_index(start="2023-01-01 00:00:00", end=datetime(2023, 12, 1, 12, 30))
Documentation
You can read documentation for this wrapper at ReadTheDocs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyspaceweather-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1410d2ef7bab628e40a968498476ed65d75c63dab3322464565187a9c2da7bbf |
|
MD5 | 8f78749ee4552b4f586230a39dd2fb6b |
|
BLAKE2b-256 | 309759ef118d7da22983d91853c937916ee4a76915a88616b2da92f461266743 |