Spaces:
Sleeping
Sleeping
from flask import Flask, render_template, redirect, url_for, flash | |
import subprocess | |
import os | |
app = Flask(__name__) | |
app.secret_key = 'your_secret_key' # Required for flashing messages | |
def index(): | |
return render_template('index.html') | |
def collect_data(): | |
try: | |
subprocess.run(['python', 'setup_data.py'], check=True) | |
flash('Data collection completed successfully!', 'success') | |
except subprocess.CalledProcessError as e: | |
flash(f'Error during data collection: {str(e)}', 'error') | |
return redirect(url_for('index')) | |
def analyze_data(): | |
try: | |
subprocess.run(['python', 'analyze_data_quality.py'], check=True) | |
flash('Data analysis completed successfully!', 'success') | |
except subprocess.CalledProcessError as e: | |
flash(f'Error during data analysis: {str(e)}', 'error') | |
return redirect(url_for('index')) | |
if __name__ == '__main__': | |
app.run(debug=True) |