def from_dataframe(df):
    """Turn a dataframe into a dictionary of columns, suitable writing."""
    index = {}

    for column in df.columns:
        values = df[column].values
        if(values.dtype == "object"):
            index[column] = values.tolist()
        else:
            index[column] = values

    return index