geoloqi Package

geoloqi Module

class geoloqi.geoloqi.Geoloqi(api_key=None, api_secret=None, access_token=None)

A simple interface wrapper for the Geoloqi API.

get(path, args=None, headers=None)

Make a GET request to the Geoloqi API server.

Args:
path: Path to the resource being requested (example: ‘account/profile’) args: An optional dictonary of GET arguments. headers: An optional dictonary of extra headers to send with the request.
Returns:
The JSON response as a dictionary.
post(path, data=None, headers=None)

Make a POST request to the Geoloqi API server.

Args:
path: Path to the resource being requested (example: ‘account/profile’) data: An optional dictonary to be sent to the server as a POST. headers: An optional dictonary of extra headers to send with the request.
Returns:
The JSON response as a dictionary.
run(path, data=None, headers=None)

Make a request to the Geoloqi API server.

Args:
path: Path to the resource being requested (example: ‘account/profile’) data: An optional dictonary to be sent to the server as a POST. headers: An optional dictonary of extra headers to send with the request.
Returns:
The JSON response as a dictionary.
class geoloqi.geoloqi.Session(api_key=None, api_secret=None, access_token=None)

This class represents a session with the Geoloqi API.

establish(data)

Used to retrieve the access token from the Geoloqi OAuth2 server. This is used internally and you shouldn’t need to call it manually.

Args:
data: A dictionary of data to be included with the request. You should
include the OAuth2 ‘grant_type’ and other data like your refresh token.
Returns:
None
execute(path, data=None, headers=None)

Makes a low-level request to the Geoloqi API server. Does no processing of the response.

Args:
path: Path to the resource being requested (example: ‘account/profile’) data: An optional dictonary to be sent to the server as a POST. headers: An optional dictonary of extra headers to send with the request.
Returns:
A file like object returned from urllib2.urlopen.
get(path, args=None, headers=None)

Make a GET request to the Geoloqi API server.

Args:
path: Path to the resource being requested (example: ‘account/profile’) args: An optional dictonary of GET arguments. headers: An optional dictonary of extra headers to send with the request.
Returns:
The JSON response as a dictionary.
get_access_token()

Retrieve an access token for this session. This token is used in the same manner as the user access token, it simply allows the application to make requests on the behalf of itself instead of a user within the app.

This call makes a request to the API server once for each instantiation of the object, then cache the result on the object.

Returns:
The current access token as a String.
get_user_agent_string()

Retrieve a ‘User-Agent’ string to be used when making API requests.

Returns:
The ‘User-Agent’ string.
post(path, data=None, headers=None)

Make a POST request to the Geoloqi API server.

Args:
path: Path to the resource being requested (example: ‘account/profile’) data: An optional dictonary to be sent to the server as a POST. headers: An optional dictonary of extra headers to send with the request.
Returns:
The JSON response as a dictionary.
renew_access_token()

Renew the access token using the stored refresh token. This method is called automatically when the server returns an expired_token response, so you shouldn’t need to call it manually.

Returns:
None
run(path, data=None, headers=None)

Make a request to the Geoloqi API server.

Args:
path: Path to the resource being requested (example: ‘account/profile’) data: An optional dictonary to be sent to the server as a POST. headers: An optional dictonary of extra headers to send with the request.
Returns:
The JSON response as a dictionary.

Project Versions

Table Of Contents

This Page