Quick Start¶
pip install git+https://github.com/AuroraEnergyResearch/aurora-amun-python-sdk
Add your Aurora Amun API key to the file $home/.aurora-api-key then import AmunSession and query the API.
from aurora.amun.client.session import AmunSession
session = AmunSession()
result = session.get_scenarios("gbr")
print(res[0])
Creating a Session¶
The AmunSession
handles credentials and connecting to the Amun API.
-
class
AmunSession
(base_url=None, token=None) Manage access to the Amun API.
By default the session will connect to the production Amun API endpoint. This can be overridden by passing the base_url into the constructor or by setting the environment variable AURORA_API_BASE_URL. This is for internal use only.
The authentication token is read from the users home directory $home/.aurora-api-key e.g. C:/Users/Joe Bloggs/.aurora-api-key. This can be overridden by passing the token into the constructor or by setting the environment variable AURORA_API_KEY.
- Parameters
base_url (string, optional) – Override the base url used to contact the Amun API. Defaults to None.
token (string, optional) – Overide the api authentication token used for API access. Defaults to None.