Skip to main content

Competetive Programming Management Tool

Project description

Contest Builder

Python License

Contest Builder is a Python tool designed to simplify the process of managing programming contest solutions by providing a structured workflow for organizing, compiling, and testing code.

Features

  • Quickly generate the folder and file structure for a contest's problems.
  • Customize templates for generating solution files.
  • Compile and run solutions with ease.
  • Test solutions for correctness.

Table of Contents

Installation

You can install Contest Builder via pip:

pip install contest-builder

Usage

  1. Initializing The Workspace

    In order to specify the template files and default options for the future, you need to initialize a folder inorder to store the files of the contest over there.

contest-builder --init
  • this will generate:
    1. A config file named cb-config.josn, and
    2. A template folder to put your own language specific templates there.
  1. Generating Contest Structure

To generate the folder and file structure for a contest, use the contest-builder command with the --name option:

contest-builder --name <contest_name>

This will create the necessary directories and files for each problem in the contest, using the provided templates. You can specify the details of the contest by passing other options as well. The list of all options are as follow:

  • --provider <site_provider> You need to specify the website that provides the contest in the config file first. There are some default values as well like codeforces and leetcode.
  • --problem_cnt <problem_count> Specify the number of problems.
  • --language <programming_language> Specify the language you are using at this contest if it differs from the default value.
  • --name_type <folders_name_type> It can be alphabetical, numerical, or roman.

For example you want to create a codeforces contest with 8 problems, using python language. in order to do this, you can simply write:

contest-builder --name "Codeforces Round 938 (Div. 3)" --problem_cnt 8 --language py --provider cf

You can set your desired abbreviations for languages and contest providers in the cb-config.

  1. Compiling and Running Solutions

To compile and run a solution for a specific problem, use the contest-builder command with the --run option:

contest-builder --run <problem_name>

This will detect the language you've chosen to write the code, and then compiles and executes the solution based on the way it's provided in the cb-config. If you are located in the problem's folder, you can discard the <problem_name> and just pass the --run option.

Example:

contest-builder --run a
  1. Creating Structure for Single Problem

    You can also create the folder and file structure for a single problem using the contest-builder command with the --problem option:

contest-builder --problem --name <problem_name>

This will generate the necessary files and directories for the specified problem.

Example:

contest-builder --problem --name "Random Problem" --language seepp --provider lc

it will generate leetcode/problemset/random-problem/random-problem.cpp and it's corresponding input as well.

Configuration

Contest Builder allows you to customize templates for generating solution files. You can modify these templates according to your preferences by editing the template files located in the templates directory.

Also you need to edit the compile and run sections in the config file as you want to be done.

Contributing

Contributions are welcome! If you have any ideas for improvements or new features, feel free to open an issue or submit a pull request.

License

Contest Builder is licensed under the MIT License. See the LICENSE file for details.

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

contest-builder-0.0.4.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contest_builder-0.0.4-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file contest-builder-0.0.4.tar.gz.

File metadata

  • Download URL: contest-builder-0.0.4.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for contest-builder-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b813e0e396ab449dac5ac1a9781bff335c04232ae0aa1f58813a9dd5962a4065
MD5 bbceea7b7bd45a4e09ba1540a50d3c94
BLAKE2b-256 9f4540d90e5745162d4735c93e0b836135e24be649609be602520391b5043365

See more details on using hashes here.

File details

Details for the file contest_builder-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for contest_builder-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1c0828aa5592d4afa757266af3bfaf3671cc73024e78fb1d9995314265d2257a
MD5 f26fc6cc1d96804503c3877fbae1e907
BLAKE2b-256 9b6c349664992995e70f50ab3a2333d3803aa5c7d9f50610ccb92e32a79e7dce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page