Skip to content

← utilities package

ExtractStreamProperty

Extract a given property from one of the streams of an incoming data packet.

In NeuroPype, data packets have one or more streams (internally of class Chunk), and each of those streams has meta-data properties (for example, file path from which the data was originally imported, whether the data is streaming or not, and so on). Some properties are set when a Packet is created, but you can set your own properties using the SetStreamProperties node. This node can extract (retrieve) a desired property from a particular stream in a data packet, by specifying the stream name (with wildcard support). Properties may also be stored as nested dictionaries in the stream. To extract a nested property, use periods in the property name, i.e.: 'experiment.task.label'. This node Returns None if the target property is not found in the specified stream (or in the Packet if not stream is specified). This node may also be used to retrieve the name of the stream in the Packet in cases where may be unknown (such as to use that as a string for some identifier in a downstream node). Version 1.3.0

Ports/Properties

data

Input packet.

verbose name
Data
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
IN

property

Extracted property.

verbose name
Property
default value
None
port type
DataPort
value type
object (can be None)
data direction
OUT

stream

The name of the stream containing the target property. If not specified, the first stream in the packet will be used. Wildcards are supported (so mystream* will use the first stream that starts with mystream.

verbose name
Stream
default value
None
port type
StringPort
value type
str (can be None)

stream_name

verbose name
Stream Name
default value
None
port type
AliasPort
value type
str (can be None)

property_name

Stream property to extract (retrieve) the value of. Use the special value stream_name to get the name of the stream (technical note: the stream name is not stored in the stream props dictionary, but instead is the key used to identify the stream in the packet, i.e., {'eeg': eeg_stream, 'markers': marker_stream}).

verbose name
Property Name
default value
source_url
port type
StringPort
value type
str (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)