plom-cli

An under-development tool for scripting and command-line access to Plom servers.

Plom tools for pushing and manipulating bundles from the command line.

usage: plom-cli [-h] [--version]
                {delete-classlist,download-classlist,upload-classlist,get-reassembled,get-unmarked,upload-bundle,list-bundles,push-bundle,upload-source,delete-source,upload-spec,delete-bundle,wait-bundle,id-paper,un-id-paper,reset-task,clear,map,extract-rectangle}
                ...

Positional Arguments

command

Possible choices: delete-classlist, download-classlist, upload-classlist, get-reassembled, get-unmarked, upload-bundle, list-bundles, push-bundle, upload-source, delete-source, upload-spec, delete-bundle, wait-bundle, id-paper, un-id-paper, reset-task, clear, map, extract-rectangle

Named Arguments

--version

show program’s version number and exit

Sub-commands

delete-classlist

Delete the classlist held by the server.

plom-cli delete-classlist [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

download-classlist

Copy the classlist held by the server to stdout, in CSV format.

plom-cli download-classlist [-h] [-s SERVER[:PORT]] [-u USERNAME]
                            [-w PASSWORD]

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

upload-classlist

Add student info from this CSV file to server’s classlist. Any info already on server will be retained, BUT the whole operation will be rejected if the upload mentions even a single student ID already present on the server.

plom-cli upload-classlist [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                          csvfile

Positional Arguments

csvfile

a CSV file with column headers ‘id’,’name’, and [optionally] ‘paper_number’.

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

get-reassembled

Download a reassembled paper as a PDF file from the server. Will fail if the paper is not reassembled yet.

plom-cli get-reassembled [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                         papernum

Positional Arguments

papernum

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

get-unmarked

Download a unmarked paper as a PDF file from the server. Will fail if no scanned images are associated with the paper.

plom-cli get-unmarked [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                      papernum

Positional Arguments

papernum

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

upload-bundle

Upload a bundle of page images in a PDF file.

plom-cli upload-bundle [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD] pdf

Positional Arguments

pdf

a PDF file.

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

list-bundles

List the scanned bundles on the server

plom-cli list-bundles [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

push-bundle

A bundle that is ready to be marked (e.g., no unknown pages etc) is ready for marking. This command moves its pages from the staging area and makes them available for marking.

Use the list-bundles command to check on the status of your bundle.

plom-cli push-bundle [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                     bundle_id

Positional Arguments

bundle_id

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

upload-source

Upload a PDF file containing a valid assessment source version, replacing the existing source, if any.

plom-cli upload-source [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                       [-v VERSION]
                       source_pdf

Positional Arguments

source_pdf

A PDF file containing a valid assessment source.

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

-v

Source version number (default 1).

Default: 1

delete-source

Remove the indicated assessment source.

plom-cli delete-source [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                       [-v VERSION]

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

-v

Source version number (default 1).

Default: 1

upload-spec

Upload a .toml file containing an assessment specification.

plom-cli upload-spec [-h] [--force-public-code] [-s SERVER[:PORT]]
                     [-u USERNAME] [-w PASSWORD]
                     tomlfile

Positional Arguments

tomlfile

The assessment specification.

Named Arguments

--force-public-code

Allow specifying the “publicCode” which prevents uploading papers from a different server. Read the docs before using this!

Default: False

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

delete-bundle

A bundle that is in staging (a.k.a. not pushed), and isn’t being processed may be deleted.

Use the list-bundles command to check on the status of your bundle.

plom-cli delete-bundle [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                       bundle_id

Positional Arguments

bundle_id

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

wait-bundle

Wait for a bundle to finish processing, NOT IMPLEMENTED YET

plom-cli wait-bundle [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                     bundle_id

Positional Arguments

bundle_id

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

id-paper

Identify a paper by associating it with a particular student id (and name). The id must be unique and not in use. The name is essentially arbitrary (as lots of people have the same name). This tool doesn’t care about mundane things like classlists. Its your responsibility to send reasonable data that has meaning to you.

plom-cli id-paper [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                  [--sid SID] [--name NAME]
                  papernum

Positional Arguments

papernum

Which paper number to identify

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

--sid
--name

un-id-paper

Unidentify a paper, removing the association with a student

plom-cli un-id-paper [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                     papernum

Positional Arguments

papernum

Which paper number to identify

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

reset-task

Reset the task, making annotations out-of-date. The task will need to be marked again.

plom-cli reset-task [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]
                    papernum question_idx

Positional Arguments

papernum

Which paper to reset

question_idx

Which question to reset

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

clear

Clear “scanner” login after a crash or other expected event.

plom-cli clear [-h] [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]

Named Arguments

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

map

Assign pages of a bundle to particular question(s), ignoring QR-codes etc.

plom-cli map [-h] [--papernum T] [-q N] [-s SERVER[:PORT]] [-u USERNAME]
             [-w PASSWORD]
             bundle_id bundle_page

Positional Arguments

bundle_id

Which bundle

bundle_page

Which page of the bundle

Named Arguments

--papernum, -t

Which paper number to attach the page to. It must exist; you must create it first with appropriate versions.

-q, --question

Which question(s) are answered on the page. You can pass a single integer, or a list like -q [1,2,3] which attaches the page to questions 1, 2 and 3. You can also pass one of several special strings: -q all attaches the page to all questions (this is also the default). -q dnm attaches the page to a particular paper but sets it “Do Not Mark”. -q discard discards the page. An empty list will is currently the same as -q all.

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

extract-rectangle

Given version, page number, paper number, and boundaries of the rectangle,

extract the rectangle from the scanned paper with that page number and version.

plom-cli extract-rectangle [-h] --version VERSION --pagenum PAGENUM --papernum
                           PAPERNUM [--left LEFT] [--top TOP] [--right RIGHT]
                           [--bottom BOTTOM] [--out-path OUT_PATH]
                           [-s SERVER[:PORT]] [-u USERNAME] [-w PASSWORD]

Named Arguments

--version, -v

The version of the page to extract

--pagenum

The page number of the paper that will be extracted

--papernum

The paper number to be extracted

--left, -l
x coordinate of the rectangle’s top left corner. The coordinate is relative

to the QR codes so values are in the interval [0,1] (plus some overhang for the margins). If not provided then default to 0

--top, -t
y coordinate of the rectangle’s top left corner. The coordinate is relative

to the QR codes so values are in the interval [0,1] (plus some overhang for the margins). If not provided then default to 0

--right, -r
x coordinate of the rectangle’s bottom right corner. The coordinate is relative

to the QR codes so values are in the interval [0,1] (plus some overhang for the margins). If not provided then default to 1

--bottom, -b
y coordinate of the rectangle’s top bottom right corner. The coordinate is relative

to the QR codes so values are in the interval [0,1] (plus some overhang for the margins). If not provided then default to 1

--out-path
The output path of the extracted rectangle image. If not provided, the image will be saved as:

“./extracted_region_V{version}_page{page_num}_paper{paper_num}.png”

where {version}, {page_num}, and {paper_num} are replaced by their respective values.

-s, --server

URL of server to contact. In SERVER, the protocol prefix is semi-optional: you can omit it and get https by default, or you can force http by including that explicitly. If [:PORT] is omitted, SERVER:41984 will be used. The environment variable PLOM_SERVER will be used if –server is not given.

-u, --username

Also checks the environment variable PLOM_USERNAME.

-w, --password

Also checks the environment variable PLOM_PASSWORD.

See help for each subcommand or consult online documentation for an overview of the steps in setting up a server.

Most subcommands communicate with a server, which can be specified on the command line; the environment variable PLOM_SERVER provides the default. Authentication is typically required. This can be done through command-line options, or interactively at the command prompt, or by setting the environment variables PLOM_USERNAME and PLOM_PASSWORD. For details, see the extended help for any specific subcommand.