Skip to main content

A command line tool for competitive programming

Project description

CoolKit

contributions welcome Build status Open Source Love HitCount

CoolKit is Coding + ToolKit, A command-line tool used to automate your programming experience.

Installation

Install using pip

  • 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.

Build from Source

  • 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

Verify installation

  • 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

Usage

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

Supported sites

  • codeforces

Examples

init

init an empty repository

srb@srb-pc:$ coolkit init

set

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

config

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

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

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

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

view

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

Demo for a contest

Contest_Example_1

Similar Tools

  • 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.

Note

  • 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 in global_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 in global_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 srbcheema2@gmail.com. Or, even better, submit a PR to fix it!

Contact / Social Media

Github LinkedIn Facebook

Development by

Developer / Author: Srb Cheema

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

coolkit-0.0.3.tar.gz (23.4 kB view details)

Uploaded Source

File details

Details for the file coolkit-0.0.3.tar.gz.

File metadata

  • Download URL: coolkit-0.0.3.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.1 setuptools/20.7.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.12

File hashes

Hashes for coolkit-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9a86a68ca5505657816ef9d35021d9721138c3e2ae2e6f159040139437f04d4a
MD5 1a7e3c6a9ef1902f7a8b446b4b6e35b6
BLAKE2b-256 b80263915e74f6f9ed177f16d698a00355e5cb5b5ed6ac96523c6ba533067733

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