def cs_string_list(value):
    """
    Parses a comma separated strings into a python list

    # >>> cs_string_list('')
    # []
    # >>> cs_string_list("''")
    # ['']
    # >>> cs_string_list('""')
    # ['']
    # >>> cs_string_list('test')
    # ['test']
    # >>> cs_string_list('   test  ')
    # ['test']
    # >>> cs_string_list('   te"st"  ')
    # ['te"st"']
    # >>> cs_string_list('foo bar')
    # ['foo bar']
    # >>> cs_string_list("test,' foo bar'")
    # ['test', ' foo bar']
    >>> cs_string_list('"foo bar   "  ,    test   ')
    ['foo bar   ', 'test']
    >>> cs_string_list('test,   "' "'foo bar'" '"')
    ['test', "'foo bar'"]
    >>> cs_string_list("test, " '"bar, foo"' ",   'foo bar'    ")
    ['test', 'bar, foo', 'foo bar']
    >>> cs_string_list("test,,,")
    ['test', '', '', '']
    >>> cs_string_list("test,,,   ")
    ['test', '', '', '']
    """
    res = ['']
    in_str = False
    strip_str = True
    open_char = None
    last_char = None
    for char in value:
        if in_str:          # we are in a string
            if open_char:   # we are in a quoted string quoted with open_char
                if char == open_char:       # quoted string is closed
                    in_str = False
                    open_char = None
                else:
                    res[-1] += char
            elif char == ',':               # next string to process
                in_str = False
                # we only land here for unquoted strings as char == open_char
                # branch sets in_str == False
                res[-1] = res[-1].strip()
                res.append('')              # append next state
            else:
                res[-1] += char
        elif char == ' ':                   # skip non-quoted white-spaces
            continue
        elif char == ',':                   # next string to process
            in_str = False
            if strip_str:                   # was not a quoted string => strip
                res[-1] = res[-1].strip()
            else:
                strip_str = True            # else reset strip_str for next
            res.append('')                  # append next state
        else:
            in_str = True                   # we found a string!
            if char in ['"', "'"]:          # and it is quoted
                open_char = char
                strip_str = False
            else:
                res[-1] += char
        last_char = char
    if open_char:
        raise ValueError("Unterminated string '{}'".format(res[-1]))
    if not res[-1] and last_char not in [",", "'", '"']:
        del res[-1]
    if res and strip_str:       # strip remaining unquoted string
        res[-1] = res[-1].strip()
    return res