Skip to main content

CLI for creating competitive programming problem files

Project description

cp-tool

A command-line interface (CLI) for creating competitive programming problem files.

Installation with pip

To install cp-tool with pip, use the following command:

pip install cptool-py

Installation with nix flakes

To install cp-tool as a nix flake, add the following input to your configuration:

{
  inputs = {
    cp-tool.url = "github:smntic/cp-tool";
  };
}

Then you can install it either through either your NixOS or home-manager configuration.

NixOS

environment.systemPackages = [
  inputs.cp-tool.packages.${pkgs.system}.cptool-py
];

home-manager

home.packages = [
  inputs.cp-tool.packages.${pkgs.system}.cptool-py
];

Configuration

To set up your templates, copy them to ~/.local/share/cp-tool/template.<extension>.
Alternatively, you can define a custom template path with the --template-path argument.

Usage

cpt <commands> [args]

Commands

  • Create a Problem:

    cpt problem <name>
    

    Creates a folder containing a template for the specified problem name.

  • Create a Contest:

    cpt contest <num_problems> <name>
    

    Creates a folder with <num_problems> problem files.

  • Create or Replace a Template:

    cpt template <file>
    

    Creates a new template file or replaces an existing one with the specified name.

If the names contains special characters like '(', you can wrap the entire name in quotes: "Codeforces Round (Div. 2)"

Arguments

  • File Extension:

    --extension=<ext> or -e=<ext>
    

    Use this parameter to specify the file extension for the templates and problem files. The extension defaults to 'cpp'.

  • Template Path:

    --template-path=<path> or -t=<path>
    

    Use this paramter to specify the path to a directory containing all your template files. Otherwise defaults to '~/.local/share/cp-tool'

Automatic Directory Change

To avoid manually changing directories to the newly created folders, you can run the command with:

source cpt <arguments>

Alternatively, you can create an alias in your shell profile to make cpt execute with source automatically:

alias cpt='source cpt'

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

cptool_py-2.0.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

cptool_py-2.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file cptool_py-2.0.0.tar.gz.

File metadata

  • Download URL: cptool_py-2.0.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cptool_py-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a279924f856276f3d74da6a0789a24fb933421f3831d7125fafa1957737dd4df
MD5 1d5ad57de93e08b870f8024f5a7b9eae
BLAKE2b-256 cde16c4303ad569ea06d5227376f6cc71eb36da970e5ad91d7c27f54deab8c7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cptool_py-2.0.0.tar.gz:

Publisher: publish.yml on smntic/cp-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cptool_py-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: cptool_py-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cptool_py-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af2462e27b20da086cb1d0ac8517c716048cb41019441d74d2165e5d948db52e
MD5 d65dec223a667335834ee2aff4066e32
BLAKE2b-256 f7c495982bd68f41d46f740c24aba9c4971fc8d11940d254c353322d9b01c2fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for cptool_py-2.0.0-py3-none-any.whl:

Publisher: publish.yml on smntic/cp-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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