def stringify(value):
    """
    Escapes a string to be usable as cell content of a CSV formatted data.
    """
    stringified = '' if value is None else str(value)
    if ',' in stringified:
        stringified = stringified.replace('"', '""')
        stringified = f'"{stringified}"'
    return stringified