Package: kattis-cli
Kattis-CLIKattis CLI - download, test and submit Kattis problems using CLI.
Based on Official Kattis CLI:https://github.com/Kattis/kattis-cliRequirementsPython 3.8+ (PyPy preferred as Kattis uses PyPy to run your code)Kattis accountWindowsUse Command Line or PowerShellMake sure python is in your PATHInstall Python from Windows Storeif you get codec error while running kattis-cli, run the following command in Command Prompt:python--version
chcp65001InstallationIf you've Python version 3.8 or higher, you can skip creating virtual environment. If you wish to create a virtual environment, see intructions below.Create and activate virtual environment using venvfollow the instruction provided in the link to create and activate virtual environment:https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/Create and activate virtual environment using condafollow the instruction provided in the link to create and activate virtual environment:https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environmentInstall Kattis-cliactivate virtual environment if you've created one for kattis-clirun the following command in Command Prompt or PowerShellpipinstallkattis-cli
python-mpipinstallkattis-clion Windows add the path shown in the output of the above command to your PATH environment variableUpdate Kattis-CLIremove or rename.kattis-cli.tomlfile in your home directoryactivate virtual environment if you've created one for kattis-clipipinstallkattis-cli--upgrade
python-mpipinstallkattis-cli--upgradeKattis configurationrun the following command and enter your Kattis credentialsthis will create a .kattisrc file in your home directorykattissetupUsagekattis<command>[options]kattis--helpCommandsDownload a problem sample files and it's metadataproblem id can be found in the last part of the URL of the problemexample:https://open.kattis.com/problems/cold=> problem id:coldkattisget<problem_id>Display problem metadatacd<problem_id>
kattisinfoTest a solution locallycurrently the following languages have been tested: Python 3, C++, NodeJS, C, Javamake sure CLI compilers are in your PATHmake sure python3 files have first line shebang: !/usr/bin/env python3or have extensions .py3update the.kattis-cli.tomlfile in your home directory to add more languagesseekattis_cli/.kattis-cli.tomlfile for example.cd<problem_id>
kattistestSubmit a problemmake sure you've configured kattis-clikattissetupsee live results right on the terminalcd<problem_id>
kattissubmitContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. Adding support for more languages is highly appreciated.Using this Repoclone this repocreate virtual environment with pypy 3.8 or higherusing conda the following command creates kattis virtual environment with pypy3.8Using conda and virtual environmentcondacreate-cconda-forge-nkattispypypython=3.8
condaactivatekattisinstall dependenciespipinstall-rrequirements.txtrun the following command to install kattis-cli from this repo on Mac/Linuxmake
./build.sh
pipinstalldist/kattis_cli-x.x.x-py3-none-any.whl--force-reinstallUsing Dockerclone this reporun the following command to build and run the Dockerfile provided in this repoif using Windows, run the following command in git-bash Terminalbashrun.sh