VON is a Python script I wrote in order to help me manage the problems and solutions to olympiad databases. I haven't gotten around to properly documenting this, but posting it by popular request.
Here are a few hints:
- You need to create a copy of
rc.py
based onrc.py.EXAMPLE
. This is the "settings" file for the script. - This directory should be included under PYTHONPATH,
and invoked by
python -m von
(to get an interactive terminal). If you only want to issue one command, you can also type it directly, e.g.python -m von help
will list the help and exit. - You may need to
pip install -r requirements.txt
. - The
help
command lists possible commands. - LaTeX integration uses von.sty. The previewer requires evan.sty.
add "Shortlist 2016 G2"
: add problem to database
- Problems are stored in TeX files in
VON_BASE_PATH
. You can keep sub-directories in here, as well, to organize those files. - Problems and solutions are separated using
SEPARATOR
inrc.py
, which by default is three dashes padded by newlines. So when entering new problems, write the statement, the separator, and then the solution. - Actually more generally, each problem and solution is separated into several "bodies", delimited by the seperator. It's basically assumed that 0'th body is the problem statement and the 1'st body is the solution, but you can have further bodies for other purposes too.
edit "Shortlist 2016 G2"
: edit entry for problem in database
- Meta-data is stored at the top of each file after being added.
- Problems must have a source like "Shortlist 2016 G2".
- Problems should also have a description, and a set of tags.
If a tag is specified as a sorting tag in
rc.py
, it will be displayed differently, but otherwise functionally equivalently. - Problems can also have an "author" attribute, which is displayed.
The search
command searches everything.
Use search --help
for a lot of options.
search "Shortlist 2016"
: search for problems with "Shortlist 2016"search -t anglechase
: searches for problems taggedanglechase
The s
command is a shorthand for search
.
When using various commands,
every problem can be identified in two ways.
One is by the source, such as "Shortlist 2016 G2".
Alternatively, when one uses the search command,
the results are indexed by positive integers,
and those indices can be used instead of the source.
For example, show 3
will display the 3rd problem in search results.
show 3
: Print the 3rd problempo 3
: Produces a TeX/PDF of the problem and solution.
Use show --help
and po --help
for more details