sttp.metadata.record package

Submodules

sttp.metadata.record.device module

class sttp.metadata.record.device.DeviceRecord(nodeid: UUID, deviceid: UUID, acronym: str, name: str, accessid: int, parentacronym: str = Ellipsis, protocolname: str = Ellipsis, framespersecond: int = Ellipsis, companyacronym: str = Ellipsis, vendoracronym: str = Ellipsis, vendordevicename: str = Ellipsis, longitude: Decimal = Ellipsis, latitude: Decimal = Ellipsis, updatedon: datetime = Ellipsis)[source]

Bases: object

Represents a record of device metadata in the STTP.

DEFAULT_COMPANYNAME = ''
DEFAULT_FRAMESPERSECOND = 30
DEFAULT_LATITUDE = Decimal('0')
DEFAULT_LONGITUDE = Decimal('0')
DEFAULT_PARENTACRONYM = ''
DEFAULT_PROTOCOLNAME = ''
DEFAULT_UPDATEDON = datetime.datetime(1, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)
DEFAULT_VENDORACRONYM = ''
DEFAULT_VENDORDEVICENAME = ''
property accessid: int

Gets the access ID (a.k.a. ID code) for this DeviceRecord.

property acronym: str

Gets the unique alpha-numeric identifier for this DeviceRecord.

property companyacronym: str

Gets the acronym of the company associated with this DeviceRecord.

property deviceid: UUID

Gets the unique guid-based identifier for this DeviceRecord.

property framespersecond: int

Gets the data reporting rate, in data frames per second, for this DeviceRecord.

property latitude: Decimal

Gets the latitude of this DeviceRecord.

property longitude: Decimal

Gets the longitude of this DeviceRecord.

measurements: Set[MeasurementRecord]

Gets MeasurementRecord values associated with this DeviceRecord.

property name: str

Gets the free form name of this DeviceRecord.

property nodeid: UUID

Gets the guid-based STTP node identifier for this DeviceRecord.

property parentacronym: str

Gets the parent device alpha-numeric identifier for this DeviceRecord, if any.

phasors: Set[PhasorRecord]

Gets PhasorRecord values associated with this DeviceRecord.

property protocolname: str

Gets the name of the source protocol for this DeviceRecord.

property updatedon: datetime

Gets the datetime of when this DeviceRecord was last updated.

property vendoracronym: str

Gets the acronym of the vendor associated with this DeviceRecord.

property vendordevicename: str

Gets the acronym of the vendor device name associated with this DeviceRecord.

sttp.metadata.record.measurement module

class sttp.metadata.record.measurement.MeasurementRecord(signalid: UUID, adder: float64 = Ellipsis, multiplier: float64 = Ellipsis, id: uint64 = Ellipsis, source: str = Ellipsis, signalacronym: str = Ellipsis, signalreference: str = Ellipsis, pointtag: str = Ellipsis, deviceacronym: str = Ellipsis, description: str = Ellipsis, updatedon: datetime = Ellipsis)[source]

Bases: object

Represents a record of measurement metadata in the STTP.

Note

The MeasurementRecord defines ancillary information associated with a Measurement. Metadata gets cached in a registry associated with a DataSubscriber.

DEFAULT_ADDER = 0.0
DEFAULT_DESCRIPTION = ''
DEFAULT_DEVICEACRONYM = ''
DEFAULT_ID = 0
DEFAULT_MULTIPLIER = 1.0
DEFAULT_POINTTAG = ''
DEFAULT_SIGNALACRONYM = 'UNKN'
DEFAULT_SIGNALID = UUID('00000000-0000-0000-0000-000000000000')
DEFAULT_SIGNALREFERENCE = ''
DEFAULT_SOURCE = ''
DEFAULT_UPDATEDON = datetime.datetime(1, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)
property adder: float64

Gets the additive value modifier. Allows for linear value adjustment. Defaults to zero.

property description: str

Gets the description for this MeasurementRecord.

device: DeviceRecord | None

Defines the associated DeviceRecord for this MeasurementRecord. Set to None if not applicable.

property deviceacronym: str

Gets the alpha-numeric identifier of the associated device for this MeasurementRecord.

property id: uint64

Gets the STTP numeric ID number (from measurement key) for this MeasurementRecord.

property multiplier: float64

Gets the multiplicative value modifier. Allows for linear value adjustment. Defaults to one.

phasor: PhasorRecord | None

Defines the associated PhasorRecord for this MeasurementRecord. Set to None if not applicable.

phasorsourceindex

Defines any source index for associated phasors in this MeasurementRecord.

property pointtag: str

Gets the unique point tag for this MeasurementRecord.

property signalacronym: str

Gets the signal type acronym for this MeasurementRecord, e.g., “FREQ”.

property signalid: UUID

Gets the unique guid-based signal identifier for this MeasurementRecord.

property signalreference: str

Gets the unique signal reference for this MeasurementRecord.

property signaltype: SignalType

Gets the SignalType enumeration for this MeasurementRecord, if it can be parsed from signalacronym; otherwise, returns SignalType.UNKN.

property signaltypename: str

Gets the signal type acronym for this MeasurementRecord, e.g., “FREQ”.

Deprecated since version Use: signalacronym instead.

property source: str

Gets the STTP source instance (from measurement key) for this MeasurementRecord.

property updatedon: datetime

Gets the datetime of when this MeasurementRecord was last updated.

sttp.metadata.record.phasor module

class sttp.metadata.record.phasor.CompositePhasorMeasurement(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

ANGLE = 0
MAGNITUDE = 1
class sttp.metadata.record.phasor.PhasorRecord(id: int, deviceacronym: str, label: str, type: str, phase: str, sourceindex: int, basekv: int = Ellipsis, updatedon: datetime = Ellipsis)[source]

Bases: object

Represents a record of phasor metadata in the STTP.

DEFAULT_BASEKV = 500
DEFAULT_PHASE = '+'
DEFAULT_TYPE = 'V'
DEFAULT_UPDATEDON = datetime.datetime(1, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)
property angle_measurement: MeasurementRecord | None

Gets the associated angle MeasurementRecord, or None if not available.

property basekv: int

Gets the base, i.e., nominal, kV level for this PhasorRecord.

device: DeviceRecord | None

Defines the associated DeviceRecord for this PhasorRecord.

property deviceacronym: str

Gets the alpha-numeric identifier of the associated device for this PhasorRecord.

property id: int

Gets the unique integer identifier for this PhasorRecord.

property label: str

Gets the free form label for this PhasorRecord.

property magnitude_measurement: MeasurementRecord | None

Gets the associated magnitude MeasurementRecord, or None if not available.

measurements: List[MeasurementRecord]

Defines the two MeasurementRecord values, i.e., the angle and magnitude, associated with this PhasorRecord.

property phase: str

Gets the phase of this PhasorRecord, e.g., “A”, “B”, “C”, “+”, “-”, “0”, etc.

property sourceindex: int

Gets the source index, i.e., the 1-based ordering index of the phasor in its original context, for this PhasorRecord.

property type: str

Gets the phasor type, i.e., “I” or “V”, for current or voltage, respectively, for this PhasorRecord.

property updatedon: datetime

Gets the datetime of when this PhasorRecord was last updated.

Module contents