aiooctopusenergy
Async Python client for the Octopus Energy REST API.
Installation
pip install aiooctopusenergy
Usage
import aiohttp
from aiooctopusenergy import OctopusEnergyClient
async with aiohttp.ClientSession() as session:
client = OctopusEnergyClient(api_key="sk_live_...", session=session)
# Get account details
account = await client.get_account("A-AAAA1111")
for prop in account.properties:
for meter in prop.electricity_meter_points:
print(f"MPAN: {meter.mpan}, Export: {meter.is_export}")
# Get half-hourly consumption
readings = await client.get_electricity_consumption(
mpan="1100009640372",
serial_number="22L4344979",
)
for r in readings:
print(f"{r.interval_start}: {r.consumption} kWh")
# Get Agile rates (no auth required)
rates = await client.get_electricity_rates(
product_code="AGILE-24-10-01",
tariff_code="E-1R-AGILE-24-10-01-C",
)
for rate in rates:
print(f"{rate.valid_from}: {rate.value_inc_vat}p/kWh")
# Look up Grid Supply Point
gsps = await client.get_grid_supply_points("DE45")
print(f"Region: {gsps[0].group_id}")
API Reference
OctopusEnergyClient(api_key, session=None)
get_account(account_number)— Account details with meters and tariff historyget_electricity_consumption(mpan, serial, *, period_from, period_to)— Half-hourly electricity readingsget_gas_consumption(mprn, serial, *, period_from, period_to)— Half-hourly gas readingsget_electricity_rates(product, tariff, *, period_from, period_to)— Electricity unit ratesget_electricity_standing_charges(product, tariff, *, period_from, period_to)— Electricity standing chargesget_gas_rates(product, tariff, *, period_from, period_to)— Gas unit ratesget_gas_standing_charges(product, tariff, *, period_from, period_to)— Gas standing chargesget_grid_supply_points(postcode)— GSP region lookup
Exceptions
OctopusEnergyError— Base exceptionOctopusEnergyAuthenticationError— Invalid API key (HTTP 401)OctopusEnergyNotFoundError— Resource not found (HTTP 404)OctopusEnergyConnectionError— Network errorOctopusEnergyTimeoutError— Request timeout
License
MIT
Metadata
Release files for aiooctopusenergy 0.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aiooctopusenergy-0.4.5.tar.gz | 19.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiooctopusenergy-0.4.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.3 kB
Release files / aiooctopusenergy-0.4.5.tar.gz
| Download URL | aiooctopusenergy-0.4.5.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56d9c3be9597e43a98f29e84b0829d78f60a3f43c95f1605dd614c3108c373d4
|
|
BLAKE2b-256 checksum How to use checksums |
6d4b296ab35f74ce7474a6b6a00ea56a7a4998d93c7134d5cad9554033428d91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / aiooctopusenergy-0.4.5-py3-none-any.whl
| Download URL | aiooctopusenergy-0.4.5-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d478be7a67436ee7c938392b8933fc80d63a5f8b7c0f4cb40bdedc30aa62a7d
|
|
BLAKE2b-256 checksum How to use checksums |
08c3104fcd1517080a4f16d489d49e352f18f47f5e83b76575257aec1739812b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for aiooctopusenergy 0.4.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.