.. | ||
checkheaders.py | ||
cli_args.py | ||
compare_sp.py | ||
config.py | ||
data_processor.py | ||
file_utils.py | ||
process_predelib_file.py | ||
README.md | ||
script.py | ||
sp_comparison.log | ||
startpakket_processing.log | ||
todo.md |
Startpakket Processing Tool
A Python tool for processing and comparing student data from predeliberation and dashboard Excel files. The tool identifies students with FAIL status and compares SP (study points) values between different data sources.
Project Structure
The codebase has been organized into focused modules:
Core Scripts
script.py
- Main orchestration script, handles command-line interface and coordinates all processingdata_processor.py
- Core data processing functions for Excel file handlingcli_args.py
- Command-line argument parsing and validationconfig.py
- Configuration management and logging setupfile_utils.py
- File I/O utilities and output formatting
Processing Modules
checkheaders.py
- Excel file header processing and normalizationprocess_predelib_file.py
- Predeliberation file analysis and FAIL status detectioncompare_sp.py
- SP value comparison between predeliberation and dashboard files
Usage
Basic Usage
python script.py --predelib db.xlsx --dashboard dashboard_inschrijvingen.xlsx
Advanced Usage
# Save results to JSON file
python script.py -p db.xlsx -d dashboard_inschrijvingen.xlsx --output results.json
# Enable verbose logging
python script.py --predelib db.xlsx --dashboard dashboard_inschrijvingen.xlsx --verbose
# Custom log file
python script.py --predelib db.xlsx --dashboard dashboard_inschrijvingen.xlsx --log-file custom.log
Command-line Options
--predelib, -p
: Path to predeliberation Excel file (required)--dashboard, -d
: Path to dashboard Excel file (required)--output, -o
: Output file path for JSON results (optional)--verbose, -v
: Enable verbose logging--log-file
: Custom log file path (default: startpakket_processing.log)
Features
- File Validation: Automatically validates that input files exist and are Excel format
- Header Processing: Intelligently detects and normalizes Excel headers
- FAIL Detection: Identifies students with FAIL status in adviesrapport code
- SP Comparison: Compares study points between predeliberation and dashboard data
- Comprehensive Logging: Detailed logging with configurable verbosity
- Flexible Output: Console summary with optional JSON export
- Error Handling: Robust error handling with appropriate exit codes
Installation
- Ensure Python 3.12+ is installed
- Install required dependencies:
pip install pandas openpyxl
Input File Requirements
Predeliberation File (db.xlsx)
Must contain columns:
- ID, Achternaam, Voornaam, E-mail
- Totaal aantal SP, Aantal SP vereist
- Adviesrapport code, Waarschuwing
Dashboard File (dashboard_inschrijvingen.xlsx)
Must contain columns:
- ID, Naam, Voornaam
- Ingeschr. SP (intern)
Output
The tool provides:
- Console Summary: Overview of processing results
- Failed Students Report: Detailed list of students with FAIL status
- SP Mismatch Report: Any discrepancies between predeliberation and dashboard SP values
- Optional JSON Export: Machine-readable results for further processing
Exit Codes
0
: Success (no mismatches found)1
: Processing completed but mismatches found130
: Process interrupted by user- Other: Fatal error occurred
Logging
All processing activities are logged to startpakket_processing.log
by default. Use --verbose
for detailed debug information.