# amberelectric
Amber is an Australian-based electricity retailer that pass through the real-time wholesale price of energy.
Because of Amber's wholesale power prices, you can save hundreds of dollars a year by automating high power devices like air-conditioners, heat pumps and pool pumps.
This Python library provides an interface to the API, allowing you to react to current and forecast prices, as well as download your historic usage.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 2.0.0
- Package version: 2.0.12
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
For more information, please visit [https://www.amber.com.au](https://www.amber.com.au)
## Requirements.
Python 3.7+
## Installation & Usage
### pip install
If the python package is hosted on a repository, you can install directly using:
```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
Then import the package:
```python
import amberelectric
```
### Building
Build via Poetry
```sh
poetry build
```
### Tests
Execute `pytest` to run the tests.
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
import time
import amberelectric
from amberelectric.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.amber.com.au/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = amberelectric.Configuration(
host = "https://api.amber.com.au/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: apiKey
configuration = amberelectric.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with amberelectric.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = amberelectric.AmberApi(api_client)
site_id = '01J23BAP2SFA218BMV8A73Y9Z9' # str | ID of the site you are fetching prices for. Can be found using the `/sites` enpoint
next = 48 # int | Return the _next_ number of forecast intervals (optional)
previous = 48 # int | Return the _previous_ number of actual intervals. (optional)
resolution = 56 # int | Specify the required interval duration resolution. Valid options: 5, 30. Default: Your billing interval length. (optional)
try:
api_response = api_instance.get_current_prices(site_id, next=next, previous=previous, resolution=resolution)
print("The response of AmberApi->get_current_prices:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AmberApi->get_current_prices: %s\n" % e)
```
## Documentation for API Endpoints
All URIs are relative to *https://api.amber.com.au/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AmberApi* | [**get_current_prices**](docs/AmberApi.md#get_current_prices) | **GET** /sites/{siteId}/prices/current |
*AmberApi* | [**get_current_renewables**](docs/AmberApi.md#get_current_renewables) | **GET** /state/{state}/renewables/current |
*AmberApi* | [**get_prices**](docs/AmberApi.md#get_prices) | **GET** /sites/{siteId}/prices |
*AmberApi* | [**get_sites**](docs/AmberApi.md#get_sites) | **GET** /sites |
*AmberApi* | [**get_usage**](docs/AmberApi.md#get_usage) | **GET** /sites/{siteId}/usage |
## Documentation For Models
- [ActualInterval](docs/ActualInterval.md)
- [ActualRenewable](docs/ActualRenewable.md)
- [AdvancedPrice](docs/AdvancedPrice.md)
- [BaseInterval](docs/BaseInterval.md)
- [BaseRenewable](docs/BaseRenewable.md)
- [Channel](docs/Channel.md)
- [ChannelType](docs/ChannelType.md)
- [CurrentInterval](docs/CurrentInterval.md)
- [CurrentRenewable](docs/CurrentRenewable.md)
- [ForecastInterval](docs/ForecastInterval.md)
- [ForecastRenewable](docs/ForecastRenewable.md)
- [Interval](docs/Interval.md)
- [PriceDescriptor](docs/PriceDescriptor.md)
- [Range](docs/Range.md)
- [Renewable](docs/Renewable.md)
- [RenewableDescriptor](docs/RenewableDescriptor.md)
- [Site](docs/Site.md)
- [SiteStatus](docs/SiteStatus.md)
- [SpikeStatus](docs/SpikeStatus.md)
- [TariffInformation](docs/TariffInformation.md)
- [Usage](docs/Usage.md)
<a id="documentation-for-authorization"></a>
## Documentation For Authorization
Authentication schemes defined for the API:
<a id="apiKey"></a>
### apiKey
- **Type**: Bearer authentication
## Author
dev@amber.com.au
Raw data
{
"_id": null,
"home_page": "https://github.com/madpilot/amberelectric.py",
"name": "amberelectric",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": null,
"keywords": "OpenAPI, OpenAPI-Generator, Amber Electric Public API",
"author": "Amber Electric Development Team",
"author_email": "dev@amber.com.au",
"download_url": "https://files.pythonhosted.org/packages/64/7f/1a99b7cb64588df60fd54509b7ab5b3ff8019833fb341d4dbf5f2fdf8c0a/amberelectric-2.0.12.tar.gz",
"platform": null,
"description": "# amberelectric\nAmber is an Australian-based electricity retailer that pass through the real-time wholesale price of energy.\n\nBecause of Amber's wholesale power prices, you can save hundreds of dollars a year by automating high power devices like air-conditioners, heat pumps and pool pumps.\n\nThis Python library provides an interface to the API, allowing you to react to current and forecast prices, as well as download your historic usage.\n\nThis Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:\n\n- API version: 2.0.0\n- Package version: 2.0.12\n- Generator version: 7.10.0\n- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen\nFor more information, please visit [https://www.amber.com.au](https://www.amber.com.au)\n\n## Requirements.\n\nPython 3.7+\n\n## Installation & Usage\n### pip install\n\nIf the python package is hosted on a repository, you can install directly using:\n\n```sh\npip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git\n```\n(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)\n\nThen import the package:\n```python\nimport amberelectric\n```\n\n### Building\n\nBuild via Poetry\n\n```sh\npoetry build\n```\n\n### Tests\n\nExecute `pytest` to run the tests.\n\n## Getting Started\n\nPlease follow the [installation procedure](#installation--usage) and then run the following:\n\n```python\n\nimport time\nimport amberelectric\nfrom amberelectric.rest import ApiException\nfrom pprint import pprint\n\n# Defining the host is optional and defaults to https://api.amber.com.au/v1\n# See configuration.py for a list of all supported configuration parameters.\nconfiguration = amberelectric.Configuration(\n host = \"https://api.amber.com.au/v1\"\n)\n\n# The client must configure the authentication and authorization parameters\n# in accordance with the API server security policy.\n# Examples for each auth method are provided below, use the example that\n# satisfies your auth use case.\n\n# Configure Bearer authorization: apiKey\nconfiguration = amberelectric.Configuration(\n access_token = os.environ[\"BEARER_TOKEN\"]\n)\n\n\n# Enter a context with an instance of the API client\nwith amberelectric.ApiClient(configuration) as api_client:\n # Create an instance of the API class\n api_instance = amberelectric.AmberApi(api_client)\n site_id = '01J23BAP2SFA218BMV8A73Y9Z9' # str | ID of the site you are fetching prices for. Can be found using the `/sites` enpoint\n next = 48 # int | Return the _next_ number of forecast intervals (optional)\n previous = 48 # int | Return the _previous_ number of actual intervals. (optional)\n resolution = 56 # int | Specify the required interval duration resolution. Valid options: 5, 30. Default: Your billing interval length. (optional)\n\n try:\n api_response = api_instance.get_current_prices(site_id, next=next, previous=previous, resolution=resolution)\n print(\"The response of AmberApi->get_current_prices:\\n\")\n pprint(api_response)\n except ApiException as e:\n print(\"Exception when calling AmberApi->get_current_prices: %s\\n\" % e)\n\n```\n\n## Documentation for API Endpoints\n\nAll URIs are relative to *https://api.amber.com.au/v1*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n*AmberApi* | [**get_current_prices**](docs/AmberApi.md#get_current_prices) | **GET** /sites/{siteId}/prices/current | \n*AmberApi* | [**get_current_renewables**](docs/AmberApi.md#get_current_renewables) | **GET** /state/{state}/renewables/current | \n*AmberApi* | [**get_prices**](docs/AmberApi.md#get_prices) | **GET** /sites/{siteId}/prices | \n*AmberApi* | [**get_sites**](docs/AmberApi.md#get_sites) | **GET** /sites | \n*AmberApi* | [**get_usage**](docs/AmberApi.md#get_usage) | **GET** /sites/{siteId}/usage | \n\n\n## Documentation For Models\n\n - [ActualInterval](docs/ActualInterval.md)\n - [ActualRenewable](docs/ActualRenewable.md)\n - [AdvancedPrice](docs/AdvancedPrice.md)\n - [BaseInterval](docs/BaseInterval.md)\n - [BaseRenewable](docs/BaseRenewable.md)\n - [Channel](docs/Channel.md)\n - [ChannelType](docs/ChannelType.md)\n - [CurrentInterval](docs/CurrentInterval.md)\n - [CurrentRenewable](docs/CurrentRenewable.md)\n - [ForecastInterval](docs/ForecastInterval.md)\n - [ForecastRenewable](docs/ForecastRenewable.md)\n - [Interval](docs/Interval.md)\n - [PriceDescriptor](docs/PriceDescriptor.md)\n - [Range](docs/Range.md)\n - [Renewable](docs/Renewable.md)\n - [RenewableDescriptor](docs/RenewableDescriptor.md)\n - [Site](docs/Site.md)\n - [SiteStatus](docs/SiteStatus.md)\n - [SpikeStatus](docs/SpikeStatus.md)\n - [TariffInformation](docs/TariffInformation.md)\n - [Usage](docs/Usage.md)\n\n\n<a id=\"documentation-for-authorization\"></a>\n## Documentation For Authorization\n\n\nAuthentication schemes defined for the API:\n<a id=\"apiKey\"></a>\n### apiKey\n\n- **Type**: Bearer authentication\n\n\n## Author\n\ndev@amber.com.au\n\n\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Amber Electric Public API",
"version": "2.0.12",
"project_urls": {
"Homepage": "https://github.com/madpilot/amberelectric.py",
"Repository": "https://github.com/madpilot/amberelectric.py"
},
"split_keywords": [
"openapi",
" openapi-generator",
" amber electric public api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f38772eb475334fb5bbbd5a5e29253cc5f0dea5c67ff6071aa4f913792c51ee3",
"md5": "3dd5d83c33ed9073a059048f06a7b8f0",
"sha256": "67173c6544beba572ab93f43a23fe07c9f66eb12d7b561f8b8021ea71182b3b5"
},
"downloads": -1,
"filename": "amberelectric-2.0.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3dd5d83c33ed9073a059048f06a7b8f0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 64877,
"upload_time": "2024-11-19T10:35:00",
"upload_time_iso_8601": "2024-11-19T10:35:00.251823Z",
"url": "https://files.pythonhosted.org/packages/f3/87/72eb475334fb5bbbd5a5e29253cc5f0dea5c67ff6071aa4f913792c51ee3/amberelectric-2.0.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "647f1a99b7cb64588df60fd54509b7ab5b3ff8019833fb341d4dbf5f2fdf8c0a",
"md5": "f1ca28cf019758932ca1f10ef37a0a03",
"sha256": "2970a8c0e59643b830606d8d7d2f12ced24f73be572016b7d0356f5479fdcc20"
},
"downloads": -1,
"filename": "amberelectric-2.0.12.tar.gz",
"has_sig": false,
"md5_digest": "f1ca28cf019758932ca1f10ef37a0a03",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 35199,
"upload_time": "2024-11-19T10:35:02",
"upload_time_iso_8601": "2024-11-19T10:35:02.573396Z",
"url": "https://files.pythonhosted.org/packages/64/7f/1a99b7cb64588df60fd54509b7ab5b3ff8019833fb341d4dbf5f2fdf8c0a/amberelectric-2.0.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-19 10:35:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "madpilot",
"github_project": "amberelectric.py",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "python_dateutil",
"specs": [
[
">=",
"2.5.3"
]
]
},
{
"name": "setuptools",
"specs": [
[
">=",
"21.0.0"
]
]
},
{
"name": "urllib3",
"specs": [
[
">=",
"1.25.3"
]
]
},
{
"name": "pydantic",
"specs": [
[
">=",
"1.10.5"
]
]
},
{
"name": "aenum",
"specs": [
[
">=",
"3.1.11"
]
]
}
],
"tox": true,
"lcname": "amberelectric"
}