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: SinkInterface

Stream data to a CSV file, truncates the destination file each time.

Parameters:
  • file_path (str) – Path to CSV file to write to.

  • pod (AquisitionDevice) – POD device data is being streamed from.

Morelia.Stream.sink.edf_sink module

Send data to EDF file.

class Morelia.Stream.sink.edf_sink.EDFSink(file_path, pod)

Bases: SinkInterface

Stream 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 (AquisitionDevice) – POD device data is being streamed from.

Morelia.Stream.sink.influx_sink module

Send data to InfluxDB.

class Morelia.Stream.sink.influx_sink.InfluxSink(url, api_token, org, bucket, measurement, pod)

Bases: SinkInterface

Stream 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 (AquisitionDevice) – 8206-HR/8401-HR/8274D POD device you are streaming data from.

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

open()

Wrapper around self.__enter__ for use outside of a context manager.

Return type:

None

Morelia.Stream.sink.sink_interface module

Interface for dataflow sink.

class Morelia.Stream.sink.sink_interface.SinkInterface

Bases: object

Interface that data sinks must implement.

abstractmethod flush(timestamp, packet)

Send data to destination (e.g. and EDF file).

Return type:

None

Module contents