def format_RFC4180(original_value):
    """
    Transform the value from the key-value pairs of a flattened JSON in
    RFC4180-compliant. This is, remove "None" values and duplicate inner
    double quotes.
    Added removal of newlines and carriage returns, which are really
    troublesome in CSVs
    """
    new_value = str(original_value).strip().replace('"', '""')
    new_value = new_value.replace('\n', ' ')
    new_value = new_value.replace('\r', ' ')
    new_value = new_value.replace('None', '')
    new_value = '"' + new_value + '"'
    return new_value
