I have a algorithm that outputs a list of tuples which is ready to be written into a csv file.
I'm trying to write 3 csv files (through StringIO so no writing to disk) and then zip them altogether. After that I want to attach that to the response of a django request.
I'm not sure what's the most efficient way to do this. Should I use StringIO
to store the 3 calls through my algo? Should I actually create the csv files first before zipping them? Can I directly use 1 zipfile
call without the intermediate steps of calling 3 StringIO
s?
Thanks