Example #1
0
def show(*matches):
    """Information about matches."""
    matches = convert_csv(matches)
    r = requests.get(endpoint("/match/details"), params={"match", matches})
    r.raise_for_status()

    return r.json()
Example #2
0
def list(year):
    """Returns a list of all events in `year`."""
    year = int(year)
    r = requests.get(endpoint("/events/list"), params={"year": year})
    r.raise_for_status()

    return r.json()
Example #3
0
def details(team):
    """Returns detailed information about a particular team.
    Example::

        >>> cobalt.teams.details(4666)
        { ... }

    Should you want to query multiple teams at once, use :func:`show`.
    """
    team = teamkey(team)
    r = requests.get(endpoint('/team/details'), params={ 'team': team })
    r.raise_for_status()

    return r.json()
Example #4
0
def show(*teams):
    """Returns information on multiple teams.
    Example::

        >>> cobalt.teams.show(4666, 2073, 1678)
        [{ ... }, { ... }, { ... }]

    This can also be used to query a single team (by only providing one
    team as an argument). In this scenario, however, :func:`details` may
    be preferred as (while it only accepts a single team for an
    argument) it returns more information on teams than :func:`show`
    does.
    """
    teams = convert_csv(map(teamkey, teams))
    r = requests.get(endpoint('/teams/show'), params={ 'teams': teams })
    r.raise_for_status()

    return r.json()
Example #5
0
def details(event):
    """Get all details for a particular event"""
    r = requests.get(endpoint("/event/details"), params={"event": event})
    r.raise_for_status()

    return r.json()