octo_api.utils

Utility functions.

Classes:

MeterPointDetails(mpan, gsp, profile_class)

Information about a meter point.

RateType(value)

Enumeration of different rate types.

Region(value)

Enumeration of different electricity supply regions.

Functions:

add_repr(cls)

Add a pretty-printed __repr__ function to the decorated attrs class.

from_iso_zulu(the_datetime)

Constructs a datetime.datetime object from an ISO 8601 format string.

namedtuple MeterPointDetails(mpan, gsp, profile_class)[source]

Bases: NamedTuple

Information about a meter point.

Fields
  1.  mpan (str) – The meter point access number.

  2.  gsp (Region) – The grid supply point/region that the meter point is located in.

  3.  profile_class (int) – The profile class of the meter point.

  • Profile Class 1 – Domestic Unrestricted Customers

  • Profile Class 2 – Domestic Economy 7 Customers

  • Profile Class 3 – Non-Domestic Unrestricted Customers

  • Profile Class 4 – Non-Domestic Economy 7 Customers

  • Profile Class 5 – Non-Domestic Maximum Demand (MD) Customers with a Peak Load Factor (LF) of less than 20%

  • Profile Class 6 – Non-Domestic Maximum Demand Customers with a Peak Load Factor between 20% and 30%

  • Profile Class 7 – Non-Domestic Maximum Demand Customers with a Peak Load Factor between 30% and 40%

  • Profile Class 8 – Non-Domestic Maximum Demand Customers with a Peak Load Factor over 40%

Information from https://www.elexon.co.uk/knowledgebase/profile-classes/

__repr__()

Return a string representation of the MeterPointDetails.

Return type

str

enum RateType(value)[source]

Bases: enum_tools.custom_enums.StrEnum

Enumeration of different rate types.

Member Type

str

Valid values are as follows:

StandingCharge = <RateType.StandingCharge: 'standing-charges'>
StandardUnitRate = <RateType.StandardUnitRate: 'standard-unit-rates'>
DayUnitRate = <RateType.DayUnitRate: 'day-unit-rates'>
NightUnitRate = <RateType.NightUnitRate: 'night-unit-rates'>
enum Region(value)[source]

Bases: enum_tools.custom_enums.StrEnum

Enumeration of different electricity supply regions.

The different regions can be seen on the following map:

Electricity Regions
Member Type

str

Valid values are as follows:

Eastern = <Region.Eastern: '_A'>
EastMidlands = <Region.EastMidlands: '_B'>
London = <Region.London: '_C'>
Merseyside = <Region.Merseyside: '_D'>
Midlands = <Region.Midlands: '_E'>
NorthEastern = <Region.NorthEastern: '_F'>
NorthWestern = <Region.NorthWestern: '_G'>
Southern = <Region.Southern: '_H'>
SouthEastern = <Region.SouthEastern: '_J'>
SouthWales = <Region.SouthWales: '_K'>
SouthWestern = <Region.SouthWestern: '_L'>
Yorkshire = <Region.Yorkshire: '_M'>
SouthScotland = <Region.SouthScotland: '_N'>
NorthScotland = <Region.NorthScotland: '_P'>
add_repr(cls)[source]

Add a pretty-printed __repr__ function to the decorated attrs class.

Parameters

cls (Type)

Return type

Type

from_iso_zulu(the_datetime)[source]

Constructs a datetime.datetime object from an ISO 8601 format string.

This function understands the character Z as meaning Zulu time (GMT/UTC).

Parameters

the_datetime (Union[str, datetime, None])

Return type

Optional[datetime]