Skip to main content

Simple python script converting polygon package to domjudge(kattis) package

Project description

Polygon2DOMjudge

中文

What is this

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

CLI Example

# Unzip your polygon-package to /path/to/polygon-package first
$ ./bin/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 probcode and color.

Config

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

You can use --default to force use the default output validator, and add some flags by command line.

You can use --auto to use the default output validator if the checker is defined in config and can be replaced by the default one.

You can use --memory_limit to override the memory limit for domjudge package, default is using the memory limit defined in polygon package.

You can use --output_limit to override the output limit for domjudge package, default is using the default output limit in domjudge setting.

Environment Variable

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

  • CONFIG_PATH
  • TESTLIB_PATH
  • EXTENTION_FOR_DESC

API Example

import tempfile

from p2d import Polygon2DOMjudge

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

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}

Project details


Download files

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

Source Distribution

p2d-0.0.2.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

p2d-0.0.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file p2d-0.0.2.tar.gz.

File metadata

  • Download URL: p2d-0.0.2.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.11 Darwin/23.1.0

File hashes

Hashes for p2d-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9ab87646bfd0a59dd66be5e1a402ebc816291ddaa4aba5ac504f1db6113b05b8
MD5 d535370b5decc805dae5ceee2e40652d
BLAKE2b-256 d6174be969192735cc36ea09d4df31ed631b24eea7c0d13014d39484546c3d02

See more details on using hashes here.

File details

Details for the file p2d-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: p2d-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.11 Darwin/23.1.0

File hashes

Hashes for p2d-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f245684189370075a45ebe37f262437d6afa1e5c3621987a09cd1f35085133c2
MD5 6acbf08e5f3677c01ad8dad72bd46c32
BLAKE2b-256 8bd1dd65b70720fa2deb39c3ed6c958c4819977d0bf6d67a6b5f2654e70e2278

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page