Code Monkey home page Code Monkey logo

polygon2domjudge's Introduction

Polygon2DOMjudge

Test GitHub release

δΈ­ζ–‡

What is this

It is a simple python script converting polygon package to DOMjudge (kattis) package.

Install

pip install p2d

CLI Example

# Unzip your polygon-package to /path/to/polygon-package first
$ p2d --code A --color '#FF0000' -o /path/to/domjudge-package /path/to/polygon-package

Run this command to make a package from /path/to/polygon-package to /path/to/domjudge-package.zip and set code and color.

All available parameters are:

  • --code: problem short name in DOMjudge.
  • --color: problem color in DOMjudge.
  • --default: force use the default output validator.
  • --validator-flags: add some flags to the output validator, only works when --default is set.
  • --auto: use the default output validator if the checker is defined in config and can be replaced by the default one.
  • --memory-limit: override the memory limit for DOMjudge package (in MB), default is using the memory limit defined in polygon package.
  • --output-limit: override the output limit for DOMjudge package (in MB), default is using the default output limit in DOMjudge setting.
  • --replace-sample: replace the sample input and output with the one shipped with problem statement (e.g. prevent the sample output is different from the main and correct solution).

Config

In config.json, you can change some special checker's validator's flag or add some checker configs manually.

Environment Variable

Don't change them unless you know what you are doing.

  • CONFIG_PATH
  • TESTLIB_PATH
  • EXTENSION_FOR_DESC

API Example

import tempfile

from p2d import Polygon2DOMjudge

package_dir = '/path/to/polygon-package'
output_file = '/path/to/domjudge-package' # without '.zip' suffix

with tempfile.TemporaryDirectory() as temp_dir:
    try:
        Polygon2DOMjudge(package_dir, temp_dir, output_file).process()
    except Exception as e:
        # do something
        pass

Development

# install
poetry install

# build
poetry build

# run unittest
poetry run pytest

# release
./release.sh ${your version}

polygon2domjudge's People

Contributors

cubercsl avatar dup4 avatar dependabot[bot] avatar citrussin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.