Wrapper for communicating with the Octopus Energy API
Project description
GitHub: github.com/euanacampbell/octopus_energy_api
PyPi: pypi.org/project/octopus-energy-api
Installation
pip install octopus-energy-api
Import
from octopus_energy_api import oe_api
Usage
Create an API instance. Access details can be found using this fantastic tutorial by Guy Lipman guylipman.medium.com
from octopus_energy_api import oe_api
api_key = ""
mpan = ""
serial_number = ""
account_number = ""
energy_api = oe_api(api_key, mpan, serial_number, account_number)
To confirm this worked, the below function can be used.
energy_api.account_details()
Getting Consumption Data
from octopus_energy_api import oe_api
import datetime
energy_api = oe_api(api_key, mpan, serial_number, account_number)
today = datetime.date.today() # setting end date to today
start = today.replace(day=1) # setting start date to the beginning of the month
energy_api.get_consumption(start, today)
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
octopus_energy_api-0.4.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for octopus_energy_api-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7a07fd2ce2288406080ec0db9caac82713d5a14e11fb694124e0a2d58e3bea8 |
|
MD5 | 65708771a9ca1e877712ac96c09ac238 |
|
BLAKE2b-256 | f19120c6546b085d93224f9877d3869a13df6e8af130abba6348b27f0022ad5a |