Skip to main content

VON: vEnhance's Olympiad Navigator

A problem database written in Python

Language: Python License Last commit von status von status

style: black types: pyright lint: ruff Forks Stars

VON is a Python script I wrote in order to help me manage my centralized database of solutions to olympiad problems.

There is no graphical user interface; it is based on standard command line. Therefore, it will work best on Linux systems. Windows users may experience some grief, and Windows users unfamiliar with command line are going to have a bad time.

I haven't gotten around to properly documenting this, but posting it by popular request. Here are a few hints. Pull requests to improve this documentation are welcome.

Installation

  1. Install vondb from PyPI (note the package name is vondb and not von; but the command and module are named von). Here is the PyPI listing.

    • If you're unfamiliar with how to do this, I suggest using uv: you can do uv tool install vondb.
    • Or pip install vondb works too, if you want to use Pip directly. (But I think uv is better.)
    • If you're on Arch Linux, you can also install from python-vondb in AUR.
  2. When first run, the program will (try to) create a configuration file ~/.config/von/config or similar if it does not exist. You should then edit that file and choose some values. The program won't work correctly until after you have chosen e.g. the base_path parameter.

  3. Optional LaTeX integration uses von.sty and PythonTeX. The optional previewer requires evan.sty. (See below for details.) This assumes a working LaTeX compiler with latexmk installed. (I recommend TeX Live).

  4. If fuzzy searching is desired (optional), install fzf.

Help

Use von help to display full help. The following information is mostly a subset of it.

To exit VON, type an EOF character (usually Ctrl-D).

Storing problems and solutions

  • add "Shortlist 2016 G2": add problem to database
  1. Problems are stored in TeX files in VON_BASE_PATH. You can keep subdirectories in here, as well, to organize those files.
  2. Problems and solutions are separated using SEPARATOR in config, which by default is three dashes padded by newlines. So when entering new problems, write the statement, the separator, and then the solution.
  3. Actually more generally, each problem and solution is separated into several "bodies", delimited by the separator. 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.

Metadata

  • edit "Shortlist 2016 G2" or edit "16SLG2": edit entry for problem in database
  1. Metadata is stored at the top of each file after being added.

  2. Problems must have a source like "Shortlist 2016 G2".

  3. Problems should also have a description, and a set of tags. If a tag is specified as a sorting tag in config, it will be displayed differently, but otherwise functionally equivalently.

  4. Problems can also have an "author" attribute, which is displayed.

  5. Problems can also have a "hardness" attribute, an integer, which is displayed differently by the user interface. You can pick any scale you want; here is mine.

  6. Problems can be marked as SECRET. Problems marked as SECRET will appear in searches, but will be replaced by placeholders (unless --brave is passed).

    There are two ways to mark a problem as SECRET:

    • Include SECRET as a substring of the problem's source.
    • Include secret as one of the problem's tags.

An example of an entry:

desc:  $5^n$ has six consecutive zeros
author: Evan Chen
source:  JMO 2016/2
tags:  [favorite, construct, medium]
hardness: 25

---

Prove that there exists a positive integer $n < 10^6$
such that $5^n$ has six consecutive zeros in its decimal representation.

---

We will prove that $\boxed{n = 20 + 2^{19} = 524308}$ fits the bill.

... (rest of solution) ...

Searching

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

The s command is a shorthand for search.

You can use search --everything to list all problems.

Alternatively, the f command opens an interface which allows you to fuzzily search for a problem across problems with a preview. It is an alias for show without arguments.

Displaying problems

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 problem
  • po 3: Produces a TeX/PDF of the problem and solution.

Use show --help and po --help for more details.

Recompiling the index

Sometimes the list of problems and file paths might become messed up in some way (for example, if you move a file). To fix this run von build to recompile the entire index. von build is also useful in the cases of deleting a file and thus problem from the index.

Preview

When running von add or von edit on Linux, the program creates the file /tmp/preview/von_preview.tex which is a wrapper file that inputs the currently edited problem. If you use latexmk (which I recommend!), you can run latexmk -pvc on this in order to render what you are typing. This makes it possible to work simultaneously with the input and output that you are adding in to von.

LaTeX integration

If you have von.sty and latexmk, then by using a similar mechanic to Asymptote, you can also directly query the database for problems. You should add a pythontex routine to your .latexmkrc for this to auto-work; an example might be:

sub pythontex {
    system("pythontex --runall true \"$_[0]\"");
    system("touch \$(basename \"$_[0]\").pytxmcr");
    return;
}
add_cus_dep("pytxcode", "pytxmcr", 0, "pythontex");

The basic syntax is that \voninclude{source} will include the problem statement (0th body), while \voninclude[1]{source} will include the 1st body (the solution), etc.

Of course, this would most commonly be used with theorem environments, so you can use some shortcuts to this effect. The three possible shortcuts are:

  • \von{X} is shorthand for \begin{problem}[X] \voninclude{X} \end{problem}
  • \von[text]{X} is shorthand for \begin{problem}[text] \voninclude{X} \end{problem}
  • \von*{X} is shorthand for \begin{problem} \voninclude{X} \end{problem}

Of course, the string problem might want to be changed, if you are using a differently named theorem environment. You can change this by running \renewcommand{\vonenvname}{name}.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vondb-3.6.1.tar.gz (48.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vondb-3.6.1-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

Details for the file vondb-3.6.1.tar.gz.

File metadata

  • Download URL: vondb-3.6.1.tar.gz
  • Upload date:
  • Size: 48.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vondb-3.6.1.tar.gz
Algorithm Hash digest
SHA256 4db98612779d832c91afb85be4ae4526939c0d72b2a58d689a2e981ccb38b1e3
MD5 b73b277d00893626782e4fcc3239289b
BLAKE2b-256 12dc47c48ee8f739b8413f4e82ed3f6c9854bbc0ec3ec72f63878674eaf9769a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vondb-3.6.1.tar.gz:

Publisher: release.yml on vEnhance/von

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vondb-3.6.1-py3-none-any.whl.

File metadata

  • Download URL: vondb-3.6.1-py3-none-any.whl
  • Upload date:
  • Size: 42.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vondb-3.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdf4b4b3b28990e743192896a5136dba17550b48ddf5acfcd9d483ed58832ace
MD5 a82009cda23abc2e8b189194ace2236d
BLAKE2b-256 998a299fe7ff474cdbd53edf284096505ebb9440e3ad5f84ace90a6cbde5d811

See more details on using hashes here.

Provenance

The following attestation bundles were made for vondb-3.6.1-py3-none-any.whl:

Publisher: release.yml on vEnhance/von

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

3.6.3

2 files

3.6.2

2 files

This release

3.6.1 This release

2 files

3.6.0

2 files

3.5.2

2 files

3.5.1

2 files

3.5.0

2 files

3.4.0

2 files

3.3.2

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page