A command-line tool to generate Online-Judge problem.
- Render problem descriptions in Markdown to HTML
- Check problem descriptions and data, including missing fields, UTF-8 encoding, end-of-line CRLF/LF
- Packing problem data in freeproblemset(hustoj) format
- Mechanism for generating input and output test data
- Easy to define adapters for other online-judge platform
Have fun! If you have any suggestions or find any bugs, please tell me.
Install
pip install generator-oj-problem
# or use pipx for a standalone python environment
pip install pipx
pipx ensurepath
pipx install generator-oj-problem
gop --help
Usage
# Initialize your problem
gop init
# Modify the files to write problem
ls .
# Generate 2 sample data from id 1
gop gen -s 1 -c 2 --sample
# Generate 5 test data from id 2
gop gen -s 2 -c 5
# Trim sample and test data
gop trim
# Check validaty
gop check
# Pack your problem in FreeProblemSet format
gop -a fps pack
If you meet some encoding errors, ensure your Python interpreter runs in UTF-8 mode, e.g. adding PYTHONUTF8=1 to your environment variables.
Directory Structure
Here is a demo problem A + B Problem. Details about
problem.ymlandgenerator.pyare given at the comments of the demo files.The file with extension
.mdmeans it supports plain CommonMark by built-in render. Attention: No LaTeX and embeded image supports.
problem.ymlProblem metadata and configurationdescription.mdDescriptioninput.mdDescription of inputoutput.mdDescription of outputhint.mdHintsolution.txtSolution source codegenerator.pyGenerator for input or output data.samples/Sample datasamples/0.inInput of samplesamples/0.outOutput of sample
tests/Test data (same form tosamples/)
Metadata
Release files for generator-oj-problem 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| generator-oj-problem-0.0.2.tar.gz | 11.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| generator_oj_problem-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.8 kB
Release files / generator-oj-problem-0.0.2.tar.gz
| Download URL | generator-oj-problem-0.0.2.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5aba25d30108a77a5015e8c4f8c42b1b8c2940b2766fd906c3a7d1a6409422e
|
|
BLAKE2b-256 checksum How to use checksums |
6e2890cd810ec84deaf36ea9fe04a7634b426850a5c5eee39f5d34256cfc1347
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|
Release files / generator_oj_problem-0.0.2-py3-none-any.whl
| Download URL | generator_oj_problem-0.0.2-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ea76b066fecd9657b9ce8352db2cc63f76bc1b563cb2eba9551918adebca3c2
|
|
BLAKE2b-256 checksum How to use checksums |
331e70ddbe44b41a1c493c78e215a20b5153a70c89d039377542f7e153a6ddab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|
Security for generator-oj-problem 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.