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

--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

--v1

Use Otter Assign format v1 instead of v0

Arguments

MASTER

Required argument

RESULT

Required argument

check

Check the Python script or Jupyter Notebook FILE against tests.

otter check [OPTIONS] FILE

Options

-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

--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

--no-xecjk

Force-disable 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

-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

Options

python | r

--username <username>

Gradescope username for generating a token

--password <password>

Gradescope password for generating a token

--token <token>

Gradescope token for uploading PDFs

Arguments

FILES

Optional argument(s)

grade

Grade assignments locally using Docker containers.

otter grade [OPTIONS]

Options

-p, --path <path>

Path to directory of submissions

-a, --autograder <autograder>

Path to autograder zip file

-o, --output-dir <output_dir>

Directory to which to write output

-z, --zips

Whether submissions are zip files from Notebook.export

--ext <ext>

The extension to glob for submissions

Options

ipynb | py | Rmd | R | r

--pdfs

Whether to copy notebook PDFs out of containers

-v, --verbose

Flag for verbose output

--containers <containers>

Specify number of containers to run in parallel

--image <image>

Custom docker image to run on

--no-kill

Do not kill containers after grading

--debug

Print stdout/stderr from grading for debugging

--prune

Prune all of Otter’s grading images

-f, --force

Force action (don’t ask for confirmation)

run

Run non-containerized Otter on a single submission.

otter run [OPTIONS] SUBMISSION

Options

-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

Arguments

SUBMISSION

Required argument