A tool to quickly create codeforces contest directories with templates.

Overview

Codeforces Template Tool

I created this tool to help me quickly set up codeforces contests/singular problems with templates.

Tested for windows, should work on linux or any other operating system.

Installation

Clone the repository with git.

git clone [email protected]:com/AnotherTwinkle/cftool.git

Now, navigate to the cftool directory with and install it with pip-

cd cftool
pip install .

Note that Python 3.8 was used to test this script. This should run on 3.4+.

Usage

After installation, the tool should be available anywhere on your CLI. The script has 4 commands you can use.

Creating Singular Files

To create a singular file, use this command-

cftool problem [filename] [?template]

where template is optional. Note that the file name must end with an appropriate language file extension.

For example-

cftool problem 843A.py fastio

The script infers the language from the filename and searches for the template file in the directory templates/{lang}/ directory. Then, it creates a file called [filename]in the current working directory and pastes the template code for you to use.

If the template language directory or the template file doesn't exist, [filename] will be empty on creation.

If you don't provide the template argument, the script will use the default template in the language directory.

Creating a directory for a singular problem

If you'd like to be organized and have invidiual directories for each solution you write, you can use the problemdir command.

cftool problemdir [name] [language] [?template] [?--notes]

Note how you need to explicitly state the language. More precisely, you are telling the script to look for the [language] directory in templates/.

cftool problemdir 433A cpp fastio --notes

This will create a directory called 433A and intialize a file called sol.cpp with the fastio template for C++ in there.

template is still optional. The --notes flag, if provided, will create a file called notes.txt in the directory.

Creating a contest directory

This is peharps the only reason I wrote this script.

cftool contest [name] [language] [problemcount] [?template] [?--notes]

This commands creates a codeforces contest directory. The command syntax is almost simillar to problemdir with the added problemcount argument.

cftool contest 768DivA cpp 6 fastio --notes

This creates a directory called 768DivA and, following codeforces naming scheme, puts 6 files named A, B, C, D, E, F (from A to the problemcount-th letter of the alphabet) respectively. problemcount cannot exceed 26.

The directory name can have multiple words, in that case you put quotes around the name.

cftool contest "696 Div B" py 5 default --notes

This command also supports exclusion of the template argument and --notes flag.

Creating a contest directory with problem directories

This command has the same syntax as contest, but instead of creating files, it creates a directory for each problem, each having a file called sol.

cftool contestwpdir "593 Div 3" cpp 8 fastio --notes

Note: The command name is shorthand for contest with problem directory, this should help you remember the name.

Adding your own templates

If you have a better, or a personal template you'd like to use, you can do so.

First, create a new directory in the templates/ directory of the script. The name of this directory must be the file extension your language uses. i.e py, cpp, js etc. There already are some premade directories.

Next, create a file called default in the directory with your language extension (i.e default.cpp or default.py). This is template used by the script when the template argument is not provided. You can leave this file empty if you want.

Now to add a template, create a file with the desired name (The language extension must be included with filename)

Once you are done, you need to reinstall the script. Navigate to the directory with the setup.py file and run-

pip install .

If all went well you should be able to access the template now, i.e-

cftool problem test.java myshinyjavatemplate

Executable?

I plan making a the script a binary executable in the future, so you don't need python installed to run it.

Contributing

It'd be greatly appreciated if you PR useful templates to the project. If you use the script, consider starring it so more people can find it.

Owner
I like programming, exploring and you.
Retrying library for Python

Tenacity Tenacity is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just

Julien Danjou 4.3k Jan 02, 2023
Unified Distributed Execution

Unified Distributed Execution The framework supports multiple execution backends: Ray, Dask, MPI and MultiProcessing. To run tests you need to install

17 Dec 25, 2022
Code needed for hybrid land cover change analysis for NASA IDS project

Documentation for the NASA IDS change analysis Poley 10/21/2021 Required python packages: whitebox numpy rasterio rasterio.mask os glob math itertools

Andrew Poley 2 Nov 12, 2021
Usos Semester average helper

Usos Semester average helper Dzieki temu skryptowi mozesz sprawdzic srednia ocen na kazdy odbyty przez ciebie semestr PARAMETERS required: '--username

