API reference
API reference
Every public class, function and constant in the grader and assignments packages, generated from the source docstrings. If you are driving the grader from Python, start with grader.service.GradingService — it is the only entry point the Streamlit UI uses.
Quick example
from grader import GraderSettings, GradingService
settings = GraderSettings(execution_mode="docker",
shared_data_paths=["examples/data/zillow_zhvi.csv"])
service = GradingService.from_rubric_path("rubrics/hw1.yaml", settings)
for problem in service.preflight():
print("warning:", problem)
loaded = service.load_submissions("examples/submissions")
session = service.run(loaded.candidates)
for result in session.ordered_results():
print(result.student_id, result.total_score, "/", result.max_score,
"review" if result.needs_review else "")
print("saved to", session.root)Package#
Engine#
grader.serviceThe grading service the UI talks to.3 classes
grader.rubricYAML rubric loading (design.md section 20).3 classes · 2 functions
grader.modelsStructured result types shared by the engine, the store and the UI.4 classes · 2 functions
grader.resultsGrading session persistence and exports (design.md §28-29).1 class · 2 functions
grader.scoringReview policy and class-level aggregation (design.md §8, §25).7 functions
grader.feedbackStudent-facing markdown feedback (design.md §30).3 functions
Execution#
grader.discoveryFind student submissions in a folder or a Canvas export ZIP (design.md §16-17).1 class · 8 functions
grader.executorNotebook execution (design.md §18-19).2 classes · 7 functions
grader.notebook_runnerStandalone notebook runner. Copied into the working directory and executed as a subprocess — locally with the host interpreter, or inside the grading container. It must not import anything from the grader package.1 function
grader.probe_runtimeCode injected into the student's kernel after their notebook runs.module
Evidence#
grader.notebookStatic analysis of a student notebook (design.md §23, structural grading).1 class · 5 functions
grader.inspectionHost-side reasoning over the probe payload.13 functions
grader.answersAnswers read out of a notebook's own saved outputs (design.md §23, §25).3 classes · 2 functions
grader.chartsChart evidence for visualization assignments (design.md §23, §25).3 classes · 8 functions
grader.llmOptional LLM-assisted qualitative grading (design.md §26).3 classes · 2 functions
grader.utilsSmall shared helpers for the grading engine.11 functions
Assignments#
assignmentsPer-assignment graders. Importing the package registers every grader.7 exports
assignments.baseAssignment grader base class and registry.2 classes · 3 functions
assignments.hw1Assignment 1 autograder — "The Donut Effect for Philadelphia ZIP Codes".1 class
assignments.hw2Assignment 2 autograder — exploratory visualization with matplotlib, seaborn and altair.1 class
assignments.hw3Assignment 3 autograder — evictions, code violations and the NDVI.1 class