Skip to content

Base HERE API

HEREApi

Bases: object

Base class from which all wrappers inherit.

Source code in herepy/here_api.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class HEREApi(object):
    """Base class from which all wrappers inherit."""

    def __init__(self, api_key: str = None, timeout: int = None):
        """Returns a Api instance.
        Args:
          api_key (str):
            API key taken from HERE Developer Portal.
          timeout (int):
            Timeout limit for requests.
        """

        self.__set_credentials(api_key)
        if timeout:
            self._timeout = timeout
        else:
            self._timeout = 20

    def __set_credentials(self, api_key):
        """Setter for credentials.
        Args:
          api_key (str):
            API key taken from HERE Developer Portal.
        """
        self._api_key = api_key

__init__(api_key=None, timeout=None)

Returns a Api instance. Args: api_key (str): API key taken from HERE Developer Portal. timeout (int): Timeout limit for requests.

Source code in herepy/here_api.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
def __init__(self, api_key: str = None, timeout: int = None):
    """Returns a Api instance.
    Args:
      api_key (str):
        API key taken from HERE Developer Portal.
      timeout (int):
        Timeout limit for requests.
    """

    self.__set_credentials(api_key)
    if timeout:
        self._timeout = timeout
    else:
        self._timeout = 20

__set_credentials(api_key)

Setter for credentials. Args: api_key (str): API key taken from HERE Developer Portal.

Source code in herepy/here_api.py
22
23
24
25
26
27
28
def __set_credentials(self, api_key):
    """Setter for credentials.
    Args:
      api_key (str):
        API key taken from HERE Developer Portal.
    """
    self._api_key = api_key