zut.collection.parse_list

zut.collection.parse_list(value: str, *, element_type: type[T] = <class 'str'>) list[type[T]]

Parse a comma-separated string into a list, with support for quoted items.

Format rules: - Items are separated by commas - Items can be quoted with or to include commas and whitespace - Inside quoted items, the quote character can be escaped with a backslash (" or ') - Unquoted items are stripped of surrounding whitespace

Exceptions: - If the value starts and ends with { and }, func:parse_pgarray is used. - If the value starts and ends with [ and ], func:decode_json is used.