Originally posted by **talmo** December 7, 2023
In #1438, we added a feature to export tracks to CSV format from the GUI.
It would be great to be able to do that via the `sleap-export` CLI and the `Labels.export()` API.
For `sleap-export`, we just need to add CSV as a target format and pass in `csv=True` in the [export call here](https://github.com/talmolab/sleap/blob/2d24296c2149402c7ee07601e4d0272fdd308441/sleap/io/convert.py#L165-L171).
For `Labels.export()`, we probably want to [extend what's going on here](https://github.com/talmolab/sleap/blob/2d24296c2149402c7ee07601e4d0272fdd308441/sleap/io/dataset.py#L2035-L2056).
We should also be sure to support the new functionality being added in #1624.
Relevant: #1627
It would be convenient to be able to export predictions stored in .SLP files to .CSV (see linked discussion).
Enhancement plan
csv
as an option for the--format
flag in thesleap-convert
CLI here:https://github.com/talmolab/sleap/blob/2d24296c2149402c7ee07601e4d0272fdd308441/sleap/io/convert.py#L67-L75
csv=True
in thesleap-convert
CLI entrypoint function:https://github.com/talmolab/sleap/blob/2d24296c2149402c7ee07601e4d0272fdd308441/sleap/io/convert.py#L165-L172
csv
as an option in the actual analysis exporting writer:https://github.com/talmolab/sleap/blob/2d24296c2149402c7ee07601e4d0272fdd308441/sleap/io/convert.py#L177-L181
Discussed in https://github.com/talmolab/sleap/discussions/1629