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,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}
...
Positional Arguments
- command
Possible choices: delete-classlist, download-classlist, upload-classlist, get-reassembled, 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
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.
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
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. TODO: argparse has this as optional but no default setting for this yet: maybe it should assign to the next available paper number or something like that?
- -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 the special string -q all which attaches the page to all questions (this is also the default). An empty list will “discard” that particular page. TODO: discard, dnm and all are currently “in-flux”.
- -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.