superset
superset copied to clipboard
Download to .CSV and .JSON
http://matthewmoisen.com/blog/programming/flask/how-to-download-a-csv-file-in-flask/
Sample solution:
from flask import Flask, make_response
app = Flask(__name__)
@app.route('/csv/')
def download_csv():
csv = 'foo,bar,baz\nhai,bai,crai\n'
response = make_response(csv)
response.headers['Content-Disposition'] = 'attachment; filename=mycsv.csv'
response.mimetype='text/csv'
return response