Name | pyspaceweather JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | A Python wrapper for the Australian Bureau of Meteorology's Space Weather API. |
upload_time | 2024-06-25 08:51:43 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2024 Ben Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
spaceweather
space
wrapper
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pyspaceweather
[![Documentation Status](https://readthedocs.org/projects/py-spaceweather/badge/?version=latest)](https://py-spaceweather.readthedocs.io/en/latest/?badge=latest)
`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 os
from 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/).
Raw data
{
"_id": null,
"home_page": null,
"name": "pyspaceweather",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "spaceweather, space, wrapper",
"author": null,
"author_email": "Ben Nour <hello@ben-nour.com>",
"download_url": "https://files.pythonhosted.org/packages/f2/91/52d907136d6ea77d8d89006f65c5f51327dc1f80e2e13ee02ddb4c6776f0/pyspaceweather-0.1.0.tar.gz",
"platform": null,
"description": "# pyspaceweather\n\n[![Documentation Status](https://readthedocs.org/projects/py-spaceweather/badge/?version=latest)](https://py-spaceweather.readthedocs.io/en/latest/?badge=latest)\n\n\n`pyspaceweather` is a Python wrapper for the Australian Bureau of Metererology's [Space Weather API](https://sws-data.sws.bom.gov.au/).\n\nThe API provides access to near real-time data from the BOM's Australian Space Weather Forecasting Centre.\n\n## Installation\n\n```\npip install pyspaceweather\n```\n\n## Usage\n\nAn API key, which you can get from the [BOM](https://sws-data.sws.bom.gov.au/register), is required to use the API:\n\n```python\nimport os\n\nfrom pyspaceweather import SpaceWeather\n\nsw = SpaceWeather(os.environ[\"SPACEWEATHER_API_KEY\"])\n```\n\nEach [API request method](https://sws-data.sws.bom.gov.au/api-docs#overview) is available as a method of `SpaceWeather`.\n\nFor example, to get details of any magnetic alert current for the Australian region.\n\n```python\nalert_warnings = sw.get_mag_alert()\n```\n\nWhat's returned is a list of `MagAlert` objects:\n```python\n[MagAlert(start_time=datetime.datetime(2015, 2, 7, 8, 45),\nvalid_until=datetime.datetime(2015, 2, 7, 20, 45),\ng_scale=1,\ndescription='minor')\n]\n```\n\nOr, to get historical A-index values, you can call `get_a_index()`, passing a string or `datetime` object to the relevant parameters:\n\n```python\na_index_data = sw.get_a_index(start=\"2023-01-01 00:00:00\", end=datetime(2023, 12, 1, 12, 30))\n```\n\n## Documentation\n\nYou can read documentation for this wrapper at [ReadTheDocs](https://py-spaceweather.readthedocs.io/en/latest/).\n\n\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Ben Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "A Python wrapper for the Australian Bureau of Meteorology's Space Weather API.",
"version": "0.1.0",
"project_urls": {
"documentation": "https://py-spaceweather.readthedocs.io/en/latest/",
"homepage": "https://github.com/ben-n93/pyspaceweather",
"repository": "https://github.com/ben-n93/pyspaceweather"
},
"split_keywords": [
"spaceweather",
" space",
" wrapper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "309759ef118d7da22983d91853c937916ee4a76915a88616b2da92f461266743",
"md5": "8f78749ee4552b4f586230a39dd2fb6b",
"sha256": "1410d2ef7bab628e40a968498476ed65d75c63dab3322464565187a9c2da7bbf"
},
"downloads": -1,
"filename": "pyspaceweather-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8f78749ee4552b4f586230a39dd2fb6b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 7805,
"upload_time": "2024-06-25T08:51:41",
"upload_time_iso_8601": "2024-06-25T08:51:41.598822Z",
"url": "https://files.pythonhosted.org/packages/30/97/59ef118d7da22983d91853c937916ee4a76915a88616b2da92f461266743/pyspaceweather-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f29152d907136d6ea77d8d89006f65c5f51327dc1f80e2e13ee02ddb4c6776f0",
"md5": "c4b4085c293bcf6c76510eb6f4e73c54",
"sha256": "460015ac26e46cd6a9db3a3de0a0e778a4522b39745ecbf1afb9df0e1256b0c7"
},
"downloads": -1,
"filename": "pyspaceweather-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "c4b4085c293bcf6c76510eb6f4e73c54",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10120,
"upload_time": "2024-06-25T08:51:43",
"upload_time_iso_8601": "2024-06-25T08:51:43.764457Z",
"url": "https://files.pythonhosted.org/packages/f2/91/52d907136d6ea77d8d89006f65c5f51327dc1f80e2e13ee02ddb4c6776f0/pyspaceweather-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-25 08:51:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ben-n93",
"github_project": "pyspaceweather",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyspaceweather"
}