Skip to main content

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpc-0.1.0.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

cpc-0.1.0-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

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