A Python implementation of the Lsetwatch CSV export/import format.
Lsetwatch is an offline LEGO collection management software.
The data format and fields are partially described in the Lsetwatch documentation.
The CSV specification used by Lsetwatch is implemented with a custom CSV dialect:
- Lsetwatch is using semicolon-separated values; and the line terminator
\r\n; without quoting of values. This is implemented inLsetWatchDialect.
Values are escaped within the application itself. The value encoding used by Lsetwatch is implemented with custom stateless Codecs:
- The Bell character
\ais used for escaping reserved CSV characters. This is implemented inBellEscapedAsciiStringCodec. - Lists are represented as pipe-separated values within a field. This is implemented in
PipeSeparatedListCodec. Note that as of Lsetwatch 1.17 values within lists don't seem to be escaped correctly, and can cause invalid outputs (e.g. using the pipe character|within values in lists).
The date and decimal number formats are configurable within Lsetwatch. This is also the case in this library and the formats needs to match the values configured within Lsetwatch when parsing or generating CSV output.
If no formats are specified, the following defaults are used:
- Dates:
dd/MM/yyyy. - Decimal numbers: Comma as thousands separator, and period as decimal separator.