isogeo_pysdk.checker module

Complementary set of tools to make some checks on requests to Isogeo API.

class isogeo_pysdk.checker.IsogeoChecker

Bases: object

Complementary set of tools to make some checks on requests to Isogeo API.

check_api_response(response)

Check API response and raise exceptions if needed.

Parameters:response (requests.models.Response) – request response to check
Return type:True or tuple
Example:
>>> checker.check_api_response(<Response [500]>)
(False, 500)
check_edit_tab(tab, md_type)

Check if asked tab is part of Isogeo web form and reliable with metadata type.

Parameters:
  • tab (str) – tab to check. Must be one one of EDIT_TABS attribute
  • md_type (str) – metadata type. Must be one one of FILTER_TYPES
check_internet_connection(remote_server='api.isogeo.com', proxies=None)

Test if an internet connection is operational. Src: https://stackoverflow.com/a/20913928/2556577.

Parameters:remote_server (str) – remote server used to check
Return type:bool
check_is_uuid(uuid_str)

Check if it’s an Isogeo UUID handling specific form.

Parameters:uuid_str (str) – UUID string to check
check_request_parameters(parameters={})

Check parameters passed to avoid errors and help debug.

Parameters:response (dict) – search request parameters