sleap.io.format.csv#

Adaptor for writing SLEAP analysis as csv.

class sleap.io.format.csv.CSVAdaptor[source]#
property all_exts#

List of all file extensions supported by adaptor.

can_read_file(file: sleap.io.format.filehandle.FileHandle)[source]#

Returns whether this adaptor can read this file.

can_write_filename(filename: str)[source]#

Returns whether this adaptor can write format of this filename.

property default_ext#

The default file extension, e.g., ‘json’ (without ‘.’).

does_read() bool[source]#

Returns whether this adaptor supports reading.

does_write() bool[source]#

Returns whether this adaptor supports writing.

property handles#

Returns the type of object that can be read/written.

The Dispatch class calls this method on all registered adaptors to determine which to use for reading/writing.

property name#

Human-reading name of the file format

classmethod write(filename: str, source_object: sleap.io.dataset.Labels, source_path: Optional[str] = None, video: Optional[sleap.io.video.Video] = None)[source]#

Writes csv file for Labels source_object.

Parameters
  • filename – The filename for the output file.

  • source_object – The Labels from which to get data from.

  • source_path – Path for the labels object

  • video – The Video from which toget data from. If no video is specified, then the first video in source_object videos list will be used. If there are no Labeled Frame`s in the `video, then no analysis file will be written.