This Python script allows users to extract and analyze grade distributions from a file (PDF, SVG, or Excel). It performs the following tasks:
Reads the file and extracts a table.
Displays the extracted table.
Prompts the user to select the column containing grades.
Calculates the number and percentage of students who passed the course.
Generates a frequency plot of the grades with a user-defined title.
- Create a Virtual Environment
python -m venv venv
#Activate the virtual environment on Windows:
venv\Scripts\activate
#On macOS/Linux:
source venv/bin/activate - Install Dependencies
#Once the virtual environment is activated, install the required dependencies:
pip install -r requirements.txtRun the script with:
python GradeExtractor.pyYou can also use the following command line arguments:
python GradeExtractor.py --file <path/to/your/file> --title <title/for/your/file> --output <path/to/output/file> --lang <preferred/lang> --rows <number/of/rows> --thresshold <minimum/grade>| Argument | Description |
|---|---|
--file |
Path to the input file (PDF, CSV, or Excel). |
--title |
Custom title for the grade distribution plot. |
--output |
Path to save the output plot (default: plot.png). |
--lang |
Language code for localization (default: en). |
--thresshold |
Minimum grade required to consider a student as "passing". |
--rows |
Number of rows from the table to display before prompting for column selection. |
