CoolKit is Coding + ToolKit
, A command-line tool used to automate your programming experience.
- Use pip to install, user
--user
flag
sudo python3 -m pip install medipack
- test for coolkit installation
coolkit --help
- if it displays help message you are ready to go.
- Clone the repository and checkout to stable commit
git clone https://github.com/srbcheema1/CoolKit
cd CoolKit
git checkout v0.0.3
- install requirements
python3 -m pip install --user -r requirements.txt
- Install CoolKit
python3 setup.py install --user
- check for working
coolkit --help
-
if it displays help message you are ready to go.
-
In case not working, ensure that binary path is in PATH. Add line
export PATH=$PATH="~/.local/bin"
in your.bashrc
echo export PATH="$PATH":"~/.local/bin" >> ~/.bashrc
source ~/.bashrc
srb@srb-pc:$ coolkit --help
usage: coolkit [-h] {init,set,run,submit,fetch,config} ...
positional arguments:
{init,set,run,submit,fetch,config,view}
optional arguments:
-h, --help show this help message and exit
suboptions are:
init initilize a directory as coolkit directory
set set value of coolkit variables.
config set config values like username, password.
fetch fetch a contest to use it for offline testing.
run run a code file against provided testcases
submit submit a code to online judge. and output the verdict.
view view a user, contest, problem or upcomming contest
For more help regarding suboptions run:
coolkit init -h
coolkit set -h
coolkit config -h
coolkit fetch -h
coolkit run -h
coolkit submit -h
coolkit view -h
- codeforces
init an empty repository
srb@srb-pc:$ coolkit init
set value of coolkit-variables for contest, prob, site, contest-type
srb@srb-pc:$ coolkit set -c 535
srb@srb-pc:$ coolkit set -p A
srb@srb-pc:$ coolkit set -t gym
set value of global configuration variables like username, password
srb@srb-pc:$ coolkit config --user srbcheema1
srb@srb-pc:$ coolkit config --pswd I_wont_write_it_here_xD
fetch a contest, if you are standing in a coolkit folder then by default it will fetch a contest configured in that folder unless you provide using -c
option. outside a coolkit repo it is necessary to provide contest name using -c
srb@srb-pc:$ coolkit fetch
srb@srb-pc:$ coolkit fetch -c 1025
run a problem against sample test cases. you can provide problem name using -p
option, if you dont provide a problem name it will try to automatically detect the problem name using rules specified in ~/.config/coolkit/global_config.py
. you can modify this file as you want.
if it is unable to detect file name then it will try to remember last problem you ran and run the test cases against it.
srb@srb-pc:$ coolkit run one.cpp
Prob name not provided, trying to detect from filename
running one.cpp file for A prob on 837
srb@srb-pc:$ coolkit run soln.cpp
Prob name not provided, trying to detect from filename
Unable to detect prob name from file name
Submit a file on online judge and show you report through desktop notification. it wont submit a file if it fails on local sample test cases. Still if you want to submit a file use -f
flag
srb@srb-pc:$ coolkit submit one.cpp
srb@srb-pc:$ coolkit submit one.cpp -p A
srb@srb-pc:$ coolkit submit one.cpp -p A -f
srb@srb-pc:$ coolkit view user srbcheema1
srb@srb-pc:$ coolkit view prob A
srb@srb-pc:$ coolkit view contest 535
srb@srb-pc:$ coolkit view upcomming
- It is worth it to mention few other tools that I was using from a year or so. I have really loved those tools and also used some of their modules/functions in this tool. Those tools are Acedit and Idne.
- Coolkit is smart enough to detect a directory is coolkit repo or not. it automatically initilizes a directory as a coolkit directory in case it is not. Still I have provided
init
option. Its main purpose is to initilize a coolkit directory inside another coolkit directory. by default it will copy parent configurations for once which you can change lateron. - Coolkit is smart enough to detect your program name from your filename. Have a look at
get_problem_name
inglobal_config.py
file. you can suggest imporvements in that function. - Coolkit is smart enough to detect your contest name from your directory name. Have a look at
get_contest_name
inglobal_config.py
file. you can suggest imporvements in that function. - To suggest me improvements you can open an issue, make an PR, mail me or contact me on links provided below. I am working to provide a flexible way for users to modify their own way of detection.
- In case of any bug/issue, Please report this to [email protected]. Or, even better, submit a PR to fix it!
Developer / Author: Srb Cheema