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
Built Distribution
File details
Details for the file octopus_energy_api-0.3.tar.gz
.
File metadata
- Download URL: octopus_energy_api-0.3.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82fe9c609e8c2eb008689f731abbfd91ee2b3f352368cb304e05502be06f7f04 |
|
MD5 | d2b471f29db9fe409b1ed60eb0b86bd4 |
|
BLAKE2b-256 | d40046fc5e119462c430f951dc1802f7bb85d00a196783fb6395dce9f85556b5 |
Provenance
File details
Details for the file octopus_energy_api-0.3-py3-none-any.whl
.
File metadata
- Download URL: octopus_energy_api-0.3-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad04923ed6ddb82a331721ee63879c0b5b985d957e1e9898748ce8e9871afb27 |
|
MD5 | c7c8c596a66ee4a53839919af35e5191 |
|
BLAKE2b-256 | 7d8d12177d5e1077a2e995c5a00495c8da6c672ebf47d56a0221ca8e683df670 |