Skip to content

Instantly share code, notes, and snippets.

View JohnMacrae's full-sized avatar
💭
I may be slow to respond.

John JohnMacrae

💭
I may be slow to respond.
View GitHub Profile
@JohnMacrae
JohnMacrae / client.py
Created October 7, 2020 11:11 — forked from codeinthehole/client.py
Sample Python client for working with the Octopus Energy REST API
# Requires the requests library (install with 'pip install requests')
import requests
class APIClient(object):
BASE_URL = "https://api.octopus.energy/v1"
class DataUnavailable(Exception):
"""
Catch-all exception indicating we can't get data back from the API