Python Library for Amber Electric API
Description
Connects to the Amber Electric API and retrieves market, usage and pricing information
Note
This is in no way affiliated with Amber Electric.
Issues
I don't know what the usage data for an account looks like at the moment. Until I have an account with active usage data - this part of the API is going to be very light.
Logging / Debugging
This library uses logging just set the log level and format you need.
Example
The examples below may look a little complex - because this library relies on functions like .auth() and .update() being awaited.
See current market pricing
import asyncio
from amber_electric import AmberElectric
api = AmberElectric(
latitude=-37.828690,
longitude=144.997460,
)
async def display_market_pricing():
await api.market.update()
print(api.market)
asyncio.get_event_loop().run_until_complete(display_market_pricing())
Get your current pricing
import asyncio
from amber_electric import AmberElectric
api = AmberElectric(
latitude=-37.828690,
longitude=144.997460,
username="family@example.com",
password="secret"
)
async def get_account_pricing():
await api.auth()
await api.price.update()
print(api.price)
asyncio.get_event_loop().run_until_complete(get_account_pricing())
Get your current usage (WIP)
import asyncio
from amber_electric import AmberElectric
api = AmberElectric(
latitude=-37.828690,
longitude=144.997460,
username="family@example.com",
password="secret"
)
async def get_account_pricing():
await api.auth()
await api.usage.update()
print(api.usage)
asyncio.get_event_loop().run_until_complete(get_account_pricing())
Support
Metadata
Release files for amber-electric 0.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| amber-electric-0.0.17.tar.gz | 30.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amber_electric-0.0.17-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 52.7 kB
Release files / amber-electric-0.0.17.tar.gz
| Download URL | amber-electric-0.0.17.tar.gz |
|---|---|
| Size | 30.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90f1fbcfd47cd2a517c1fefe47ab664205b767a82d5f2cc45a99ade938193a80
|
|
BLAKE2b-256 checksum How to use checksums |
2001b0bf49474c61b08aa074d020b5644a6c25b2846c05ed5c1409db9a8ade1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.6
|
Release files / amber_electric-0.0.17-py2.py3-none-any.whl
| Download URL | amber_electric-0.0.17-py2.py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b9f253399a05e834651795c99e162dafe2edb8bcbe5047895273fc7ca6f9dcca
|
|
BLAKE2b-256 checksum How to use checksums |
7f27fce6499fce50486f715a3797b9d51a36d06cc80ca7f15392bec101c1930d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.6
|