Skip to content

Instantly share code, notes, and snippets.

View marksie1988's full-sized avatar

Steven Marks marksie1988

View GitHub Profile
@codeinthehole
codeinthehole / client.py
Last active July 27, 2023 07:40
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