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-folder argument.
Usage
cpt [args] <commands>
Commands
-
Create a Problem:
cpt problem <name>
Creates a folder containing a template for the specified problem name.
-
Create a Contest:
cpt contest <name> <mode>
Available modes:
alpha <num_problems>- create<num_problems>problems indexed by A, B, C, ...numeric <num_problems>- create<num_problems>problems indexed by 1, 2, 3, ...custom <problem_indices>- create a custom list of problem indices, separated by spaces.
-
Create or Replace a Template:
cpt template <problem_names>
Copies your template to create a new file for each problem.
If the names contain spaces or special characters like '(', you can wrap
the entire name in quotes, like "Codeforces Round (Div. 2)".
CP-tool will automatically handle converting your strings into a nice, terminal-friendly
format.
Arguments
-
File Extension:
-ex=, --extension=
Use this parameter to specify the file extension for the templates and problem files. The extension defaults to
.cpp. Other common examples include.cand.py. -
Template Path:
-tf=, --template-folder=
Specify the path to a folder containing all your template files. This defaults to the typical "user data directory" of your operating system. See
cpt -hfor more information.
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-2.0.4.tar.gz.
File metadata
- Download URL: cptool_py-2.0.4.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52aede743a84cd9b9b77b682d114a2cc5877d4c6d8ea48386dc81780f286909a
|
|
| MD5 |
28c77902763d7945c4cf2e3d88194d4c
|
|
| BLAKE2b-256 |
fb11ea5aa1728e2df4ac101f62dff93ce6a23cda50295c252e8fde30e0531642
|
Provenance
The following attestation bundles were made for cptool_py-2.0.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-2.0.4.tar.gz -
Subject digest:
52aede743a84cd9b9b77b682d114a2cc5877d4c6d8ea48386dc81780f286909a - Sigstore transparency entry: 454325894
- Sigstore integration time:
-
Permalink:
smntic/cp-tool@f7ed2979482b7ac179f8a37510d6aa571014ba11 -
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@f7ed2979482b7ac179f8a37510d6aa571014ba11 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cptool_py-2.0.4-py3-none-any.whl.
File metadata
- Download URL: cptool_py-2.0.4-py3-none-any.whl
- Upload date:
- Size: 8.1 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 |
f7b21b4a3f2b7309a35a4b8f703f14fa982f96be563136d02251c5813410b7e1
|
|
| MD5 |
32ad606508360d7cb0cbf82b4ad54888
|
|
| BLAKE2b-256 |
52388f17ab2172076b5a878bdf2dc5684cb7fef99a07cc79d92926a691ac0568
|
Provenance
The following attestation bundles were made for cptool_py-2.0.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-2.0.4-py3-none-any.whl -
Subject digest:
f7b21b4a3f2b7309a35a4b8f703f14fa982f96be563136d02251c5813410b7e1 - Sigstore transparency entry: 454325920
- Sigstore integration time:
-
Permalink:
smntic/cp-tool@f7ed2979482b7ac179f8a37510d6aa571014ba11 -
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@f7ed2979482b7ac179f8a37510d6aa571014ba11 -
Trigger Event:
push
-
Statement type: