I'd like to generate a dynamic Excel file on request from Django. The library pyExcelerator does this, but I haven't found any way to use the contents of the Excel file without generating a server-side temporary Excel file, reading it, using its contents and deleting it.
The problem is that pyExcelerator only way to extract the contents of the Excel file is saving it via:
workbook = pyExcelerator.Workbook()
workbook.save("tmp_filename")
And then read the temporary file contents. I can't use the standard library "tempfile" because it doesn't accept a file, just a filename. How can I ensure that the filename is unique and that the file is deleted once it has been used?