isogeo_pysdk.checker module

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

class isogeo_pysdk.checker.IsogeoChecker[source]

Bases: object

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

check_api_response(response) → True[source]

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: str, md_type: str)[source]

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: str = 'api.isogeo.com', proxies: dict = None) → bool[source]

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

Parameters:remote_server (str) – remote server used to check
check_is_uuid(uuid_str: str)[source]

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

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

Check parameters passed to avoid errors and help debug.

Parameters:response (dict) – search request parameters