Skip to main content

made-with-python GitHub license

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

Two ways of creating an API instance.

Load access details in manually - Can be found using this fantastic tutorial by Guy Lipman guylipman.medium.com.

from octopus_energy_api import oe_api

account_number = ""
api_key = ""
mpan = ""
serial_number = ""

energy_api = oe_api(account_number, api_key, mpan=mpan, serial_number=serial_number)

Get mpan and serial numbers from account number + api key. (currently only works for single property accounts)

from octopus_energy_api import oe_api

api_key = "value"
account_number = "value"

energy_api = oe_api(account_number, api_key)

Account Details

energy_api.account_details()

Consumption

Getting all consumption data.

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.consumption(start, today)

Getting calculated consumption data - total, mean, and median.

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.consumption_total(start, today)

energy_api.consumption_mean(start, today)

energy_api.consumption_median(start, today)

Price of consumption.

today = datetime.today()
start = today - timedelta(days=300)

electric_rate = 2.73

energy_api.consumption_cost(start, today, electric_rate)

Products

energy_api.products()

Meter Information

energy_api.meter_point()

Metadata

Release files for octopus-energy-api 0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for octopus-energy-api 0.8
File Size Uploaded Provenance Actions
octopus_energy_api-0.8.tar.gz 4.5 kB Without provenance Details for octopus_energy_api-0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for octopus-energy-api 0.8
File Interpreter ABI Platform Actions
octopus_energy_api-0.8-py3-none-any.whl Python 3 none any Details for octopus_energy_api-0.8-py3-none-any.whl

Total release size: 9.4 kB

Release files / octopus_energy_api-0.8.tar.gz

Download URL octopus_energy_api-0.8.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
54f1bc6265276d32d76710aca77041d574660c486d0a9adbb16cd5d22e969b3f
BLAKE2b-256 checksum
How to use checksums
402f8798f159758e70c3d2f48061d0708b6d113088ed80377851940a34c42be7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / octopus_energy_api-0.8-py3-none-any.whl

Download URL octopus_energy_api-0.8-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ab95958b1aca441fc47b3d496853789d233adcb705105e9131853c164fa0665
BLAKE2b-256 checksum
How to use checksums
e5d0d36e7053a4f9cb602c98021c6237c3b2310cf93fbfa87aa18cd772abd48e
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for octopus-energy-api 0.8

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page