Skip to main content

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 named Parser and has method parse.

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> in upt.py and add the package to PARSER variable.

  • Enjoy!

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

universal-parser-tool-0.1.5.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

universal_parser_tool-0.1.5-py3-none-any.whl (18.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page