2 Jan 17, 2022
Neptune client library - integrate your Python scripts with Neptune

Lightweight experiment tracking tool for AI/ML individuals and teams. Fits any workflow. Neptune is a lightweight experiment logging/tracking tool tha

neptune.ai 353 Jan 04, 2023
WinBoost: Boost your windows system.

Winboost runs a complete checkup of your entire system locating junk files, speed-reducing issues and causes of any system or application glitches or crashes. Through a lot of research and testing, w

Smit Parmar 4 Oct 01, 2021
A script for creating battle animations in FEGBA format.

AA2 Made by Huichelaar. I heavily referenced FEBuilderGBA. I also referenced circleseverywhere's Animation Assembler. This is also where I took lzss.p

2 May 31, 2022
Model Quantization Benchmark

MQBench Update V0.0.2 Fix academic prepare setting. More deployable prepare process. Fix setup.py. Fix deploy on SNPE. Fix convert_deploy bug. Add Qua

500 Jan 06, 2023
Choice Coin 633 Dec 23, 2022
Cross-Encoder-with-Bi-Encoder를 활용한 WebPage 데모

Retrieval_Streamlit_Demo Cross-Encoder-with-Bi-Encoder를 활용한

5 Dec 29, 2021
Malicious Document IoC Extractor is a collection of scripts that helps extracting IoCs from various maldoc families.

MDIExtractor Malicious Document IoC Extractor (MDIExtractor) is a collection of scripts that helps extracting IoCs from various maldoc families. Prere

Malwrologist 14 Nov 25, 2022
Make your Discord Account Online 24/7!

Online-Forever Make your Discord Account Online 24/7! A Code written in Python that helps you to keep your account 24/7. The main.py is the main file.

SealedSaucer 0 Mar 16, 2022
[x]it! support for working with todo and check list files in Sublime Text

[x]it! for Sublime Text This Sublime Package provides syntax-highlighting, shortcuts, and auto-completions for [x]it! files. Features Syntax highlight

Jan Heuermann 18 Sep 19, 2022
《赛马娘》(ウマ娘: Pretty Derby)辅助 🐎🖥 基于 auto-derby 可视化操作/设置 启动器 一键包

ok-derby 《赛马娘》(ウマ娘: Pretty Derby)辅助 🐎 🖥 基于 auto-derby 可视化操作/设置 启动器 一键包 便捷,好用的 auto_derby 管理器! 功能 支持客户端 DMM (前台) 实验性 安卓 ADB 连接(后台)开发基于 1080x1920 分辨率

秋葉あんず 90 Jan 01, 2023
Org agenda in the console

This Python script reads an org agenda file (i.e. a regular org file with some active dates) and displays an interactive and colored year calendar with detailed information for each day when the mous

Nicolas P. Rougier 113 Jan 03, 2023
Submission to the HEAR2021 Challenge

Submission to the HEAR 2021 Challenge For model evaluation, python=3.8 and cuda10.2 with cudnn7.6.5 have been tested. The work uses a mixed supervised

Heinrich Dinkel 10 Dec 08, 2022
With the initiation of the COVID vaccination drive across India for all individuals above the age of 18, I wrote a python script which alerts the user regarding open slots in the vicinity!

cowin_notifier With the initiation of the COVID vaccination drive across India for all individuals above the age of 18, I wrote a python script which

13 Aug 01, 2021
《practical python programming》的中文翻译

欢迎光临 大约 25 年前,当我第一次学习 Python 时,发现 Python 竟然可以被高效地应用到各种混乱的工作项目上,我立即被震惊了。15 年前,我自己也将这种乐趣教授给别人。教学的结果就是本课程——一门实用的学习 Python的课程。

编程人 125 Dec 17, 2022
A basic interpreted programming language written in python

shin A basic interpreted programming language written in python. extension You can use our own extension ".shin". Example: main.shin How to start Clon

12 Nov 04, 2022
A webdav demo using a virtual filesystem that serves a random status of whether a cat in a box is dead or alive.

A webdav demo using a virtual filesystem that serves a random status of whether a cat in a box is dead or alive.

Marshall Conover 2 Jan 12, 2022