非正式的vjudget.net网站统计API

vlawyer的Python项目详细描述


弗拉维耶

forthebadge

一个非官方的vjudge统计API

您可以使用此软件包获得:

  • 提交资料
  • 比赛排名(即将公布)

免责声明:网站及其数据的所有权利由网站所有者保留。这只是一个工具,以机器可读的格式获取已经获得的数据。你对这些数据做什么以及它的合法性完全是你的责任。在

安装

使用pip

假设您已经安装了pip,只需在终端上运行以下命令

pip install vlawyer

手动

克隆存储库

^{pr2}$

然后安装软件包

cd vlawyer
python setup.py install

用法

可用功能:

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

示例:

importvlawyerimportjson# prints the latest 10 submissions from vjudge.net# converted to json for better readabilityprint(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)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
插入表达式以完成JAVA语句块时出现语法错误   在linkedlist中的特定节点后插入java   java如何将参数传递给安卓 junit测试(参数化测试)   java在运行时将数据添加到片段中的RecyclerView,在该片段中,数据是在单独的片段中创建的   java apache CsrfPreventionFilter和404错误   java Ask是安卓 6.0的多重权限   java将字符串解析为Time并插入mysqldatabase   java扩展MyBatis映射器接口可能导致异常   java SparkSql不支持日期格式   在java中剪切字符串的一部分   将Java lambda的结果分配给字段   在Java中解析OCL?   java解析json到安卓中活动中的对象   用于时区转换的JavaAPI   在Oracle上建立与ESRI geodatabase直接连接的java在未处于调试模式时挂起   拆分文件时出错。使用Java8的xml文件   java eclipse jsp无颜色、代码完成和错误检测   java spring kafka侦听器在错误的位置查找ContainerProperty   java Springboot应用程序@EnableConfigServer无法在Eclipse中解析   当尝试使用ConstraintLayout将java视图添加到同一行时,java视图会被截断