wloc 1.1.0
Simple Wi-Fi geolocation library and tool
|
Public Member Functions | |
def | __init__ (self, str apikey) |
list | get_coords (self, list netlist) |
Protected Member Functions | |
list | _execute (self, list netlist) |
str | _uri (self) |
Static Protected Member Functions | |
None | _check_response (r) |
Abstract class for working with geolocation backends.
def wloc.backends.BackendCommon.__init__ | ( | self, | |
str | apikey | ||
) |
Main constructor of the BackendCommon class. :param apikey: String with the API token (key).
Reimplemented in wloc.backends.google.BackendGoogle, wloc.backends.mozilla.BackendMozilla, and wloc.backends.yandex.BackendYandex.
|
staticprotected |
Checks the API response for errors. :param r: An instance of the Response class. :exception BackendError: An HTTP error has occurred.
|
protected |
Calls the backend API and returns the coordinates. Abstract method. Must be overridden. :param netlist: The list of available Wi-Fi networks. :return: Coordinates (float).
Reimplemented in wloc.backends.google.BackendGoogle, and wloc.backends.yandex.BackendYandex.
|
protected |
Gets fully-qualified geolocation API URI. Abstract property. Must be overridden. :return: Fully-qualified geolocation API URI.
Reimplemented in wloc.backends.google.BackendGoogle, and wloc.backends.yandex.BackendYandex.
list wloc.backends.BackendCommon.get_coords | ( | self, | |
list | netlist | ||
) |
Calls the backend API and returns the coordinates. :param netlist: The list of available Wi-Fi networks. :exception MissingTokenError: API token not entered or is not valid. :exception NetworksNotFoundError: The wireless networks list is empty. :return: Coordinates (float).