Skip to main content

CALICOlib

CALICOlib is a framework to help facilitate problem creation on DOMjudge. Currently, the library helps with test generation and creating problem zip, which is based on the ICPC problem package specification

Installing

python -m pip install calico_lib
# or use uv
uv pip install calico_lib

Alternatively, install the development version using flit.

brew install flit # or another package manager like pip or pipx
git clone https://github.com/calico-team/CALICOlib.git
cd CALICOlib

PIP_BREAK_SYSTEM_PACKAGES=1 flit install --symlink
# or use uv
uv pip install -e .
# to install to another project's venv
uv pip install -e . --python /path/to/other-project/.venv

Quick Start

See examples/add and tests/.

python tests/contest.py

Development

Bump version number in __init__.py and run flit publish or another build tool. See documentation for flit.

Roadmap

  • Support test case from file
  • Upload problem to testing contest
  • Create contest
  • Create contest.zip
  • Tests
  • Docs
  • Remove legacy
  • Default validation (trailing white space / empty lines... etc)
  • Remove calico specific stuff from the library

Similar tools

https://github.com/RagnarGrootKoerkamp/BAPCtools

Changelog

0.2.0

  • write_test_in returns a str instead of writing via p.print_test (removed). Tests become pure functions, which makes generation parallel-safe.
  • Problem(..., solution=..., seed=...) declares your reference solution and seed. The library calls random.seed before each test, so generation is reproducible without you remembering to seed.
  • Answer generation defaults to running solution; you no longer need to override write_test_out for the common case.
  • create_all_tests(n_jobs=...) (or -j/--jobs on the CLI) runs answer generation in parallel (threads; each solution runs as a subprocess).
  • Some random additional API for forward compatibility.
  • MulticaseTestFile / TestCaseBase are experimental; their contract is not settled for 1.0.
  • create_all_tests(shard=(i, n)) is experimental; the driver contract (coordinating clean_test_data() / pre_gen_fn) is not settled.

Metadata

Release files for calico_lib 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for calico_lib 0.2.1
File Size Uploaded Provenance Actions
calico_lib-0.2.1.tar.gz 14.4 kB Without provenance Details for calico_lib-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for calico_lib 0.2.1
File Interpreter ABI Platform Actions
calico_lib-0.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for calico_lib-0.2.1-py2.py3-none-any.whl

Total release size: 30.2 kB

Release files / calico_lib-0.2.1.tar.gz

Download URL calico_lib-0.2.1.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dd8e790a02473b768cdf7e06b9c6ed44cc6406e1efe21577dedbb7b06eb8ce78
BLAKE2b-256 checksum
How to use checksums
351ac4f28aa477371d576cf164fb1ffe62af18743848d9bb6172a9f9feee3a57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Release files / calico_lib-0.2.1-py2.py3-none-any.whl

Download URL calico_lib-0.2.1-py2.py3-none-any.whl
Size 15.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4bf2a8da57cf0fe656200db651ada7146bf06bb6ad35a7e67a7358c7158bb5a1
BLAKE2b-256 checksum
How to use checksums
c4d43dea523ce1ca8b35a2e3c0c15061a82080ca38c92730d691d566797ebf85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Security for calico_lib 0.2.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page