Morelia.Stream.sink packageο
Submodulesο
Morelia.Stream.sink.csv_sink moduleο
Send data to CSV file.
- class Morelia.Stream.sink.csv_sink.CSVSink(file_path, pod)ο
Bases:
SinkInterfaceStream data to a CSV file, truncates the destination file each time.
- Parameters:
file_path (
str) β Path to CSV file to write to.pod (
AcquisitionDevice) β POD device data is being streamed from.
- property file_pathο
- get_dict()ο
Obtains sink __init__ argument values to use for process pickling
Morelia.Stream.sink.edf_sink moduleο
Send data to EDF file.
- class Morelia.Stream.sink.edf_sink.EDFSink(file_path, pod)ο
Bases:
SinkInterfaceStream data to an EDF file.
- Parameters:
sample_rate β Sample rate of device being streamed from. Used in setting up EDF file.
file_path (
str) β Path to CSV file to write to.pod (
AcquisitionDevice) β POD device data is being streamed from.
- property file_pathο
- get_dict()ο
Obtains sink __init__ argument values to use for process pickling
- property podο
Morelia.Stream.sink.influx_sink moduleο
Send data to InfluxDB.
- class Morelia.Stream.sink.influx_sink.InfluxSink(pod, url='http://localhost:8086', api_token='admin-token', org='default-org', bucket='influx_dump', measurement='default-measurement')ο
Bases:
SinkInterfaceStream data to InfluxDB for real-time monitoring.
- Parameters:
url (
str) β URL that points to an InfluxDB server.api_token (
str) β API token to authenticate to InfluxDB. Needs write permissions.org (
str) β Organization within InfluxDB to write data to.bucket (
str) β Bucket within InfluxDB to write data to.measurement (
str) β Measurement within InfluxDB to write data to.pod (
AcquisitionDevice) β 8206-HR/8401-HR/8274D POD device you are streaming data from.
- property api_tokenο
- property bucketο
- close()ο
Wrapper around
self.__exit__for use outside of a context manager.- Return type:
None
- flush(timestamp, packet)ο
Write data to InfluxDB. :meta private:
- Return type:
None
- get_dict()ο
Obtains sink __init__ argument values to use for process pickling
- property measurementο
- open()ο
Wrapper around
self.__enter__for use outside of a context manager.- Return type:
None
- property orgο
- property urlο
Morelia.Stream.sink.sink_interface moduleο
Interface for dataflow sink.
- class Morelia.Stream.sink.sink_interface.SinkInterfaceο
Bases:
objectInterface that data sinks must implement.
- abstractmethod flush(timestamp, packet)ο
Send data to destination (e.g. and EDF file).
- Return type:
None
- abstractmethod get_dict()ο
Obtains sink __init__ argument values to use for process pickling
- Return type:
dict[str,Any]