Skip to main content

Unofficial Amber Electric API Library

Project description

Python Library for Amber Electric API

PyPI GitHub issues GitHub forks GitHub stars GitHub license Twitter

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

Buy Me A Coffee

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amber-electric-0.0.17.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

amber_electric-0.0.17-py2.py3-none-any.whl (22.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file amber-electric-0.0.17.tar.gz.

File metadata

  • Download URL: amber-electric-0.0.17.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for amber-electric-0.0.17.tar.gz
Algorithm Hash digest
SHA256 90f1fbcfd47cd2a517c1fefe47ab664205b767a82d5f2cc45a99ade938193a80
MD5 5b589a46e6574f586d8b4f93fbd00296
BLAKE2b-256 2001b0bf49474c61b08aa074d020b5644a6c25b2846c05ed5c1409db9a8ade1d

See more details on using hashes here.

File details

Details for the file amber_electric-0.0.17-py2.py3-none-any.whl.

File metadata

  • Download URL: amber_electric-0.0.17-py2.py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for amber_electric-0.0.17-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b9f253399a05e834651795c99e162dafe2edb8bcbe5047895273fc7ca6f9dcca
MD5 0b7300077660b85a7719dfcefed28bce
BLAKE2b-256 7f27fce6499fce50486f715a3797b9d51a36d06cc80ca7f15392bec101c1930d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page