otter.api
Reference¶
-
otter.api.
export_notebook
(nb_path, dest=None, debug=False, exporter_type=None, **kwargs)¶ Exports a notebook file at
nb_path
to a PDF with optional filtering and pagebreaks. Accepts otherkwargs
passed to the exporter class’sconvert_notebook
class method.- Parameters
nb_path (
str
) – path to notebookdest (
str
, optional) – path to write PDFdebug (
bool
, optional) – whether to run export in debug modeexporter_type (
str
, optional) – the type of exporter to use; one of['html', 'latex']
**kwargs – additional configurations passed to exporter
-
otter.api.
grade_submission
(ag_path, submission_path, quiet=False, debug=False)¶ Runs non-containerized grading on a single submission at
submission_path
using the autograder configuration file atag_path
.Creates a temporary grading directory using the
tempfile
library and grades the submission by replicating the autograder tree structure in that folder and running the autograder there. Does not run environment setup files (e.g.setup.sh
) or install requirements, so any requirements should be available in the environment being used for grading.Print statements executed during grading can be suppressed with
quiet
.- Parameters
ag_path (
str
) – path to autograder zip filesubmission_path (
str
) – path to submission filequiet (
bool
, optional) – whether to suppress print statements during grading; defaultFalse
debug (
bool
, optional) – whether to run the submission in debug mode (without ignoring errors)
- Returns
- the results object produced during the grading of the
submission.
- Return type
otter.test_files.GradingResults