A web application built for Greater Ohio Virtual School to automate the merging and processing of student attendance reports. The tool combines weekly activity reports with cumulative attendance data to generate comprehensive reports with calculated metrics.
🔗 Live Application: https://govs-csv-processor.onrender.com/
This Flask-based application processes two types of student reports:
- Weekly Report - Contains weekly activity data with time spent per student
- Attendance Report - Contains cumulative data including lessons completed, hours required, and total hours
The app merges these reports, normalizes student names, calculates hours ahead/behind schedule, and exports a consolidated CSV report.
- File Upload: Supports CSV and Excel (.xlsx) file uploads (max 16 MB)
- Intelligent Merging: Automatically matches students across reports using name normalization
- Data Processing:
- Converts time formats to standardized HH:MM format
- Calculates hours ahead/behind schedule
- Handles edge cases (missing data, malformed time values)
- Flexible Output:
- Customizable column selection and ordering
- Multiple sorting options (by name or hours required)
- Auto-inserts blank rows to group students by hours when sorted by hours
- Modern UI: Clean web interface with light/dark mode toggle
- Instant Export: Generates timestamped CSV files for download
- Navigate to the application URL
- Click Instructions for detailed guidance on preparing your files
- Upload two files:
- Weekly report (must contain
StudentNameandTotalMincolumns) - Attendance report (must contain student names, lessons, hours data)
- Weekly report (must contain
- Select desired columns for the output report
- Choose sorting preference (alphabetical or by hours required)
- Click Process Files to generate and download your report
The generated report includes:
- Last Name / First Name: Student identifiers
- Lessons Complete: Total lessons finished
- Difference in Lessons: Gap in lesson completion
- Hours Required: Expected hours at this point
- Total Cumulative Hours: All-time hours logged
- Weekly Hours: Hours from the most recent week (in [h]:mm format)
- Hours Ahead/Behind: Calculated difference between total and required hours
- Python 3.11+
- pip package manager
- (Recommended) A virtual environment for dependency isolation
-
Clone the repository
git clone <repository-url> cd GOVS
-
Create a virtual environment (recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set environment variables (optional)
export SECRET_KEY="your-secret-key-here" export UPLOAD_FOLDER="/path/to/uploads" # Defaults to ./uploads on Windows, /tmp/uploads on Unix export LOG_LEVEL="INFO" # Optional: configure server logging
-
Run the development server
python app.py
The app will be available at
http://localhost:10000
pytestTests cover the core process_files function and data processing logic.
GOVS/
├── app.py # Main Flask application
├── gunicorn_config.py # Production server configuration
├── requirements.txt # Python dependencies
├── render.yaml # Render.com deployment config
├── templates/
│ ├── index.html # Main upload interface
│ └── instructions.html # User instructions page
└── tests/
└── test_process_files.py # Unit tests
load_report(path, is_weekly): Loads CSV/Excel files into pandas DataFramestime_to_hours(time_val): Normalizes time values to HH:MM formatprocess_files(...): Core logic for merging, calculating, and formatting reportsallowed_file(filename): Validates file extensions
- Backend: Flask 3.0.3, Python 3.11
- Data Processing: Pandas 2.2.2, NumPy 2.0.1
- File Handling: openpyxl 3.1.5 (Excel support)
- Production Server: Gunicorn 22.0.0
- Testing: pytest 8.3.2
The application is configured for deployment on Render.com:
-
Service Configuration: Defined in render.yaml
- Python 3.11 environment
- Free tier plan
- Starts via Gunicorn with custom configuration and health check at
/healthz
-
Required Environment Variables (set in Render dashboard):
SECRET_KEY: Required for Flask sessions and flash messagesUPLOAD_FOLDER: File upload directory (defaults to/tmp/uploads)- Optional:
LOG_LEVEL,GUNICORN_WORKERS,GUNICORN_THREADS,GUNICORN_TIMEOUT
-
Deployment Process:
- Push code to connected Git repository
- Render automatically runs
pip install -r requirements.txt - Starts the app with
gunicorn -c gunicorn_config.py app:app
-
Health Check: Available at
/healthzendpoint
The app can be deployed to any platform supporting Python web applications:
- Heroku: Use the Procfile format
- AWS/GCP: Deploy with Docker or native Python support
- Traditional hosting: Run with Gunicorn or uWSGI behind nginx/Apache
MIT License