sttp package
Subpackages
- sttp.data package
- Submodules
- sttp.data.callbackerrorlistener module
- sttp.data.columnexpression module
- sttp.data.constants module
EXPRESSIONVALUETYPELEN
ExpressionFunctionType
ExpressionFunctionType.ABS
ExpressionFunctionType.CEILING
ExpressionFunctionType.COALESCE
ExpressionFunctionType.CONTAINS
ExpressionFunctionType.CONVERT
ExpressionFunctionType.DATEADD
ExpressionFunctionType.DATEDIFF
ExpressionFunctionType.DATEPART
ExpressionFunctionType.ENDSWITH
ExpressionFunctionType.FLOOR
ExpressionFunctionType.IIF
ExpressionFunctionType.INDEXOF
ExpressionFunctionType.ISDATE
ExpressionFunctionType.ISGUID
ExpressionFunctionType.ISINTEGER
ExpressionFunctionType.ISNULL
ExpressionFunctionType.ISNUMERIC
ExpressionFunctionType.LASTINDEXOF
ExpressionFunctionType.LEN
ExpressionFunctionType.LOWER
ExpressionFunctionType.MAXOF
ExpressionFunctionType.MINOF
ExpressionFunctionType.NOW
ExpressionFunctionType.NTHINDEXOF
ExpressionFunctionType.POWER
ExpressionFunctionType.REGEXMATCH
ExpressionFunctionType.REGEXVAL
ExpressionFunctionType.REPLACE
ExpressionFunctionType.REVERSE
ExpressionFunctionType.ROUND
ExpressionFunctionType.SPLIT
ExpressionFunctionType.SQRT
ExpressionFunctionType.STARTSWITH
ExpressionFunctionType.STRCMP
ExpressionFunctionType.STRCOUNT
ExpressionFunctionType.SUBSTR
ExpressionFunctionType.TRIM
ExpressionFunctionType.TRIMLEFT
ExpressionFunctionType.TRIMRIGHT
ExpressionFunctionType.UPPER
ExpressionFunctionType.UTCNOW
ExpressionOperatorType
ExpressionOperatorType.ADD
ExpressionOperatorType.AND
ExpressionOperatorType.BITSHIFTLEFT
ExpressionOperatorType.BITSHIFTRIGHT
ExpressionOperatorType.BITWISEAND
ExpressionOperatorType.BITWISEOR
ExpressionOperatorType.BITWISEXOR
ExpressionOperatorType.DIVIDE
ExpressionOperatorType.EQUAL
ExpressionOperatorType.EQUALEXACTMATCH
ExpressionOperatorType.GREATERTHAN
ExpressionOperatorType.GREATERTHANOREQUAL
ExpressionOperatorType.ISNOTNULL
ExpressionOperatorType.ISNULL
ExpressionOperatorType.LESSTHAN
ExpressionOperatorType.LESSTHANOREQUAL
ExpressionOperatorType.LIKE
ExpressionOperatorType.LIKEEXACTMATCH
ExpressionOperatorType.MODULUS
ExpressionOperatorType.MULTIPLY
ExpressionOperatorType.NOTEQUAL
ExpressionOperatorType.NOTEQUALEXACTMATCH
ExpressionOperatorType.NOTLIKE
ExpressionOperatorType.NOTLIKEEXACTMATCH
ExpressionOperatorType.OR
ExpressionOperatorType.SUBTRACT
ExpressionType
ExpressionUnaryType
ExpressionValueType
TimeInterval
derive_arithmetic_operationvaluetype()
derive_arithmetic_operationvaluetype_fromboolean()
derive_arithmetic_operationvaluetype_fromdecimal()
derive_arithmetic_operationvaluetype_fromdouble()
derive_arithmetic_operationvaluetype_fromint32()
derive_arithmetic_operationvaluetype_fromint64()
derive_boolean_operationvaluetype()
derive_comparison_operationvaluetype()
derive_comparison_operationvaluetype_fromboolean()
derive_comparison_operationvaluetype_fromdatetime()
derive_comparison_operationvaluetype_fromdecimal()
derive_comparison_operationvaluetype_fromdouble()
derive_comparison_operationvaluetype_fromguid()
derive_comparison_operationvaluetype_fromint32()
derive_comparison_operationvaluetype_fromint64()
derive_integer_operationvaluetype()
derive_integer_operationvaluetype_fromboolean()
derive_integer_operationvaluetype_fromint32()
derive_integer_operationvaluetype_fromint64()
derive_operationvaluetype()
is_integertype()
is_numerictype()
- sttp.data.datacolumn module
- sttp.data.datarow module
DataRow
DataRow.booleanvalue()
DataRow.booleanvalue_byname()
DataRow.columnvalue_as_string()
DataRow.compare_datarowcolumns()
DataRow.datetimevalue()
DataRow.datetimevalue_byname()
DataRow.decimalvalue()
DataRow.decimalvalue_byname()
DataRow.doublevalue()
DataRow.doublevalue_byname()
DataRow.guidvalue()
DataRow.guidvalue_byname()
DataRow.int16value()
DataRow.int16value_byname()
DataRow.int32value()
DataRow.int32value_byname()
DataRow.int64value()
DataRow.int64value_byname()
DataRow.int8value()
DataRow.int8value_byname()
DataRow.parent
DataRow.set_value()
DataRow.set_value_byname()
DataRow.singlevalue()
DataRow.singlevalue_byname()
DataRow.stringvalue()
DataRow.stringvalue_byname()
DataRow.uint16value()
DataRow.uint16value_byname()
DataRow.uint32value()
DataRow.uint32value_byname()
DataRow.uint64value()
DataRow.uint64value_byname()
DataRow.uint8value()
DataRow.uint8value_byname()
DataRow.value()
DataRow.value_as_string()
DataRow.value_as_string_byname()
DataRow.value_byname()
- sttp.data.dataset module
- sttp.data.datatable module
DataTable
DataTable.add_column()
DataTable.add_row()
DataTable.clear_columns()
DataTable.clear_rows()
DataTable.clone_column()
DataTable.clone_row()
DataTable.column()
DataTable.column_byname()
DataTable.columncount
DataTable.columnindex()
DataTable.create_column()
DataTable.create_row()
DataTable.name
DataTable.parent
DataTable.row()
DataTable.rowcount
DataTable.rowswhere()
DataTable.rowvalue_as_string()
DataTable.rowvalue_as_string_byname()
DataTable.select()
- sttp.data.datatype module
- sttp.data.errors module
- sttp.data.expression module
- sttp.data.expressiontree module
- sttp.data.filterexpressionparser module
FilterExpressionParser
FilterExpressionParser.dataset
FilterExpressionParser.enterExpression()
FilterExpressionParser.enterFilterExpressionStatement()
FilterExpressionParser.enterFilterStatement()
FilterExpressionParser.evaluate()
FilterExpressionParser.evaluate_datarowexpression()
FilterExpressionParser.evaluate_expression()
FilterExpressionParser.exitColumnName()
FilterExpressionParser.exitExpression()
FilterExpressionParser.exitFunctionExpression()
FilterExpressionParser.exitIdentifierStatement()
FilterExpressionParser.exitLiteralValue()
FilterExpressionParser.exitPredicateExpression()
FilterExpressionParser.exitValueExpression()
FilterExpressionParser.expressiontrees
FilterExpressionParser.filtered_rows
FilterExpressionParser.filtered_rowset
FilterExpressionParser.filtered_signalids
FilterExpressionParser.filtered_signalidset
FilterExpressionParser.filterexpression_statementcount
FilterExpressionParser.from_dataset()
FilterExpressionParser.generate_expressiontree()
FilterExpressionParser.generate_expressiontrees()
FilterExpressionParser.generate_expressiontrees_fromtable()
FilterExpressionParser.primary_tablename
FilterExpressionParser.select_datarows()
FilterExpressionParser.select_datarows_fromtable()
FilterExpressionParser.select_datarowset()
FilterExpressionParser.select_datarowset_fromtable()
FilterExpressionParser.select_signalidset()
FilterExpressionParser.select_signalidset_fromtable()
FilterExpressionParser.set_parsingexception_callback()
FilterExpressionParser.table()
FilterExpressionParser.tableidfields_map
FilterExpressionParser.track_filteredrows
FilterExpressionParser.track_filteredsignalids
- sttp.data.functionexpression module
- sttp.data.inlistexpression module
- sttp.data.operatorexpression module
- sttp.data.orderbyterm module
- sttp.data.tableidfields module
- sttp.data.unaryexpression module
- sttp.data.valueexpression module
EMPTYSTRINGVALUE
FALSEVALUE
NULLBOOLVALUE
NULLDATETIMEVALUE
NULLINT32VALUE
NULLSTRINGVALUE
NULLVALUE
TRUEVALUE
ValueExpression
ValueExpression.booleanvalue()
ValueExpression.convert()
ValueExpression.datetimevalue()
ValueExpression.decimalvalue()
ValueExpression.doublevalue()
ValueExpression.expressiontype
ValueExpression.guidvalue()
ValueExpression.int32value()
ValueExpression.int64value()
ValueExpression.integervalue()
ValueExpression.is_null()
ValueExpression.nullvalue()
ValueExpression.stringvalue()
ValueExpression.value
ValueExpression.valuetype
- Module contents
- sttp.metadata package
- Subpackages
- Submodules
- sttp.metadata.cache module
MetadataCache
MetadataCache.add_measurement()
MetadataCache.device_records
MetadataCache.deviceacronym_device_map
MetadataCache.deviceid_device_map
MetadataCache.find_device_acronym()
MetadataCache.find_device_id()
MetadataCache.find_devices()
MetadataCache.find_measurement_id()
MetadataCache.find_measurement_pointtag()
MetadataCache.find_measurement_signalid()
MetadataCache.find_measurement_signalreference()
MetadataCache.find_measurements()
MetadataCache.find_measurements_signaltype()
MetadataCache.find_measurements_signaltypename()
MetadataCache.id_measurement_map
MetadataCache.measurement_records
MetadataCache.phasorRecords
MetadataCache.pointtag_measurement_map
MetadataCache.signalid_measurement_map
MetadataCache.signalref_measurement_map
- Module contents
- sttp.transport package
- Subpackages
- Submodules
- sttp.transport.bufferblock module
- sttp.transport.compactmeasurement module
- sttp.transport.constants module
CompressionModes
ConnectStatus
DataPacketFlags
Defaults
Defaults.AUTORECONNECT
Defaults.AUTOREQUESTMETADATA
Defaults.AUTOSUBSCRIBE
Defaults.COMPRESS_METADATA
Defaults.COMPRESS_PAYLOADDATA
Defaults.COMPRESS_SIGNALINDEXCACHE
Defaults.CONSTRAINTPARAMETERS
Defaults.DATACHANNEL_INTERFACE
Defaults.DATACHANNEL_LOCALPORT
Defaults.ENABLE_TIME_REASONABILITY_CHECK
Defaults.EXTRA_CONNECTIONSTRING_PARAMETERS
Defaults.FILTEREXPRESSION
Defaults.INCLUDETIME
Defaults.LAGTIME
Defaults.LEADTIME
Defaults.MAXRETRIES
Defaults.MAXRETRYINTERVAL
Defaults.METADATAFILTERS
Defaults.PROCESSINGINTERVAL
Defaults.PUBLISHINTERVAL
Defaults.REQUEST_NANVALUEFILTER
Defaults.RETRYINTERVAL
Defaults.SOCKET_TIMEOUT
Defaults.STARTTIME
Defaults.STOPTIME
Defaults.THROTTLED
Defaults.UDPDATACHANNEL
Defaults.USE_LOCALCLOCK_AS_REALTIME
Defaults.USE_MILLISECONDRESOLUTION
Defaults.VERSION
OperationalEncoding
OperationalModes
OperationalModes.COMPRESSMETADATA
OperationalModes.COMPRESSPAYLOADDATA
OperationalModes.COMPRESSSIGNALINDEXCACHE
OperationalModes.ENCODINGMASK
OperationalModes.IMPLEMENTATIONSPECIFICEXTENSIONMASK
OperationalModes.NOFLAGS
OperationalModes.RECEIVEEXTERNALMETADATA
OperationalModes.RECEIVEINTERNALMETADATA
OperationalModes.VERSIONMASK
SecurityMode
ServerCommand
ServerCommand.CONFIRMBUFFERBLOCK
ServerCommand.CONFIRMNOTIFICATION
ServerCommand.CONFIRMUPDATEBASETIMES
ServerCommand.CONFIRMUPDATECIPHERKEYS
ServerCommand.CONFIRMUPDATESIGNALINDEXCACHE
ServerCommand.CONNECT
ServerCommand.DEFINEOPERATIONALMODES
ServerCommand.GETPRIMARYMETADATASCHEMA
ServerCommand.GETSIGNALSELECTIONSCHEMA
ServerCommand.METADATAREFRESH
ServerCommand.ROTATECIPHERKEYS
ServerCommand.SUBSCRIBE
ServerCommand.UNSUBSCRIBE
ServerCommand.UPDATEPROCESSINGINTERVAL
ServerCommand.USERCOMMAND00
ServerCommand.USERCOMMAND01
ServerCommand.USERCOMMAND02
ServerCommand.USERCOMMAND03
ServerCommand.USERCOMMAND04
ServerCommand.USERCOMMAND05
ServerCommand.USERCOMMAND06
ServerCommand.USERCOMMAND07
ServerCommand.USERCOMMAND08
ServerCommand.USERCOMMAND09
ServerCommand.USERCOMMAND10
ServerCommand.USERCOMMAND11
ServerCommand.USERCOMMAND12
ServerCommand.USERCOMMAND13
ServerCommand.USERCOMMAND14
ServerCommand.USERCOMMAND15
ServerResponse
ServerResponse.BUFFERBLOCK
ServerResponse.CONFIGURATIONCHANGED
ServerResponse.DATAPACKET
ServerResponse.DATASTARTTIME
ServerResponse.FAILED
ServerResponse.NOOP
ServerResponse.NOTIFY
ServerResponse.PROCESSINGCOMPLETE
ServerResponse.SUCCEEDED
ServerResponse.UPDATEBASETIMES
ServerResponse.UPDATECIPHERKEYS
ServerResponse.UPDATESIGNALINDEXCACHE
ServerResponse.USERRESPONSE00
ServerResponse.USERRESPONSE01
ServerResponse.USERRESPONSE02
ServerResponse.USERRESPONSE03
ServerResponse.USERRESPONSE04
ServerResponse.USERRESPONSE05
ServerResponse.USERRESPONSE06
ServerResponse.USERRESPONSE07
ServerResponse.USERRESPONSE08
ServerResponse.USERRESPONSE09
ServerResponse.USERRESPONSE10
ServerResponse.USERRESPONSE11
ServerResponse.USERRESPONSE12
ServerResponse.USERRESPONSE13
ServerResponse.USERRESPONSE14
ServerResponse.USERRESPONSE15
StateFlags
StateFlags.ALARMHIGH
StateFlags.ALARMLOW
StateFlags.BADDATA
StateFlags.BADTIME
StateFlags.CALCULATEDVALUE
StateFlags.CALCULATIONERROR
StateFlags.CALCULATIONWARNING
StateFlags.COMPARISONALARM
StateFlags.DISCARDEDVALUE
StateFlags.DOWNSAMPLED
StateFlags.FLATLINEALARM
StateFlags.FUTURETIMEALARM
StateFlags.LATETIMEALARM
StateFlags.MEASUREMENTERROR
StateFlags.NORMAL
StateFlags.OVERRANGEERROR
StateFlags.RECEIVEDASBAD
StateFlags.RESERVEDQUALITYFLAG
StateFlags.RESERVEDTIMEFLAG
StateFlags.ROCALARM
StateFlags.SUSPECTDATA
StateFlags.SUSPECTTIME
StateFlags.SYSTEMERROR
StateFlags.SYSTEMWARNING
StateFlags.UNDERRANGEERROR
StateFlags.UPSAMPLED
StateFlags.USERDEFINEDFLAG1
StateFlags.USERDEFINEDFLAG2
StateFlags.USERDEFINEDFLAG3
StateFlags.USERDEFINEDFLAG4
StateFlags.USERDEFINEDFLAG5
StateFlags.WARNINGHIGH
StateFlags.WARNINGLOW
- sttp.transport.datasubscriber module
DataSubscriber
DataSubscriber.DEFAULT_COMPRESS_METADATA
DataSubscriber.DEFAULT_COMPRESS_PAYLOADDATA
DataSubscriber.DEFAULT_COMPRESS_SIGNALINDEXCACHE
DataSubscriber.DEFAULT_SOCKET_TIMEOUT
DataSubscriber.DEFAULT_STTP_SOURCEINFO
DataSubscriber.DEFAULT_STTP_UPDATEDONINFO
DataSubscriber.DEFAULT_STTP_VERSIONINFO
DataSubscriber.DEFAULT_VERSION
DataSubscriber.activesignalindexcache
DataSubscriber.adjustedvalue()
DataSubscriber.autoreconnect_callback
DataSubscriber.compress_metadata
DataSubscriber.compress_payloaddata
DataSubscriber.compress_signalindexcache
DataSubscriber.configurationchanged_callback
DataSubscriber.connect()
DataSubscriber.connected
DataSubscriber.connectionterminated_callback
DataSubscriber.connector
DataSubscriber.data_starttime_callback
DataSubscriber.decodestr()
DataSubscriber.disconnect()
DataSubscriber.dispose()
DataSubscriber.disposing
DataSubscriber.encodestr()
DataSubscriber.errormessage_callback
DataSubscriber.lookup_metadata()
DataSubscriber.metadatacache
DataSubscriber.metadatareceived_callback
DataSubscriber.newbufferblocks_callback
DataSubscriber.newmeasurements_callback
DataSubscriber.notificationreceived_callback
DataSubscriber.processingcomplete_callback
DataSubscriber.send_servercommand()
DataSubscriber.send_servercommand_withmessage()
DataSubscriber.socket_timeout
DataSubscriber.statusmessage_callback
DataSubscriber.sttp_sourceinfo
DataSubscriber.sttp_updatedoninfo
DataSubscriber.sttp_versioninfo
DataSubscriber.subscribe()
DataSubscriber.subscribed
DataSubscriber.subscriberid
DataSubscriber.subscription
DataSubscriber.subscriptionupdated_callback
DataSubscriber.total_commandchannel_bytesreceived
DataSubscriber.total_datachannel_bytesreceived
DataSubscriber.total_measurementsreceived
DataSubscriber.unsubscribe()
DataSubscriber.version
- sttp.transport.measurement module
- sttp.transport.signalindexcache module
- sttp.transport.signalkind module
- sttp.transport.subscriberconnector module
SubscriberConnector
SubscriberConnector.DEFAULT_AUTORECONNECT
SubscriberConnector.DEFAULT_ERRORMESSAGE_CALLBACK()
SubscriberConnector.DEFAULT_HOSTNAME
SubscriberConnector.DEFAULT_MAXRETRIES
SubscriberConnector.DEFAULT_MAXRETRYINTERVAL
SubscriberConnector.DEFAULT_PORT
SubscriberConnector.DEFAULT_RECONNECT_CALLBACK()
SubscriberConnector.DEFAULT_RETRYINTERVAL
SubscriberConnector.autoreconnect
SubscriberConnector.cancel()
SubscriberConnector.connect()
SubscriberConnector.dispose()
SubscriberConnector.errormessage_callback
SubscriberConnector.hostname
SubscriberConnector.maxretries
SubscriberConnector.maxretryinterval
SubscriberConnector.port
SubscriberConnector.reconnect_callback
SubscriberConnector.reset_connection()
SubscriberConnector.retryinterval
- sttp.transport.subscriptioninfo module
SubscriptionInfo
SubscriptionInfo.DEFAULT_CONSTRAINTPARAMETERS
SubscriptionInfo.DEFAULT_DATACHANNEL_INTERFACE
SubscriptionInfo.DEFAULT_DATACHANNEL_LOCALPORT
SubscriptionInfo.DEFAULT_ENABLE_TIME_REASONABILITY_CHECK
SubscriptionInfo.DEFAULT_EXTRA_CONNECTIONSTRING_PARAMETERS
SubscriptionInfo.DEFAULT_FILTEREXPRESSION
SubscriptionInfo.DEFAULT_INCLUDETIME
SubscriptionInfo.DEFAULT_LAGTIME
SubscriptionInfo.DEFAULT_LEADTIME
SubscriptionInfo.DEFAULT_PROCESSINGINTERVAL
SubscriptionInfo.DEFAULT_PUBLISHINTERVAL
SubscriptionInfo.DEFAULT_REQUEST_NANVALUEFILTER
SubscriptionInfo.DEFAULT_STARTTIME
SubscriptionInfo.DEFAULT_STOPTIME
SubscriptionInfo.DEFAULT_THROTTLED
SubscriptionInfo.DEFAULT_UDPDATACHANNEL
SubscriptionInfo.DEFAULT_USE_LOCALCLOCK_AS_REALTIME
SubscriptionInfo.DEFAULT_USE_MILLISECONDRESOLUTION
SubscriptionInfo.constraintparameters
SubscriptionInfo.datachannel_interface
SubscriptionInfo.datachannel_localport
SubscriptionInfo.enabletimereasonabilitycheck
SubscriptionInfo.extra_connectionstring_parameters
SubscriptionInfo.filterexpression
SubscriptionInfo.includetime
SubscriptionInfo.lagtime
SubscriptionInfo.leadtime
SubscriptionInfo.processinginterval
SubscriptionInfo.publishinterval
SubscriptionInfo.request_nanvaluefilter
SubscriptionInfo.starttime
SubscriptionInfo.stoptime
SubscriptionInfo.throttled
SubscriptionInfo.udpdatachannel
SubscriptionInfo.use_millisecondresolution
SubscriptionInfo.uselocalclockasrealtime
- Module contents
Submodules
sttp.config module
- class sttp.config.Config(maxretries: int = Ellipsis, retryinterval: float = Ellipsis, maxretryinterval: float = Ellipsis, autoreconnect: bool = Ellipsis, autorequestmetadata: bool = Ellipsis, autosubscribe: bool = Ellipsis, compress_payloaddata: bool = Ellipsis, compress_metadata: bool = Ellipsis, compress_signalindexcache: bool = Ellipsis, metadatafilters: str = Ellipsis, socket_timeout: float = Ellipsis, version: int8 = Ellipsis)[source]
Bases:
object
Defines the STTP connection related configuration parameters.
- DEFAULT_AUTORECONNECT = True
- DEFAULT_AUTOREQUESTMETADATA = True
- DEFAULT_AUTOSUBSCRIBE = True
- DEFAULT_COMPRESS_METADATA = True
- DEFAULT_COMPRESS_PAYLOADDATA = True
- DEFAULT_COMPRESS_SIGNALINDEXCACHE = True
- DEFAULT_MAXRETRIES = -1
- DEFAULT_MAXRETRYINTERVAL = 30.0
- DEFAULT_METADATAFILTERS = ''
- DEFAULT_RETRYINTERVAL = 1.0
- DEFAULT_SOCKET_TIMEOUT = 2.0
- DEFAULT_VERSION = np.int8(2)
- autoreconnect
Defines flag that determines if connections should be automatically reattempted.
- autorequestmetadata
Defines the flag that determines if metadata should be automatically requested upon successful connection. When True, metadata will be requested upon connection before subscription; otherwise, any metadata operations must be handled manually.
- autosubscribe
Defines the flag that determines if subscription should be handled automatically upon successful connection. When autorequestmetadata is True and autosubscribe is True, subscription will occur after reception of metadata. When autorequestmetadata is False and autosubscribe is True, subscription will occur at successful connection. When autosubscribe is False, any subscribe operations must be handled manually.
- compress_metadata
Determines whether the metadata transfer is compressed.
- compress_payloaddata
Determines whether payload data is compressed.
- compress_signalindexcache
Determines whether the signal index cache is compressed.
- maxretries
Defines the maximum number of times to retry a connection. Set value to -1 to retry infinitely.
- maxretryinterval
Defines the maximum retry interval, in seconds.
- metadatafilters
Defines any filters to be applied to incoming metadata to reduce total received metadata. Each filter expression should be separated by semi-colon.
- retryinterval
Defines the base retry interval, in seconds. Retries will exponentially back-off starting from this interval.
- socket_timeout
Defines the timeout in seconds for all socket connections.
- version
Defines the target STTP protocol version. This currently defaults to 2.
sttp.reader module
- class sttp.reader.MeasurementReader(subscriber: Subscriber)[source]
Bases:
object
Defines an STTP measurement reader.
- dispose()[source]
Cleanly shuts down a MeasurmentReader that is no longer being used. This method will release any waiting threads.
- next_measurement() Tuple[Measurement | None, bool] [source]
Blocks current thread until a new measurement arrived.
sttp.settings module
- class sttp.settings.Settings(throttled: bool = Ellipsis, publishinterval: float = Ellipsis, udpport: uint16 = Ellipsis, udpinterface: str = Ellipsis, includetime: bool = Ellipsis, enabletimereasonabilitycheck: bool = Ellipsis, lagtime: float64 = Ellipsis, leadtime: float64 = Ellipsis, uselocalclockasrealtime: bool = Ellipsis, usemillisecondresolution: bool = Ellipsis, requestnanvaluefilter: bool = Ellipsis, starttime: str = Ellipsis, stoptime: str = Ellipsis, constraintparameters: str = Ellipsis, processinginterval: int = Ellipsis, extra_connectionstring_parameters: str = Ellipsis)[source]
Bases:
object
Defines the STTP subscription related settings.
Notes
The Settings class exists as a simplified implementation of the SubscriptionInfo class found in the transport namespace. Internally, the Subscriber class maps Settings values to a SubscriptionInfo instance for use with a DataSubscriber.
- DEFAULT_CONSTRAINTPARAMETERS = ''
- DEFAULT_ENABLE_TIME_REASONABILITY_CHECK = False
- DEFAULT_EXTRA_CONNECTIONSTRING_PARAMETERS = ''
- DEFAULT_INCLUDETIME = True
- DEFAULT_LAGTIME = np.float64(10.0)
- DEFAULT_LEADTIME = np.float64(5.0)
- DEFAULT_PROCESSINGINTERVAL = np.int32(-1)
- DEFAULT_PUBLISHINTERVAL = np.float64(1.0)
- DEFAULT_REQUEST_NANVALUEFILTER = False
- DEFAULT_STARTTIME = ''
- DEFAULT_STOPTIME = ''
- DEFAULT_THROTTLED = False
- DEFAULT_UDPINTERFACE = ''
- DEFAULT_UDPPORT = np.uint16(0)
- DEFAULT_USE_LOCALCLOCK_AS_REALTIME = False
- DEFAULT_USE_MILLISECONDRESOLUTION = False
- constraintparameters
Defines any custom constraint parameters for a requested temporal data playback. This can include parameters that may be needed to initiate, filter, or control historical data access.
- enabletimereasonabilitycheck
Determines if publisher should perform time reasonability checks. When enabled lagtime and leadtime will be used to determine if a measurement timestamp is reasonable.
- extra_connectionstring_parameters
Defines any extra custom connection string parameters that may be needed for a subscription.
- includetime
Determines if time should be included in non-compressed, compact measurements.
- lagtime
Defines defines the allowed past time deviation tolerance in seconds (can be sub-second). Value is used to determine if a measurement timestamp is reasonable. Only applicable when enabletimereasonabilitycheck is true.
- leadtime
Defines defines the allowed future time deviation tolerance in seconds (can be sub-second). Value is used to determine if a measurement timestamp is reasonable. Only applicable when enabletimereasonabilitycheck is true.
- processinginterval
Defines the initial playback speed, in milliseconds, for a requested temporal data playback. With the exception of the values of -1 and 0, this value specifies the desired processing interval for data, i.e., basically a delay, or timer interval, over which to process data. A value of -1 means to use the default processing interval while a value of 0 means to process data as fast as possible.
- publishinterval
Defines the down-sampling publish interval, in seconds, to use when throttled is True.
- request_nanvaluefilter
Requests that the publisher filter, i.e., does not send, any NaN values.
- starttime
Defines the start time for a requested temporal data playback, i.e., a historical subscription. Simply by specifying a starttime and stoptime, a subscription is considered a historical subscription. Note that the publisher may not support historical subscriptions, in which case the subscribe will fail.
- stoptime
Defines the stop time for a requested temporal data playback, i.e., a historical subscription. Simply by specifying a starttime and stoptime, a subscription is considered a historical subscription. Note that the publisher may not support historical subscriptions, in which case the subscribe will fail.
- throttled
Determines if data will be published using down-sampling.
- udpinterface
Defines the desired UDP binding interface to use for publication. Empty string means to bind to all interfaces.
- udpport
Defines the desired UDP port to use for publication. Zero value means do not receive data on UDP, i.e., data will be delivered to the STTP client via TCP.
- use_millisecondresolution
Determines if time should be restricted to milliseconds in non-compressed, compact measurements.
- uselocalclockasrealtime
Determines if publisher should use local clock as real time. If false, the timestamp of the latest measurement will be used as real-time. Only applicable when enabletimereasonabilitycheck is true.
sttp.subscriber module
- class sttp.subscriber.Subscriber[source]
Bases:
object
Represents an STTP data subscriber.
Notes
The Subscriber class exists as a simplified implementation of the DataSubscriber class found in the transport namespace. This class maintains an internal instance of the DataSubscriber class for subscription based functionality and is intended to simplify common uses of STTP data reception.
- property activesignalindexcache: SignalIndexCache
Gets the active signal index cache.
- adjustedvalue(measurement: Measurement) float64 [source]
Gets the Value of a Measurement with any linear adjustments applied from the measurement’s Adder and Multiplier metadata, if found.
- connect(address: str, config: Config = Ellipsis) Exception | None [source]
Starts the client-based connection cycle to an STTP publisher. Config parameter controls connection related settings. When the config defines AutoReconnect as True, the connection will automatically be retried when the connection drops. If the config parameter defines AutoRequestMetadata as True, then upon successful connection, meta-data will be requested. When the config defines both AutoRequestMetadata and AutoSubscribe as True, subscription will occur after reception of metadata. When the config defines AutoRequestMetadata as False and AutoSubscribe as True, subscription will occur at successful connection.
- property connected: bool
Gets flag that determines if Subscriber is currently connected to a data publisher.
- default_connectionestablished_receiver()[source]
Implements the default handler for the connection established callback. Default implementation simply writes connection feedback to status message callback.
- default_connectionterminated_receiver()[source]
Implements the default handler for the connection terminated callback. Default implementation simply writes connection terminated feedback to error message callback.
- default_errormessage_logger(message: str)[source]
Implements the default handler for the error message callback. Default implementation synchronously writes output to stderr. Logging is recommended.
- default_statusmessage_logger(message: str)[source]
Implements the default handler for the status message callback. Default implementation synchronously writes output to stdio. Logging is recommended.
- dispose()[source]
Cleanly shuts down a Subscriber that is no longer being used, e.g., during a normal application exit.
- measurement_metadata(measurement: Measurement) MeasurementRecord [source]
Gets the MeasurementRecord for the specified measurement, based on its signal ID, from the local metadata cache; or, None if the measurement cannot be found.
- property metadatacache: MetadataCache
Gets the current metadata cache.
- read_measurements() MeasurementReader [source]
Sets up a new MeasurementReader to start reading measurements.
- request_metadata()[source]
Sends a request to the data publisher indicating that the Subscriber would like new metadata. Any defined MetadataFilters will be included in request.
- set_configurationchanged_receiver(callback: Callable[[], None] | None)[source]
Defines the callback that handles notifications that the data publisher configuration has changed. Assignment will take effect immediately, even while subscription is active.
- set_connectionestablished_receiver(callback: Callable[[], None] | None)[source]
Defines the callback that handles notification that a connection has been established. Default implementation simply writes connection feedback to status message handler. Assignment will take effect immediately, even while subscription is active.
- set_connectionterminated_receiver(callback: Callable[[], None] | None)[source]
Defines the callback that handles notification that a connection has been terminated. Default implementation simply writes connection terminated feedback to error message handler. Assignment will take effect immediately, even while subscription is active.
- set_data_starttime_receiver(callback: Callable[[int64], None] | None)[source]
Defines the callback that handles notification of first received measurement. Assignment will take effect immediately, even while subscription is active.
- set_errormessage_logger(callback: Callable[[str], None] | None)[source]
Defines the callback that handles error message logging. Assignment will take effect immediately, even while subscription is active.
- set_historicalreadcomplete_receiver(callback: Callable[[], None] | None)[source]
Defines the callback that handles notification that temporal processing has completed, i.e., the end of a historical playback data stream has been reached. Assignment will take effect immediately, even while subscription is active.
- set_metadatanotification_receiver(callback: Callable[[DataSet], None] | None)[source]
Defines the callback that handles reception of the metadata received notification response. Receiver parameter defines full XML response received from publisher. Parsed metadata available via Subscriber.metadatacache property. Assignment will take effect immediately, even while subscription is active.
- set_newbufferblock_receiver(callback: Callable[[List[BufferBlock]], None] | None)[source]
Defines the callback that handles reception of new buffer blocks. Assignment will take effect immediately, even while subscription is active.
- set_newmeasurements_receiver(callback: Callable[[List[Measurement]], None] | None)[source]
Defines the callback that handles reception of new measurements. Assignment will take effect immediately, even while subscription is active.
- set_notification_receiver(callback: Callable[[str], None] | None)[source]
Defines the callback that handles reception of a notification. Assignment will take effect immediately, even while subscription is active.
- set_statusmessage_logger(callback: Callable[[str], None] | None)[source]
Defines the callback that handles informational message logging. Assignment will take effect immediately, even while subscription is active.
- set_subscriptionupdated_receiver(callback: Callable[[SignalIndexCache], None] | None)[source]
Defines the callback that handles notifications that a new SignalIndexCache has been received. Assignment will take effect immediately, even while subscription is active.
- subscribe(filterexpression: str, settings: Settings = Ellipsis)[source]
Subscribe sets up a request indicating that the Subscriber would like to start receiving streaming data from a data publisher. If the subscriber is already connected, the updated filter expression and subscription settings will be requested immediately; otherwise, the settings will be used when the connection to the data publisher is established.
The filterExpression defines the desired measurements for a subscription. Examples include:
- Directly specified signal IDs (UUID values in string format):
38A47B0-F10B-4143-9A0A-0DBC4FFEF1E8; E4BBFE6A-35BD-4E5B-92C9-11FF913E7877
- Directly specified tag names:
DOM_GPLAINS-BUS1:VH; TVA_SHELBY-BUS1:VH
- Directly specified identifiers in “measurement key” format:
PPA:15; STAT:20
- A filter expression against a selection view:
FILTER ActiveMeasurements WHERE Company=’GPA’ AND SignalType=’FREQ’
Settings parameter controls subscription related settings.
- property subscribed: bool
Gets flag that determines if Subscriber is currently subscribed to a data stream.
- property subscriberid: UUID
Gets the subscriber ID as assigned by the data publisher upon receipt of the SignalIndexCache.
- property total_commandchannel_bytesreceived: uint64
Gets the total number of bytes received via the command channel since last connection.
- property total_datachannel_bytesreceived: uint64
Gets the total number of bytes received via the data channel since last connection.
- property total_measurementsreceived: uint64
Gets the total number of measurements received since last subscription.
sttp.ticks module
- class sttp.ticks.Ticks[source]
Bases:
object
Defines constants and functions for tick values, 64-bit integers used to designate time in STTP. A tick value represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 UTC, Gregorian calendar. A single tick represents one hundred nanoseconds, or one ten-millionth of a second. There are 10,000 ticks in a millisecond and 10 million ticks in a second. Only bits 01 to 62 (0x3FFFFFFFFFFFFFFF) are used to represent the timestamp value. Bit 64 (0x8000000000000000) is used to denote leap second, i.e., second 60, where actual second value would remain at 59. Bit 63 (0x4000000000000000) is used to denote leap second direction, 0 for add, 1 for delete.
- LEAPSECOND_DIRECTION = np.uint64(4611686018427387904)
Flag (63rd bit) that indicates if leap second is positive or negative; 0 for add, 1 for delete.
- LEAPSECOND_FLAG = np.uint64(9223372036854775808)
Flag (64th bit) that marks a Ticks value as a leap second, i.e., second 60 (one beyond normal second 59).
- PERDAY = np.uint64(864000000000)
Number of Ticks that occur in a day.
- PERHOUR = np.uint64(36000000000)
Number of Ticks that occur in an hour.
- PERMICROSECOND = np.uint64(10)
Number of Ticks that occur in a microsecond.
- PERMILLISECOND = np.uint64(10000)
Number of Ticks that occur in a millisecond.
- PERMINUTE = np.uint64(600000000)
Number of Ticks that occur in a minute.
- PERSECOND = np.uint64(10000000)
Number of Ticks that occur in a second.
- UNIXBASEOFFSET = np.uint64(621355968000000000)
Ticks representation of the Unix epoch timestamp starting at January 1, 1970.
- VALUEMASK = np.uint64(4611686018427387903)
All bits (bits 1 to 62) that make up the value portion of a Ticks that represent time.
- static from_datetime(dt: datetime) uint64 [source]
Converts a standard Python dattime value to a Ticks value.
- static from_timedelta(td: timedelta) uint64 [source]
Converts a standard Python timedelta value to a Ticks value.
- static is_leapsecond(ticks: uint64) bool [source]
Determines if the deserialized Ticks value represents a leap second, i.e., second 60.
- static is_negative_leapsecond(ticks: uint64) bool [source]
Determines if the deserialized Ticks value represents a negative leap second, i.e., checks flag on second 58 to see if second 59 will be missing.
- static set_leapsecond(ticks: uint64) uint64 [source]
Flags a Ticks value to represent a leap second, i.e., second 60, before wire serialization.
- static set_negative_leapsecond(ticks: uint64) uint64 [source]
Flags a Ticks value to represent a negative leap second, i.e., sets flag on second 58 to mark that second 59 will be missing, before wire serialization.
- static timestampvalue(ticks: uint64) uint64 [source]
Gets the timestamp portion of the Ticks value, i.e., the 62-bit time value excluding any leap second flags.
- static to_datetime(ticks: uint64) datetime [source]
Converts a Ticks value to standard Python datetime value.
Note: Python datetime values have a maximum resolution of 1 microsecond, so any Ticks values, which have 100 nanosecond resolution, will be rounded to the nearest microsecond.
- static to_shortstring(ticks: uint64) str [source]
Shows just the timestamp portion of a Ticks value with milliseconds, e.g., 15:04:05.999.
sttp.version module
- class sttp.version.Version[source]
Bases:
object
- STTP_SOURCE = 'STTP Python Library'
Defines the STTP library API title used for data subscriber identification.
- STTP_UPDATEDON = '2024-10-16'
Defines when the STTP library API was last updated used for data subscriber identification.
- STTP_VERSION = '0.6.4'
Defines the STTP library API version used for data subscriber identification. Note: This is not the STTP protocol version, but the version of the STTP library API.