{"id":22942424,"url":"https://github.com/stardustdl/generator-oj-problem","last_synced_at":"2025-08-12T21:32:41.774Z","repository":{"id":59471057,"uuid":"173058569","full_name":"StardustDL/generator-oj-problem","owner":"StardustDL","description":"A command-line tool to generate Online-Judge problem.","archived":false,"fork":false,"pushed_at":"2023-04-14T06:01:38.000Z","size":101,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-29T21:18:16.193Z","etag":null,"topics":["algorithm-competitions","generator","hustoj","online-judge","python"],"latest_commit_sha":null,"homepage":"","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/StardustDL.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}},"created_at":"2019-02-28T06:56:10.000Z","updated_at":"2024-02-23T10:48:31.000Z","dependencies_parsed_at":"2023-01-23T06:01:26.422Z","dependency_job_id":null,"html_url":"https://github.com/StardustDL/generator-oj-problem","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StardustDL%2Fgenerator-oj-problem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StardustDL%2Fgenerator-oj-problem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StardustDL%2Fgenerator-oj-problem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StardustDL%2Fgenerator-oj-problem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StardustDL","download_url":"https://codeload.github.com/StardustDL/generator-oj-problem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229710744,"owners_count":18111641,"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":["algorithm-competitions","generator","hustoj","online-judge","python"],"created_at":"2024-12-14T13:47:48.332Z","updated_at":"2024-12-14T13:47:48.915Z","avatar_url":"https://github.com/StardustDL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![Generator-OJ-Problem](https://socialify.git.ci/StardustDL/generator-oj-problem/image?description=1\u0026font=Bitter\u0026forks=1\u0026issues=1\u0026language=1\u0026owner=1\u0026pulls=1\u0026stargazers=1\u0026theme=Light)\n\n[![](https://github.com/StardustDL/generator-oj-problem/workflows/CI/badge.svg)](https://github.com/StardustDL/generator-oj-problem/actions) [![](https://img.shields.io/github/license/StardustDL/generator-oj-problem.svg)](https://github.com/StardustDL/generator-oj-problem/blob/master/LICENSE) [![](https://img.shields.io/pypi/v/generator-oj-problem)](https://pypi.org/project/generator-oj-problem/) [![Downloads](https://pepy.tech/badge/generator-oj-problem?style=flat)](https://pepy.tech/project/generator-oj-problem) ![](https://img.shields.io/pypi/implementation/generator-oj-problem.svg?logo=pypi) ![](https://img.shields.io/pypi/pyversions/generator-oj-problem.svg?logo=pypi) ![](https://img.shields.io/pypi/wheel/generator-oj-problem.svg?logo=pypi) ![](https://img.shields.io/badge/Linux-yes-success?logo=linux) ![](https://img.shields.io/badge/Windows-yes-success?logo=windows) ![](https://img.shields.io/badge/MacOS-yes-success?logo=apple) ![](https://img.shields.io/badge/BSD-yes-success?logo=freebsd)\n\nA command-line tool to generate Online-Judge problem.\n\n- Render problem descriptions in Markdown to HTML\n- Check problem descriptions and data, including missing fields, UTF-8 encoding, end-of-line CRLF/LF\n- Packing problem data in freeproblemset(hustoj) format\n- Mechanism for generating input and output test data\n- Easy to define adapters for other online-judge platform\n\nHave fun! If you have any suggestions or find any bugs, please tell me.\n\n## Install\n\n```sh\npip install generator-oj-problem\n\n# or use pipx for a standalone python environment\npip install pipx\npipx ensurepath\npipx install generator-oj-problem\n\ngop --help\n```\n\n## Usage\n\n```sh\n# Initialize your problem\ngop init\n\n# Modify the files to write problem\nls .\n\n# Generate 2 sample data from id 1\ngop gen -s 1 -c 2 --sample\n# Generate 5 test data from id 2\ngop gen -s 2 -c 5\n\n# Trim sample and test data\ngop trim\n\n# Check validaty\ngop check\n\n# Pack your problem in FreeProblemSet format\ngop -a fps pack\n```\n\n\u003e If you meet some encoding errors, ensure your Python interpreter runs in UTF-8 mode, e.g. adding **PYTHONUTF8=1** to your environment variables.\n\n## Directory Structure\n\n\u003e Here is a demo problem [A + B Problem](https://github.com/StardustDL/generator-oj-problem/tree/master/demo). Details about [`problem.yml`](https://github.com/StardustDL/generator-oj-problem/tree/master/demo/problem.yml) and [`generator.py`](https://github.com/StardustDL/generator-oj-problem/tree/master/demo/generator.py) are given at the comments of the demo files.\n\u003e \n\u003e The file with extension `.md` means it supports plain [CommonMark](https://commonmark.org/) by built-in render. **Attention**: No LaTeX and embeded image supports.\n\n- `problem.yml` Problem metadata and configuration\n- `description.md` Description\n- `input.md` Description of input\n- `output.md` Description of output\n- `hint.md` Hint\n- `solution.txt` Solution source code\n- `generator.py` Generator for input or output data.\n- `samples/` Sample data\n   - `samples/0.in` Input of sample\n   - `samples/0.out` Output of sample\n- `tests/` Test data (same form to `samples/`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstardustdl%2Fgenerator-oj-problem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstardustdl%2Fgenerator-oj-problem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstardustdl%2Fgenerator-oj-problem/lists"}