Useful tool to speedup testing codes in cp-programming
Project description
Universal Problem Parser Tool
Install
Simple and straight. Make sure you have Python3 and pip. Then install using this command.
pip install universal-parser-tool
This script need selenium to run. Below link has explained how to install selenium for python. Firefox is the default driver for this code, so install Firefox and it's driver as in link below.
https://selenium-python.readthedocs.io/installation.html
The main idea is based on this repository.
So you must add cf
to your PATH.
After installing, upt
command will added to your PATH.
Parse
You can use upt
like this script:
upt <PARSER> <PARSER COMMANDS>
Supported Parser
In this time, these judges have parsers. You can find more info about them in their directory.
- AtCoder
- Codechef
- Spoj
- Quera
NOTE: You may use parser for practice problems. During a contest, some of judges need
authentication that not supported by upt
at this time.
Manual Parser
You can write your own parser for different judges.
-
Create a directory named
<PARSER>
and a python file named__init__.py
inside it. You must write your parser in this code -
In
__init__.py
there must be a class namedParser
and has methodparse
.
class Parser:
@staticmethod
def parse(args):
# Your Code
args
is the same as <PARSER COMMANDS>
and it is a list of arguments passed to the parser.
It is recommended to use logging
to output info about parser condition.
Also there are some pre-written codes in utils that can help to make your parser simpler. For more information, read utils source or other parsers.
-
Import your
<PARSER>
inupt.py
and add the package toPARSER
variable. -
Enjoy!
Project details
Release history Release notifications | RSS feed
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
Hashes for universal-parser-tool-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cad7228895bdfbb61c6c4346538ff17f64c29eec4b150db5766e3041a349f22b |
|
MD5 | 04f78154f7578292e8e2166953b257f2 |
|
BLAKE2b-256 | a1ba52bd58c8f62b42e6d8e116061500a564e09dca2c1ca084e602973fda6af8 |
Hashes for universal_parser_tool-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 293d47cc6c75301af9cbb43c553c88995fdc393a6ddf9ef4def992a7bce39869 |
|
MD5 | 46b4115edf83854b3babada53bb01efa |
|
BLAKE2b-256 | b57b456bb817a714ebfa05b6035ab12b7ba3af3e46f582fd7e7774476a913c20 |