Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Files

Latest commit

0cc4da3 · Oct 26, 2021

History

History
52 lines (40 loc) · 1.23 KB

README.md

File metadata and controls

52 lines (40 loc) · 1.23 KB

pyelexon

Simple python wrapper for the Elexon BMRS API.

Code style: black pre-commit

Getting started

  • Register on the Elexon BMRS data portal and retrieve your api_key

  • Example usage

from datetime import date
from pyelexon import Elexon

api_key = "123456"
report = "DETSYSPRICES"
params = {
    "settlement_date": "2021-01-01",
    "settlement_period": 1
}

elexon = Elexon(api_key)
# returns content of response
r: bytes = elexon.fetch_data(report, params)

Example with report specific method

from datetime import date
from pyelexon import Elexon

api_key = "123456"
report = "DETSYSPRICES"


elexon = Elexon(api_key)
# returns content of response
r: bytes = elexon.get_detsysprices(
    report,
    settlement_date=date(2021, 1, 1),
    settlement_period=1
)

Tested reports

  • DETSYSPRICES
  • DYNBMDATA
  • PHYBMDATA