pywind.bmreports

http://bmreports.com/bwx_elexon_logo_new.gif

Warning

The BM Reports website has been removed and replaced by a much more complex API interface. This page is no longer relevant and should be ignored in favour of functionality offered by the elexon module.

Warning

The data provided by the BMReports website is owned by Elexon UK and permission needs to be sought before reproducing it. The following functions should only be used with this restriction in mind as they access the site and download data.

The exact restrictions on the data usage are unclear at this time.

pywind.bmreports.generation_type

BMReports make available a number of reports, but this module provides access to their report on output by generation type for the 3 periods,

  • instant
  • last hour
  • last 24 hours
class pywind.bmreports.generation_type.GenerationData[source]

Bases: object

Class to allow access to the report and parse the response into usable structures.

PARAMS = {'element': 'generationbyfueltypetable'}
URL = 'http://www.bmreports.com/bsp/additional/soapfunctions.php'
as_dict()[source]

Return the data as a dict object.

get_data()[source]

Get data from the BM Reports website. Try 3 times.

rows()[source]

Return export data as a series of rows.

Return type:dict
save_original(filename)[source]

Save the downloaded certificate data into the filename provided.

Parameters:filename – Filename to save the file to.
Return type:bool
class pywind.bmreports.generation_type.GenerationPeriod(elm)[source]

Bases: object

The basic report contains information on 3 different periods. Each will be represented by an instance of this class.

DT1 = '%Y-%m-%d %H:%M:%S'
DT2 = '%Y-%m-%d %H:%M'
NAMES = {'LAST24H': '24hours', 'HH': 'halfhour', 'INST': 'instant'}
as_dict()[source]

Return the data as a dict.

hh(elm)[source]

Store the start and finish times for a half hour record. :param elm: the element to parse

inst(elm)[source]

Store the time for an instant record. :param elm: the element to parse

keyname()[source]

Return the full name of the tag.

last24h(elm)[source]

Store the start and finish date/time records for a 24 hour record. :param el: the element to parse

class pywind.bmreports.generation_type.GenerationRecord(el)[source]

Bases: object

Class to record details of a single generation type record.

FUELS = {'INTFR': 'Import from France', 'NUCLEAR': 'Nuclear', 'OTHER': 'Other', 'INTIRL': 'Import from Ireland', 'CCGT': 'Combined Cycle Gas Turbine', 'INTEW': 'East/West Interconnector', 'PS': 'Pumped Storage', 'OIL': 'Oil', 'NPSHYD': 'Non Pumped Storage Hydro', 'COAL': 'Coal', 'OCGT': 'Open Cycle Gas Turbine', 'INTNED': 'Import from the Netherlands', 'WIND': 'Wind'}
as_dict()[source]

Return data as a dict.

pywind.bmreports.prices

BMReports make the system electricity prices available. This module contains classes to access those reports.

class pywind.bmreports.prices.SystemPrices(dtt=None)[source]

Bases: object

Class to get the electricity prices from BMreports.

URL = 'http://www.bmreports.com/bsp/additional/soapfunctions.php'
as_dict()[source]

Return the data as a dict.

get_data()[source]

Get the data from the remote server.

rows()[source]

Generator to return rows for export.

Returns:Dict containing information for a single price period.
Return type:dict
save_original(filename)[source]

Save the downloaded certificate data into the filename provided.

Parameters:filename – Filename to save the file to.
Returns:True or False
Return type:bool

pywind.bmreports.unit

Unit data from BM Reports

class pywind.bmreports.unit.BalancingUnitData(xml_node)[source]

Bases: object

Class to store balancing payment information for a single unit during a single period.

bid_cashflow

Return the bid cashflow.

Return type:float
Returns:Bid cashflow or 0.0
bid_volume

Get the bid volume.

Return type:float
Returns:Bid volume or 0.0
offer_cashflow

Return the bid cashflow.

Return type:float
Returns:Bid cashflow or 0.0
offer_volume

Get the bid volume.

Return type:float
Returns:Bid volume or 0.0
rate(which)[source]

Extract the rate paid for either “bid” or “offer” from the data.

Parameters:which – “bid” or “offer”
Returns:The calculated rate
Return type:float
class pywind.bmreports.unit.BaseUnitClass[source]

Bases: object

Base class

SHEET_NAME = ''
XLS_URL = ''
get_list()[source]

Download and update the unit list.

Return type:bool
rows()[source]

Generator to return row data.

Returns:Dict of unit data
Return type:dict
save_original(filename)[source]

Save the downloaded certificate data into the filename provided.

Parameters:filename – Filename to save the file to.
Returns:True or False
Return type:bool
class pywind.bmreports.unit.PowerPackUnits[source]

Bases: pywind.bmreports.unit.BaseUnitClass

Download the latest Power Pack modules spreadsheet and make the list of stations available as a list.

SHEET_NAME = 'Sheet1'
XLS_URL = 'http://www.bmreports.com/bsp/staticdata/PowerPackModules.xls'
class pywind.bmreports.unit.UnitData(*args, **kwargs)[source]

Bases: object

Class that gets data about Balancing Mechanism Units from the Balancing Mechanism website.

CX_TYPE = {'E': 'Embedded in Distribution System', 'G': 'Supplier (base)', 'I': 'Interconnector User', 'M': 'Other', 'S': 'Supplier (additional)', 'T': 'Directly Connected to Transmission System'}
DURATION = {'S': 'Short', 'L': 'Long'}
HOST = 'http://www.bmreports.com'
TYPES = {'Derived': 'DerivedBMUnit', 'BSV': '/servlet/com.logica.neta.bwp_PanBsvServlet', 'Dynamic': '/servlet/com.logica.neta.bwp_PanDynamicServlet', 'Bid-Offer': '/servlet/com.logica.neta.bwp_PanBodServlet', 'Physical': '/servlet/com.logica.neta.bwp_PanBMDataServlet'}
as_dict()[source]
get_data()[source]

Get the report data and update.

Returns:True or False
Return type:bool
rows()[source]

Generator to provide export data.

Return type:dict
Returns:Dict formatted for internal export functions.
save_original(filename)[source]

Save the downloaded certificate data into the filename provided.

Parameters:filename – Filename to save the file to.
Returns:True or False
Return type:bool
class pywind.bmreports.unit.UnitList[source]

Bases: pywind.bmreports.unit.BaseUnitClass

Get a list of the Balancing Mechanism Units with their Fuel Type and dates.

SHEET_NAME = 'BMU Fuel Types'
XLS_URL = 'http://www.bmreports.com/bsp/staticdata/BMUFuelType.xls'
by_fuel_type(fuel)[source]

Return data filtered by fuel type.

Parameters:fuel – The fuel type to return details for.
Return type:list