Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.87 KB

readme.md

File metadata and controls

50 lines (35 loc) · 1.87 KB

Octopus Energy Python API Client Library

A Client library for accessing the Octopus Energy APIs

Warning: The API is currently undergoing active development and should be considered unstable, even volatile until it reaches version 1.0.0

PyPI version PyPI - Python Version

Build Status Coverage Status

Installation

octopus-energy can be installed from PyPI using pip:

pip install octopus-energy

Code

The code is available in the octopus-energy repository on GitHub

Features

  • Get energy consumption from SMETS1 and SMETS2 electricity and gas meters.

Quickstart

You can obtain your API token and meter information from the Octopus Energy Developer Dashboard.

REST Client Wrapper

The REST client wrapper is a slim shim over the REST API that returns dictionaries as responses.

Note that you should reference the Octopus Energy API documentation for detailed notes on the API responses
and specifics around the request parameters.

from octopus_energy import OctopusEnergyRestClient

api_token="sk_live_your-token"
mprn = "your-mprn"
serial_number = "your-meter-serial-number"

async with OctopusEnergyRestClient(api_token) as client:
  consumption = await client.get_gas_consumption_v1(mprn, serial_number)