You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trivial split for strings with multiple character delimiters, quotes and escaped characters
Installation
pip install tssplit
Usage
Syntax
deftssplit(s:str, quote:str='"\'', quote_keep:bool=False, delimiter:str=':;,', escape:str='/^',
trim:str='', remark:str='#') ->list[str]:
"""Split a string by delimiters with quotes and escaped characters, optionally trimming results :param s: A string to split into chunks :param quote: Quote chars to protect a part of s from parsing :param quote_keep: Preserve quote characters in the output or not :param delimiter: A chunk separator character :param escape: An escape character :param trim: Trim characters from chunks :param remark: Ignore all characters after remark sign :return: A list of chunks """