Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ben-n93/pyspaceweather
A Python wrapper for the Australian Bureau of Meteorology's Space Weather API.
https://github.com/ben-n93/pyspaceweather
bureau-of-meteorology satellite-data space space-data space-weather
Last synced: 3 months ago
JSON representation
A Python wrapper for the Australian Bureau of Meteorology's Space Weather API.
- Host: GitHub
- URL: https://github.com/ben-n93/pyspaceweather
- Owner: ben-n93
- License: mit
- Created: 2024-06-25T07:57:08.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-29T04:14:48.000Z (4 months ago)
- Last Synced: 2024-08-02T11:30:33.783Z (3 months ago)
- Topics: bureau-of-meteorology, satellite-data, space, space-data, space-weather
- Language: Python
- Homepage: https://py-spaceweather.readthedocs.io/en/latest/
- Size: 21.5 KB
- Stars: 14
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-space - pyspaceweather - A Python wrapper for getting space weather data from Australia's Bureau of Meteorology. (Data / Data Wrangling Tools)
README
pyspaceweather
`pyspaceweather` is a Python wrapper for the Australian Bureau of Metererology's [Space Weather API](https://sws-data.sws.bom.gov.au/).
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](https://sws-data.sws.bom.gov.au/register), is required to use the API:
```python
import osfrom pyspaceweather import SpaceWeather
sw = SpaceWeather(os.environ["SPACEWEATHER_API_KEY"])
```Each [API request method](https://sws-data.sws.bom.gov.au/api-docs#overview) is available as a method of `SpaceWeather`.
For example, to get details of any magnetic alert current for the Australian region.
```python
alert_warnings = sw.get_mag_alert()
```What's returned is a list of `MagAlert` objects:
```python
[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:
```python
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](https://py-spaceweather.readthedocs.io/en/latest/).