GithubHelp home page GithubHelp logo

hoenchioma / vlawyer Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 29 KB

An unofficial vjudge statistics API

License: GNU General Public License v3.0

Python 100.00%
python python3 vjudge competitive-programming competitive-programming-contests

vlawyer's Introduction

vlawyer

forthebadge

An unofficial vjudge statistics API

You can use this package to get:

  • submissions data
  • contest standings (comming soon)

PyPi Page: https://pypi.org/project/vlawyer/

Disclaimer: All rights to the site and its data are reserved by the site owner. This is merely a tool to obtain the already acquirable data in a machine readable format. What you do with this data and it's legallity are entirely your responsibility.

Installation

Using pip

Assuming you have pip installed, just run the following command on the terminal

pip install vlawyer

Manually

Clone the repository

git clone https://github.com/hoenchioma/vlawyer.git

Then install the package

cd vlawyer
python setup.py install

Usage

Available functions:

FUNCTIONS
    get_vjudge_data(username: str = '', 
                    oj_id: str = 'All', 
                    problem_no: str = '', 
                    language: str = '', 
                    result: str = 0, 
                    contest_id: str = '', 
                    limit: int = 0)
        Function to return vjudge based on parameters
        
        Parameters:
        username (str): username to search (empty -> all usernames)
        oj_id (str): online judge
            options: All, CodeForces, CodeChef, Gym, LightOJ, UVA, UVALive, 
                     Kattis, AtCoder, SPOJ, TopCoder, etc.
            (ignored if contest_id is specified)
        problem_no (str): problem number (can be found from a problem url in vjudge)
            (if contest id is specified, problem_no is A, B, C, etc. of contest)
        language (str): language of submission
            options: C, CPP, JAVA, PASCAL, PYTHON, CSHARP, RUBY, OTHER (empty -> all)
        result (int): result of submission
            options:
            0 -> All
            1 -> Accepted
            2 -> Presentation Error
            3 -> Wrong Answer
            4 -> Time Limit Exceed
            5 -> Memory Limit Exceed
            6 -> Output Limit Exceed
            7 -> Runtime Error
            8 -> Compile Error
            9 -> Unknown Error
            10 -> Submit Error
            11 -> Queuing && Judging
        contest_id (str): contest id (empty -> no particular contest)
        limit (int): maximum number of returned entries (0 -> no limit)
        
        Returns:
            list: list of dictionaries containing the entries

Example:

import vlawyer
import json

# prints the latest 10 submissions from vjudge.net
# converted to json for better readability
print(json.dumps(vlawyer.get_vjudge_data(limit=10), indent=4, sort_keys=True)) 

# prints the submissions by xxx in contest no yyy
# replace xxx with actual username and yyy with an actual contest (otherwise you'll get an error)
print(json.dumps(vlawyer.get_vjudge_data(username='xxx', contest_id='yyy'), indent=4, sort_keys=True))

response = vlawyer.get_vjudge_data(limit=12)
print(len(response)) # get length of response (12)
print(type(response)) # get the type of response (dict)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.