CLI Reference

CLI Reference#

otter#

Command-line utility for Otter-Grader, a Python-based autograder for Jupyter Notebooks, RMarkdown files, and Python and R scripts. For more information, see https://otter-grader.readthedocs.io/.

otter [OPTIONS] COMMAND [ARGS]...

Options

--version#

Show the version and exit

assign#

Create distribution versions of the Otter Assign formatted notebook MASTER and write the results to the directory RESULT, which will be created if it does not already exist.

otter assign [OPTIONS] MASTER RESULT

Options

-v, --verbose#

Verbosity of the logged output

--no-run-tests#

Do not run the tests against the autograder notebook

--no-pdfs#

Do not generate PDFs; overrides assignment config

--username <username>#

Gradescope username for generating a token

--password <password>#

Gradescope password for generating a token

--debug#

Do not ignore errors in running tests for debugging

Arguments

MASTER#

Required argument

RESULT#

Required argument

check#

Check the Python script or Jupyter Notebook FILE against tests.

otter check [OPTIONS] FILE

Options

-v, --verbose#

Verbosity of the logged output

-q, --question <question>#

A specific quetsion to grade

-t, --tests-path <tests_path>#

Path to the direcotry of test files

--seed <seed>#

A random seed to be executed before each cell

Arguments

FILE#

Required argument

export#

Export a Jupyter Notebook SRC as a PDF at DEST with optional filtering.

If unspecified, DEST is assumed to be the basename of SRC with a .pdf extension.

otter export [OPTIONS] SRC [DEST]

Options

-v, --verbose#

Verbosity of the logged output

--filtering#

Whether the PDF should be filtered

--pagebreaks#

Whether the PDF should have pagebreaks between questions

-s, --save#

Save intermediate file(s) as well

-e, --exporter <exporter>#

Type of PDF exporter to use

Options:

latex | html

--xecjk#

Enable xeCJK in Otter’s LaTeX template

Arguments

SRC#

Required argument

DEST#

Optional argument

generate#

Generate a zip file to configure an Otter autograder, including FILES as support files.

otter generate [OPTIONS] [FILES]...

Options

-v, --verbose#

Verbosity of the logged output

-t, --tests-dir <tests_dir>#

Path to test files

-o, --output-path <output_path>#

Path at which to write autograder zip file

-c, --config <config>#

Path to otter configuration file; ./otter_config.json automatically checked

--no-config#

Disable auto-inclusion of unspecified Otter config file at ./otter_config.json

-r, --requirements <requirements>#

Path to requirements.txt file; ./requirements.txt automatically checked

--no-requirements#

Disable auto-inclusion of unespecified requirements file at ./requirements.txt

--overwrite-requirements#

Overwrite (rather than append to) default requirements for Gradescope; ignored if no REQUIREMENTS argument

-e, --environment <environment>#

Path to environment.yml file; ./environment.yml automatically checked (overwrite)

--no-environment#

Disable auto-inclusion of unespecified environment file at ./environment.yml

-l, --lang <lang>#

Assignment programming language; defaults to Python

--username <username>#

Gradescope username for generating a token

--password <password>#

Gradescope password for generating a token

--token <token>#

Gradescope token for uploading PDFs

--python-version <python_version>#

Python version to use in the grading image

--channel-priority-strict#

Whether to set conda’s channel_priority to strict in the setup.sh file

--exclude-conda-defaults#

Whether to exlucde conda’s defaults channel from the environment.yml file

Arguments

FILES#

Optional argument(s)

grade#

Grade submissions in PATHS locally using Docker containers. PATHS can be individual file paths or directories containing submissions ending with extension EXT.

otter grade [OPTIONS] [PATHS]...

Options

-v, --verbose#

Verbosity of the logged output

-n, --name <name>#

An assignment name to use in the Docker image tag

-a, --autograder <autograder>#

Path to autograder zip file

-o, --output-dir <output_dir>#

Directory to which to write output

--ext <ext>#

The extension to glob for submissions

Options:

ipynb | py | Rmd | R | r | zip

--summaries#

Whether to write the otter run results for each graded notebook

--pdfs#

Whether to copy notebook PDFs out of containers

--containers <containers>#

Specify number of containers to run in parallel

--image <image>#

A Docker image tag to use as the base image

--timeout <timeout>#

Submission execution timeout in seconds

--no-network#

Disable networking in the containers

--no-kill#

Do not kill containers after grading

--debug#

Run in debug mode (without ignoring errors thrown during execution)

--prune#

Prune all of Otter’s grading images

-f, --force#

Force action (don’t ask for confirmation)

Arguments

PATHS#

Optional argument(s)

run#

Run non-containerized Otter on a single submission, writing results to a JSON file.

otter run [OPTIONS] SUBMISSION

Options

-v, --verbose#

Verbosity of the logged output

-a, --autograder <autograder>#

Path to autograder zip file

-o, --output-dir <output_dir>#

Directory to which to write output

Suppress Otter logo in stdout

--debug#

Do not ignore errors when running submission

-p, --pickle-results#

Output GradingResults pickle file

Arguments

SUBMISSION#

Required argument