linksight.resource.base module

class linksight.resource.base.Resource(client, resp)[source]

Bases: dict

Base Resource class

classmethod create(client, **kwargs)[source]

Create a POST request to LinkSight endpoint

Parameters:client (requests.Session) – An instance of the client
Returns:An instance of itself with the appropriate response
Return type:dict
create_instance_url(*args)[source]

Create the instance url to pass the request onto

Parameters:args (str) –
Returns:The instance url
Return type:str
classmethod retrieve(client, id)[source]

Create a GET request to LinkSight endpoint

Parameters:
  • client (requests.Session) – An instance of the client
  • id (str) – ID of the user
Returns:

An instance of itself with the appropriate response

Return type:

dict

linksight.resource.resources module

Contains various resources for API calls

class linksight.resource.resources.Dataset(client, resp)[source]

Bases: linksight.resource.base.Resource

Resource for handling dataset-related API calls

match(source_bgy_col=None, source_municity_col=None, source_prov_col=None, export=True)[source]

Perform a match using the LinkSight API

Parameters:
  • source_bgy_col (str) – Column name for the barangays
  • source_municity_col (str) – Column name for the municipality
  • source_prov_col (str) – Column name for the province
  • export (bool) – Export the resulting match (default is True)
Returns:

The API response containing the match

Return type:

linksight.resource.resources.Match

url = 'datasets'
class linksight.resource.resources.Match(client, resp)[source]

Bases: linksight.resource.base.Resource

Resource for handling resulting dataset matches

url = 'matches'
class linksight.resource.resources.User(client, resp)[source]

Bases: linksight.resource.base.Resource

Resource for handling user-related API calls

url = 'users'