A CLI for competitive programmers
Project description
CPC is a command-line utility aimed towards competitive programmers.
Features
At any point in time, you can run cpc
or cpc -h
to get a list of what the utility has to offer, or cpc <command> -h
for details related to a particular command.
Stress Testing
CPC provides functionality to test an optimized program against bruteforce to compare their outputs with
cpc st -b <bruteforce-executable> -o <optimized-executable> -tg <testcase-generator>
It is advised to supply the arguments via the .cpcrc
file. This would shorten the command to:
cpc st
Scraping Submissions
Users can scrape their submissions from various online judges. Even though support is limited, contribution is welcome to add support to other judges.
Judges currently supported:
- Codeforces (Gym is also supported)
- SPOJ
Interactive scraper can be launched using:
cpc scrape
Configuration
CPC can be configured using a .cpcrc
file. This would sit in the same repository as to where you will be operating from. If it exists in another directory, a path can be specified using:
cpc <sub-command> -cf <path/to/.cpcrc>
This is very useful for the stress testing command. Below is an example configuration:
precommand:
# To compile code into executables
g++ -std=c++17 testcase_generator.cpp -o generator
g++ -std=c++17 main.cpp -o optimized
g++ -std=c++17 bruteforce.cpp -o bruteforce
count: 1000 # Default -> 100
bruteforce: bruteforce # Default -> bruteforce
optimized: optimized # Default -> optimized
testcase_generator: generator # Default -> generator
Installation
Installation via PIP
The installation process is very straight-forward. CPC is available as a PYPI package and can be installed via:
pip install cpc
Manual installation
To install manually, clone from github. It is advised to use python venv:
git clone https://github.com/Purhan/cpc.git
cd cpc
pip install --editable .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cpc-0.1.0.tar.gz
.
File metadata
- Download URL: cpc-0.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e747907ec44f47362f12a9d42b23dd685d7bb3c1f460b34a2437faeb9a15759e |
|
MD5 | 34ec42d5ddb23b2e0b9d45e8a3f163a1 |
|
BLAKE2b-256 | 6dbb0a28a772060c70570fd71c4901f7a122bcb3915ac5ce2163f12dfb4d1715 |
File details
Details for the file cpc-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: cpc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1966d7f511f22776cd3e1b4650b6c5758838980468363db945f25a0731933f60 |
|
MD5 | ac6cbe6e3a0fcb887ed41a506878a87a |
|
BLAKE2b-256 | 90348f7078eb560739d4eb6dcf22d025b9e1e67f0464d12f0133a18e8dda819f |