write to memory and respond to download data ] @app route('/download'def download()sheet pe sheet(dataoutput make_response(sheet csvoutput headers["content-disposition""attachmentfilename=export csvoutput headers["content-type""text/csvreturn output make_response is flask utility to make memory content as http response noteyou can find the corresponding source code at examples/memoryfile relevant packages readily made plugins have been made on top of this example here is list of themframework flask django pyramid plugin/middleware/extension flask-excel django-excel pyramid-excel and you may make your own by using pyexcel-webio sheetdata conversion how to obtain records from an excel sheet suppose you want to process the following excel data here are the example codeimport pyexcel as pe records pe get_records(file_name="your_file xls"for record in recordsprint("% is aged at % (record['name']record['age'])adam is aged at beatrice is aged at ceri is aged at dean is aged at how to save an python array as an excel file suppose you have the following array old tutorial