m2ms / fragalysis-frontend

The React, Redux frontend built by webpack
Other
1 stars 2 forks source link

Add a generic view to download csv from list of dicts #565

Open reskyner opened 3 years ago

reskyner commented 3 years ago

Because smiles strings have to be url encoded on the front-end, it is better to pass them to the back-end to produce a csv file that can be downloaded (so the smiles strings can be url decoded, added to a csv, and then passed back as a download). This is also an advantage as the function can be used to write any csv file from any list of dicts in the future.

Proposed solution here: https://stackoverflow.com/questions/60150927/csv-from-list-of-dictionaries-with-differing-length-and-keys

reskyner commented 3 years ago
from urllib.parse import unquote
url = unquote(url)

or

from urllib import unquote

url = unquote(url).decode('utf8')