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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cptool_py-1.1.4.tar.gz.
File metadata
- Download URL: cptool_py-1.1.4.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71c2d1a52ba5e4ee1269588ca6a3e799882448c428319bcc23c23d7167f8714c
|
|
| MD5 |
77476bc4981047180a9d3cf5f0131ec1
|
|
| BLAKE2b-256 |
ac50e876675d6855c4bee088f5d67f3464ab26e4678bb16a02f808d9c0cd5864
|
Provenance
The following attestation bundles were made for cptool_py-1.1.4.tar.gz:
Publisher:
publish.yml on smntic/cp-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cptool_py-1.1.4.tar.gz -
Subject digest:
71c2d1a52ba5e4ee1269588ca6a3e799882448c428319bcc23c23d7167f8714c - Sigstore transparency entry: 209989099
- Sigstore integration time:
-
Permalink:
smntic/cp-tool@1b90397a651bdc031f0c674bd2a7c1cbe78768c2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/smntic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b90397a651bdc031f0c674bd2a7c1cbe78768c2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cptool_py-1.1.4-py3-none-any.whl.
File metadata
- Download URL: cptool_py-1.1.4-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf8ed6d90c963251281c7609f10bda85a237396656d6c0375bc833e88b598e6e
|
|
| MD5 |
02e2e0f6f2ee66dc52bc650bd4cc46d6
|
|
| BLAKE2b-256 |
1c47660342443ad5d1243b7cd4d4988fe120a12c492dd22d428bf787e510fb95
|
Provenance
The following attestation bundles were made for cptool_py-1.1.4-py3-none-any.whl:
Publisher:
publish.yml on smntic/cp-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cptool_py-1.1.4-py3-none-any.whl -
Subject digest:
bf8ed6d90c963251281c7609f10bda85a237396656d6c0375bc833e88b598e6e - Sigstore transparency entry: 209989101
- Sigstore integration time:
-
Permalink:
smntic/cp-tool@1b90397a651bdc031f0c674bd2a7c1cbe78768c2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/smntic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b90397a651bdc031f0c674bd2a7c1cbe78768c2 -
Trigger Event:
push
-
Statement type: