一个用于vexdb api的瘦python包装器

vexdb的Python项目详细描述


python vexdb

一个用于vexdb api的瘦python包装器。

安装

注意:python vexdb只与python 3兼容!

使用pip安装:pip install vexdb

然后,import vexdb访问包中的函数。

python vexdb需要urllibjson模块,这两个模块都应该随python版本一起提供。

功能

python vexdb为https://vexdb.io/the_data中列出的每个数据类型提供了两个函数,其中DataTypeEventsTeamsMatchesRankingsSeasonRankingsAwards,或Skills

  • getDataType-返回一个字典列表,每个字典对应于一个与提供的条件匹配的结果 作为函数参数。
  • getNumDataType-返回与作为函数参数提供的条件匹配的结果数。

对于每种类型的数据,getDataTypegetNumDataType函数都有一个用于列出的所有参数的参数 在https://vexdb.io/the_data对应的页面上,除了limit_startlimit_numbernodata。 所有参数都是可选的,有关每个参数的详细信息可以在每个参数的vexdb api网页上找到 数据类型。

getDataType函数还有一个布尔参数get_all,当设置为True时,该参数将进行多个api调用 为了确保它返回所有匹配的结果,因为api可能不会返回大量查询的所有结果 (超过几千)火柴。默认值get_allFalse,传递get_all=True只是 对于具有大量预期结果的查询是必需的。

示例调用

返回2017-2018赛季8768A队所有比赛的列表: vexdb.getMatches(team="8768A", season="In The Zone")

查找本季迄今为止颁发的所有奖项: vexdb.getAwards(season="current")

查找美国每个高中VRC团队: vexdb.getTeams(grade="High School", country="United States", get_all=True) (注意使用get_all=True,因为这将返回大量结果)

有关更深入的示例,请参阅example_scripts目录。

帮助文本

要列出每个包含的函数,请运行help(vexdb),其输出如下:

NAME
    vexdb - Thin python wrapper for the VexDB API

FILE
    /Users/john/Library/Python/2.7/lib/python/site-packages/vexdb.py

FUNCTIONS
    getAwards(sku=None, name=None, team=None, season=None, get_all=False)
        Return a list of awards matching the given criteria.

        For sets of criteria that match a large number of awards (a few thousand or so),
        a single request to the API will return only a limited number of results.
        Passing get_all=True will ensure that all matching awards are returned by making
        multiple requests if necessary.

    getEvents(sku=None, program=None, date=None, season=None, city=None, region=None, country=None, team=None, status=None, get_all=False)
        Return a list of events matching the given criteria.

        For sets of criteria that match a large number of events (a few thousand or so),
        a single request to the API will return only a limited number of events.
        Passing get_all=True will ensure that all matching events are returned by making
        multiple requests if necessary.

    getMatches(sku=None, division=None, round=None, instance=None, matchnum=None, scheduled=None, field=None, team=None, scored=None, season=None, get_all=False)
        Return a list of matches matching the given criteria.

        For sets of criteria that match a large number of matches (a few thousand or so),
        a single request to the API will return only a limited number of results.
        Passing get_all=True will ensure that all matching matches are returned by making
        multiple requests if necessary.

    getNumAwards(sku=None, name=None, team=None, season=None)
        Return the number of season rankings matching the given criteria

    getNumEvents(sku=None, program=None, date=None, season=None, city=None, region=None, country=None, team=None, status=None)
        Return the number of events matching the given criteria.

    getNumMatches(sku=None, division=None, round=None, instance=None, matchnum=None, scheduled=None, field=None, team=None, scored=None, season=None)
        Return the number of matches matching the given criteria

    getNumRankings(sku=None, division=None, rank=None, team=None, season=None)
        Return the number of rankings matching the given criteria

    getNumSeasonRankings(program=None, season=None, team=None, vrating_rank=None)
        Return the number of season rankings matching the given criteria

    getNumSkills(sku=None, program=None, type=None, team=None, season=None, season_rank=None, rank=None)
        Return the number of skills records matching the given criteria

    getNumTeams(team=None, program=None, organisation=None, city=None, region=None, country=None, grade=None, is_registered=None, sku=None)
        Return the number of teams matching the given criteria

    getRankings(sku=None, division=None, rank=None, team=None, season=None, get_all=False)
        Return a list of rankings matching the given criteria.

        For sets of criteria that match a large number of rankings (a few thousand or so),
        a single request to the API will return only a limited number of results.
        Passing get_all=True will ensure that all matching rankings are returned by making
        multiple requests if necessary.

    getSeasonRankings(program=None, season=None, team=None, vrating_rank=None, get_all=False)
        Return a list of season rankings matching the given criteria.

        For sets of criteria that match a large number of season rankings (a few thousand or so),
        a single request to the API will return only a limited number of results.
        Passing get_all=True will ensure that all matching season rankings are returned by making
        multiple requests if necessary.

    getSkills(sku=None, program=None, type=None, team=None, season=None, season_rank=None, rank=None, get_all=False)
        Return a list of skills records matching the given criteria.

        For sets of criteria that match a large number of skills records (a few thousand or so),
        a single request to the API will return only a limited number of results.
        Passing get_all=True will ensure that all matching skills records are returned by making
        multiple requests if necessary.

    getTeams(team=None, program=None, organisation=None, city=None, region=None, country=None, grade=None, is_registered=None, sku=None, get_all=False)
        Return a list of teams matching the given criteria.

        For sets of criteria that match a large number of teams (a few thousand or so),
        a single request to the API will return only a limited number of results.
        Passing get_all=True will ensure that all matching teams are returned by making
        multiple requests if necessary.

    urlToJSON(url)
        Makes a request to the specfied URL and returns a list of results.

    urlToSize(url)
        Makes a request to the specfied URL and returns the number of results.

        Useful mostly when making calls with the 'nodata' perameter set to true.

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

推荐PyPI第三方库


热门话题
java静态键入和编写一个简单的矩阵库   java如何最小化层次结构的代码量   这是在Google云数据存储中使用Java按键查询的正确方法吗?   java Android php+mysql+json执行异步任务时出错   java Hadoop Hbase访问被拒绝异常   java如何在json中指定特定的对象路径   JavaSpringJPA/Hibernate在使用@modify和@Query进行特殊更新之前调用完整更新   java多个错误通知   java插入Linkedlist和Node   java将图像放在webview中并调整其宽度   Java没有真实属性的缺点是什么?   java“isGooglePlayServicesAvailable”(此)已被弃用   java托管HIPPO CMS   安卓 Java。网URI构造函数不是编码字符(&C)   java如何用hibernate映射Deque?   java传递枚举类型作为参数   java自由堆大小在Maven中不会增加   java如何使用hashmap和arraylist的循环逻辑?   java如何使用JDBC复制MySql数据库