{"id":20754374,"url":"https://github.com/venhance/von","last_synced_at":"2025-04-07T05:08:33.010Z","repository":{"id":46763103,"uuid":"192207592","full_name":"vEnhance/von","owner":"vEnhance","description":"Olympiad problem database","archived":false,"fork":false,"pushed_at":"2025-03-24T05:13:46.000Z","size":422,"stargazers_count":47,"open_issues_count":4,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T18:09:07.811Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/vondb/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vEnhance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-16T15:33:08.000Z","updated_at":"2025-03-24T05:13:27.000Z","dependencies_parsed_at":"2024-01-20T15:25:48.129Z","dependency_job_id":"ee742804-af72-442a-b5ed-2c652883574c","html_url":"https://github.com/vEnhance/von","commit_stats":{"total_commits":350,"total_committers":9,"mean_commits":"38.888888888888886","dds":"0.042857142857142816","last_synced_commit":"a577366d9c9926c857b504fccc831e240d6145e0"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vEnhance%2Fvon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vEnhance%2Fvon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vEnhance%2Fvon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vEnhance%2Fvon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vEnhance","download_url":"https://codeload.github.com/vEnhance/von/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595334,"owners_count":20963943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T09:17:18.035Z","updated_at":"2025-04-07T05:08:32.980Z","avatar_url":"https://github.com/vEnhance.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VON: vEnhance's Olympiad Navigator\n\n## A problem database written in Python\n\n![Language: Python](https://img.shields.io/github/languages/top/vEnhance/von)\n![License](https://img.shields.io/github/license/vEnhance/von)\n![Last commit](https://img.shields.io/github/last-commit/vEnhance/von)\n[\u003cimg src=\"https://github.com/vEnhance/von/actions/workflows/ci.yml/badge.svg\" alt=\"von status\"\u003e](https://github.com/vEnhance/von/actions)\n[\u003cimg src=\"https://github.com/vEnhance/von/actions/workflows/codeql-analysis.yml/badge.svg\" alt=\"von status\"\u003e](https://github.com/vEnhance/von/actions)\n\n[\u003cimg src=\"https://img.shields.io/badge/python%20style-black-000000.svg\" alt=\"style: black\"\u003e](https://github.com/psf/black)\n[\u003cimg src=\"https://img.shields.io/badge/types-pyright-00cca7.svg\" alt=\"types: pyright\"\u003e](https://github.com/Microsoft/pyright)\n[\u003cimg src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" alt=\"lint: ruff\"\u003e](https://github.com/astral-sh/ruff)\n![Forks](https://img.shields.io/github/forks/vEnhance/von)\n![Stars](https://img.shields.io/github/stars/vEnhance/von)\n\nVON is a Python script I wrote in order to help me manage\nmy centralized database of solutions to olympiad problems.\n\nThere is no graphical user interface; it is based on standard command line.\nTherefore, it will work best on Linux systems.\nWindows users may experience some grief,\nand Windows users unfamiliar with command line are\n[going to have a bad time](https://undertale.fandom.com/wiki/Sans).\n\nI haven't gotten around to properly documenting this,\nbut posting it by popular request.\nHere are a few hints. Pull requests to improve this documentation are welcome.\n\n## Installation\n\n1. Run `pip install vondb` (note the package name on PyPI is `vondb` and not `von`;\n   but the command and module are named `von`).\n   (Here is the [PyPI listing](https://pypi.org/project/vondb/).)\n   Or if you're on Arch Linux, install from [python-vondb in AUR](https://aur.archlinux.org/packages/python-vondb).\n2. When first run, the program will (try to) create a configuration file\n   `~/.config/von/config` or similar if it does not exist.\n   You should then edit that file and choose some values.\n   The program will be unlikely to work correctly\n   until after you have chosen e.g. the `base_path` parameter.\n3. Optional LaTeX integration uses [von.sty][vonsty] and PythonTeX.\n   The optional previewer requires [evan.sty][evansty]. (See below for details.)\n   This assumes a working LaTeX compiler with `latexmk` installed.\n   (I recommend [TeX Live][texlive]).\n4. If fuzzy searching is desired (optional),\n   install [fzf](https://github.com/junegunn/fzf).\n\n## Help\n\nUse `von help` to display full help.\nThe following information is mostly a subset of it.\n\nTo exit VON, type an EOF character (usually Ctrl-D).\n\n## Storing problems and solutions\n\n- `add \"Shortlist 2016 G2\"`: add problem to database\n\n1. Problems are stored in TeX files in `VON_BASE_PATH`. You can\n   keep subdirectories in here, as well, to organize those files.\n2. Problems and solutions are separated using `SEPARATOR` in `rc.py`,\n   which by default is three dashes padded by newlines.\n   So when entering new problems, write the statement, the separator,\n   and then the solution.\n3. Actually more generally, each problem and solution is separated into\n   several \"bodies\", delimited by the separator.\n   It's basically assumed that 0'th body is the problem statement\n   and the 1'st body is the solution,\n   but you can have further bodies for other purposes too.\n\n## Meta-data\n\n- `edit \"Shortlist 2016 G2\"` or `edit \"16SLG2\"`: edit entry for problem in database\n\n1. Meta-data is stored at the top of each file after being added.\n2. Problems must have a _source_ like \"Shortlist 2016 G2\".\n3. Problems should also have a description, and a set of tags.\n   If a tag is specified as a sorting tag in `rc.py`,\n   it will be displayed differently,\n   but otherwise functionally equivalently.\n4. Problems can also have an \"author\" attribute, which is displayed.\n5. Problems can also have a \"hardness\" attribute, an integer,\n   which is displayed differently by the user interface.\n   You can pick any scale you want; [here is mine][mohs].\n6. Problems can be marked as _SECRET_.\n   Problems marked as SECRET will appear in searches,\n   but will be replaced by placeholders (unless `--brave` is passed).\n\n   There are two ways to mark a problem as SECRET:\n\n   - Include `SECRET` as a substring of the problem's source.\n   - Include `secret` as one of the problem's tags.\n\nAn example of an entry:\n\n```\ndesc:  $5^n$ has six consecutive zeros\nauthor: Evan Chen\nsource:  JMO 2016/2\ntags:  [favorite, construct, medium]\nhardness: 25\n\n---\n\nProve that there exists a positive integer $n \u003c 10^6$\nsuch that $5^n$ has six consecutive zeros in its decimal representation.\n\n---\n\nWe will prove that $\\boxed{n = 20 + 2^{19} = 524308}$ fits the bill.\n\n... (rest of solution) ...\n\n```\n\n## Searching\n\nThe `search` command searches everything.\nUse `search --help` for a lot of options.\n\n- `search \"Shortlist 2016\"`: search for problems with \"Shortlist 2016\"\n- `search -t anglechase`: searches for problems tagged `anglechase`\n\nThe `s` command is a shorthand for `search`.\n\nYou can use `search --everything` to list all problems.\n\nAlternatively, the `f` command opens an interface which\nallows you to fuzzily search for a problem across problems with a preview.\nIt is an alias for `show` without arguments.\n\n## Displaying problems\n\nWhen using various commands,\nevery problem can be identified in two ways.\nOne is by the source, such as \"Shortlist 2016 G2\".\nAlternatively, when one uses the search command,\nthe results are indexed by positive integers,\nand those indices can be used instead of the source.\nFor example, `show 3` will display the 3rd problem in search results.\n\n- `show 3`: Print the 3rd problem\n- `po 3`: Produces a TeX/PDF of the problem and solution.\n\nUse `show --help` and `po --help` for more details.\n\n## Recompiling the index\n\nSometimes the list of problems and file paths might become\nmessed up in some way (for example, if you move a file).\nTo fix this run `von nuke` to recompile the entire index.\n`von nuke` is also useful in the cases of deleting a file\nand thus problem from the index.\n\n## Preview\n\nWhen running `von add` or `von edit` on Linux,\nthe program creates the file `/tmp/preview/von_preview.tex`\nwhich is a wrapper file that inputs the currently edited problem.\nIf you use [latexmk][latexmk] (which I recommend!),\nyou can run `latexmk -pvc` on this in order to render what you are typing.\nThis makes it possible to work simultaneously with the input\nand output that you are adding in to `von`.\n\n## LaTeX integration\n\nIf you have [von.sty][vonsty] and [latexmk][latexmk],\nthen by using a similar mechanic to Asymptote,\nyou can also directly query the database for problems.\nYou should add a `pythontex` routine to your `.latexmkrc` for this to auto-work;\nan example might be:\n\n```perl\nsub pythontex {\n    system(\"pythontex --runall true \\\"$_[0]\\\"\");\n    system(\"touch \\$(basename \\\"$_[0]\\\").pytxmcr\");\n    return;\n}\nadd_cus_dep(\"pytxcode\", \"pytxmcr\", 0, \"pythontex\");\n```\n\nThe basic syntax is that `\\voninclude{source}` will\ninclude the problem statement (0th body),\nwhile `\\voninclude[1]{source}` will include the 1st body (the solution), etc.\n\nOf course, this would most commonly be used with theorem environments,\nso you can use some shortcuts to this effect.\nThe three possible shortcuts are:\n\n- `\\von{X}` is shorthand for `\\begin{problem}[X] \\voninclude{X} \\end{problem}`\n- `\\von[text]{X}` is shorthand for `\\begin{problem}[text] \\voninclude{X} \\end{problem}`\n- `\\von*{X}` is shorthand for `\\begin{problem} \\voninclude{X} \\end{problem}`\n\nOf course, the string `problem` might want to be changed,\nif you are using a differently named theorem environment.\nYou can change this by running `\\renewcommand{\\vonenvname}{name}`.\n\n[vonsty]: https://github.com/vEnhance/dotfiles/blob/master/texmf/tex/latex/von/von.sty\n[evansty]: https://github.com/vEnhance/dotfiles/blob/master/texmf/tex/latex/evan/evan.sty\n[latexmk]: http://personal.psu.edu/~jcc8/software/latexmk/\n[mohs]: https://web.evanchen.cc/upload/MOHS-hardness.pdf\n[texlive]: https://www.tug.org/texlive/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenhance%2Fvon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvenhance%2Fvon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenhance%2Fvon/lists"}