ecfr: Eliot's CodeForces Runner
This command line utility is meant to make it easy to download and run programs for use in CodeForces contests. It will automatically download contest problems, including sample test cases, and will compile and run code against these test cases. A fork of CodeforcesRunner.
Also includes starter files. Meant to be a "batteries included" way of doing Codeforces contests.
Installation
The package is available on PyPI. It can be installed with the following command:
pip install ecfr
Commands
This command line utility has four commands:
dc Download contest or individual problems
init Copy example files into the current working directory.
r Run code against contest problems.
sp Create an empty solution file from a starter file in the source files folder.
Each one has different arguments that can be viewed by looking at the help messages.
Usage
We will use Codeforces Contest 198
as a running example. This will demonstrate the workflow of using ecfr as a
command line utility.
Initialization
The first thing we must do is create an environment config file and provide
starter files for languages we would like to use. Fortunately, ecfr includes
a sample config and starter files with reasonable defaults. To use them, we must
simply navigate to the directory we would like to do the contest in and run
$ ecfr init
Download Sample Tests
Now that we have starter files and a basic config, we need to download the contest. We can download contest 198 using the following command.
$ ecfr dc 198
To download just problem A, we can add the -p A arguments. This creates a
.xml for each problem downloaded, including the sample test cases.
You may add additional test cases by following the format of the .xml files.
By default, these are put into the contest_files directory.
Starting a Problem
Now that we have our problem files downloaded, we can start coding. To do this, we need to copy a starter file for our desired language and give it a descriptive name, according to the problem we will be solving. Let's say we wish to do problem A in the contest we downloaded in Python. We can create our file with the following command:
$ ecfr sp A py
This will create a file called A.py in the source_files directory (the location can
be set in the config). Here, py is the file extension ecfr will look for when making
a copy of the starter file. The directory for starter files can be set in the config file.
Running the Tests
Once we have our starter file and finish coding, we want to run the tests that we downloaded. To do this, we simply run the following command:
$ ecfr r A
With this command, ecfr will look in the source_files directory for files matching problem
A. When a file is found, it will automatically compile and run it against all test cases in
the A.xml file.
Submitting
Once all test cases pass, we wish to submit our source file. This is as easy as selecting
A.py and uploading the file on the contest submission page. Make sure to select the
appropriate programming language. If you are using Python 3, be sure and submit to PyPy3,
as this generally runs much faster.
Configurations
The file conf.json contains the used compile and execute commands. More commands
can be added for different languages. In addition, names of directories for source files,
contest files, and executables can be changed.
About
This tool is only verified on Linux and is still considered in beta. Once more testing has been done and more test cases have been added, we will proceed with a full release.
Acknowledgements
Thanks to sayuan and all of the contributors to the original CodeforcesRunner project. Additional thanks to dhashe for help testing this project.
Metadata
Release files for ecfr 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ecfr-0.1.1.tar.gz | 10.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ecfr-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.1 kB
Release files / ecfr-0.1.1.tar.gz
| Download URL | ecfr-0.1.1.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8aa36f265bcf5578ef9cec7cacb7236f75e494f75258e5e57f8a5113c9548729
|
|
BLAKE2b-256 checksum How to use checksums |
7cd49bed0632b9f11047186b5c57a5a0e09bbb99dfc07f310e25c7a8aa61f277
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1019-azure
|
Release files / ecfr-0.1.1-py3-none-any.whl
| Download URL | ecfr-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
889566fe869bf1ac1c140691490cb7fd6ac89c210f8f8c7d0525dec86174588f
|
|
BLAKE2b-256 checksum How to use checksums |
060dfa645b4d111aa33e1a9d98ad14bc283fde0060b0d6c4491de13037d0d7e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1019-azure
|
Security for ecfr 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.