A comprehensive Flask-based web application for scraping and analyzing student academic results with advanced data visualization and customizable Excel exports.
- Web Scraping: Automatically scrape student results from university portals
- Dynamic Semester Detection: Automatically detects and handles any number of semester tables (sem1, sem2, sem3, sem4, etc.)
- Column Selection: Choose which data fields to include in Excel exports via checkbox interface
- Data Analysis: Comprehensive statistical analysis with interactive charts
- Professional UI
- Excel Export: Customizable Excel reports with enhanced formatting
- Python 3.8 or higher
- Chrome browser (for web scraping)
- Git
-
Clone the repository
git clone <repository-url> cd student-result-analysis
-
Create virtual environment
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Set environment variables
# Create .env file echo "SESSION_SECRET=your-secret-key-here" > .env # On Windows Command Prompt set SESSION_SECRET=your-secret-key-here # On Windows PowerShell $env:SESSION_SECRET="your-secret-key-here" # On macOS/Linux export SESSION_SECRET="your-secret-key-here"
-
Start the Flask application
python app.py
Or using Gunicorn (recommended for production):
gunicorn --bind 0.0.0.0:5000 --reuse-port --reload main:app
-
Access the application Open your browser and navigate to:
http://localhost:5000
- Choose between individual roll numbers or range-based scraping
- Select which columns to include in the Excel export
- Enter roll numbers or specify a range
- Click "Start Scraping" to begin the process
- Monitor progress in real-time
- Download the generated Excel file
- Upload an existing Excel or CSV file
- View comprehensive statistical analysis
- Explore interactive charts and visualizations
- Download enhanced analysis reports
student-result-analysis/
├── app.py # Main Flask application
├── main.py # Application entry point
├── scraper.py # Web scraping functionality
├── data_analyzer.py # Data analysis engine
├── requirements.txt # Python dependencies
├── static/
│ ├── css/
│ │ └── style.css # Custom styling
│ └── js/
│ ├── main.js # Main JavaScript
│ └── charts.js # Chart functionality
├── templates/
│ ├── base.html # Base template
│ ├── index.html # Main dashboard
│ ├── analyze.html # Analysis page
│ └── progress.html # Progress tracking
└── uploads/ # File upload directory
SESSION_SECRET: Secret key for Flask sessions (required)DATABASE_URL: Database connection string (optional)
- Modify
scraper.pyto adapt to different university portals - Update CSS variables in
static/css/style.cssfor theme customization - Adjust analysis parameters in
data_analyzer.py
The application requires the following Python packages:
- Flask (web framework)
- Selenium (web scraping)
- Pandas (data manipulation)
- XlsxWriter (Excel generation)
- Matplotlib/Seaborn (data visualization)
- WebDriver Manager (Chrome driver management)
For web scraping functionality:
- Chrome browser must be installed
- ChromeDriver is automatically managed by webdriver-manager
-
ChromeDriver not found
- Ensure Chrome browser is installed
- Check internet connection for automatic driver download
-
Permission errors
- Run with appropriate permissions
- Check file system permissions for uploads/ directory
-
Port already in use
- Change port in app.py or kill existing process
- Use different port:
python app.py --port 5001
-
Module not found errors
- Ensure virtual environment is activated
- Reinstall requirements:
pip install -r requirements.txt
- Fork the repository
- Create a feature branch
- Implement changes with tests
- Submit a pull request
- Follow PEP 8 guidelines
- Use meaningful variable names
- Add docstrings to functions
- Include error handling
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Check the troubleshooting section
- Review existing issues
- Create a new issue with detailed description
Contributions are welcome! Please read the contributing guidelines before submitting pull requests.