def data()

in application.py [0:0]


def data():

    # if a file hasn't been uploaded yet, redirect to upload page
    if 'UPLOAD_FILE_PATH' not in application.config:
        return redirect("/")

    # check if we need to process the input file
    global data_output
    if not data_output:
        data_output = process_csv_file(application.config['UPLOAD_FILE_PATH'], max_rows=200)

    return jsonify(data_output)