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.
Python bindings for `ign-msgs` and `ign-transport`

Python Ignition This project aims to provide Python bindings for ignition-msgs and ignition-transport. It is a work in progress... C++ and Python libr

Rhys Mainwaring 3 Nov 08, 2022
An extension module to make reaction based menus with disnake

disnake-ext-menus An experimental extension menu that makes working with reaction menus a bit easier. Installing python -m pip install -U disnake-ext-

1 Nov 25, 2021
Curses frontend for Canto daemon

Canto Curses The curses (text) client for canto-daemon. Canto-daemon is required to work and is found at: http://github.com/themoken/canto-next Requir

Jack Miller 86 Dec 28, 2022
Djangoblog - A blogging site where people can make their accout and write blogs and read other author's blogs

This a blogging site where people can make their accout and write blogs and read other author's blogs.

1 Jan 26, 2022
An Notifier Program that Notifies you to relax your eyes Every 15 Minutesđź‘€

Every 15 Minutes ⌛ Every 15 Minutes is an application that is used to Notify you to Relax your eyes Every 15 Minutes, This is fully made with Python a

FSP Gang s' YT 2 Oct 18, 2021
Prints values and types during compilation!

Compile-Time Printer Compile-Time Printer prints values and types at compile-time in C++. Teaser test.cpp compile-time-printer

43 Dec 26, 2022
A fluid medium for storing, relating, and surfacing thoughts.

Conceptarium A fluid medium for storing, relating, and surfacing thoughts. Read more... Instructions The conceptarium takes up about 1GB RAM when runn

115 Dec 19, 2022
Make dbt docs and Apache Superset talk to one another

dbt-superset-lineage Make dbt docs and Apache Superset talk to one another Why do I need something like this? Odds are rather high that you use dbt to

Slido 81 Jan 06, 2023
A bot to view Dilbert comics directly from Discord and get updates of the comics automatically.

A bot to view Dilbert comics directly from Discord and get updates of the comics automatically

Raghav Sharma 3 Nov 30, 2022
Craxk is a SINGLE AND NON-REPLICABLE Hash that uses data from the hardware where it is executed to form a hash that can only be reproduced by a single machine.

What is Craxk ? Craxk is a UNIQUE AND NON-REPLICABLE Hash that uses data from the hardware where it is executed to form a hash that can only be reprod

5 Jun 19, 2021
Python communism - A module for initiating the communist revolution in each of our python modules

Python communist revolution A man once said to abolish the classes or something

758 Jan 03, 2023
An Insurance firm providing tour insurance is facing higher claim frequency

An Insurance firm providing tour insurance is facing higher claim frequency. Data is collected from the past few years. Made a model which predicts the claim status using CART, RF & ANN and compare t

1 Jan 27, 2022
Project 2 for Microsoft Azure on WUT

azure-proj2 Project 2 for Microsoft Azure on WUT Table of contents Team Tematyka projektu Architektura Opis rozwiązania Demo dzałania The Team Krzyszt

1 Dec 07, 2021
Project issue to website data transformation toolkit

braintransform Project issue to website data transformation toolkit. Introduction The purpose of these scripts is to be able to dynamically generate t

Brainhack 1 Nov 19, 2021
Web app to find your chance of winning at Texas Hold 'Em

poker_mc Web app to find your chance of winning at Texas Hold 'Em A working version of this project is deployed at poker-mc.ue.r.appspot.com. It's run

Aadith Vittala 7 Sep 15, 2021
Generate a wordlist to fuzz amounts or any other numerical values.

Generate a wordlist to fuzz amounts or any other numerical values. Based on Common Security Issues in Financially-Oriented Web Applications.

Ivan Ĺ incek 3 Oct 14, 2022
A python script that will automate the boring task of login to the captive portal again and again

A python script that will automate the boring task of login to the captive portal again and again

Rakib Hasan 2 Feb 09, 2022
Your copilot to studies and work (Pomodoro-timer, Translate and Notes app)

Copylot Your copilot to studies and work (Pomodoro-timer, Translate and Notes app) Copylot are three applications in one: Pomodoro Translate Notes Cop

Eduardo Mendes 20 Dec 16, 2022
This is the course project of AI3602: Data Mining of SJTU

This is the course project of AI3602: Data Mining of SJTU. Group Members include Jinghao Feng, Mingyang Jiang and Wenzhong Zheng.

2 Jan 13, 2022
JD-backup is an advanced Python script, that will extract all links from a jDownloader 2 file list and export them to a text file.

JD-backup is an advanced Python script, that will extract all links from a jDownloader 2 file list and export them to a text file.

Kraken.snv 3 Jun 07, 2022