feat: add endpoint to view dataset for debug

This commit is contained in:
2026-02-05 17:26:34 +00:00
parent b95d21136f
commit 7593acf62c

View File

@@ -41,6 +41,13 @@ def upload_data():
except Exception as e: except Exception as e:
return jsonify({"error": f"An unexpected error occurred: {str(e)}"}), 500 return jsonify({"error": f"An unexpected error occurred: {str(e)}"}), 500
@app.route('/dataset', methods=['GET'])
def get_dataset():
if stat_obj is None:
return jsonify({"error": "No data uploaded"}), 400
return jsonify(stat_obj.df.to_dict(orient="records")), 200
@app.route('/stats/content', methods=['GET']) @app.route('/stats/content', methods=['GET'])
def word_frequencies(): def word_frequencies():
if stat_obj is None: if stat_obj is None: