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 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
Requirements.
Python 3.7+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
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:
import amberelectric
Building
Build via Poetry
poetry build
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
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 | GET /sites/{siteId}/prices/current | |
| AmberApi | get_current_renewables | GET /state/{state}/renewables/current | |
| AmberApi | get_prices | GET /sites/{siteId}/prices | |
| AmberApi | get_sites | GET /sites | |
| AmberApi | get_usage | GET /sites/{siteId}/usage |
Documentation For Models
- ActualInterval
- ActualRenewable
- AdvancedPrice
- BaseInterval
- BaseRenewable
- Channel
- ChannelType
- CurrentInterval
- CurrentRenewable
- ForecastInterval
- ForecastRenewable
- Interval
- PriceDescriptor
- Range
- Renewable
- RenewableDescriptor
- Site
- SiteStatus
- SpikeStatus
- TariffInformation
- Usage
Documentation For Authorization
Authentication schemes defined for the API:
apiKey
- Type: Bearer authentication
Author
Release files for amberelectric 2.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| amberelectric-2.0.12.tar.gz | 35.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amberelectric-2.0.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 100.1 kB
Release files / amberelectric-2.0.12.tar.gz
| Download URL | amberelectric-2.0.12.tar.gz |
|---|---|
| Size | 35.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2970a8c0e59643b830606d8d7d2f12ced24f73be572016b7d0356f5479fdcc20
|
|
BLAKE2b-256 checksum How to use checksums |
647f1a99b7cb64588df60fd54509b7ab5b3ff8019833fb341d4dbf5f2fdf8c0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / amberelectric-2.0.12-py3-none-any.whl
| Download URL | amberelectric-2.0.12-py3-none-any.whl |
|---|---|
| Size | 64.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67173c6544beba572ab93f43a23fe07c9f66eb12d7b561f8b8021ea71182b3b5
|
|
BLAKE2b-256 checksum How to use checksums |
f38772eb475334fb5bbbd5a5e29253cc5f0dea5c67ff6071aa4f913792c51ee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|