wloc 1.1.0
Simple Wi-Fi geolocation library and tool
wloc.backends.yandex.BackendYandex Class Reference
Inheritance diagram for wloc.backends.yandex.BackendYandex:
wloc.backends.BackendCommon

Public Member Functions

 __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)
 

Protected Attributes

str _apikey
 
str _endpoint = 'https://api.lbs.yandex.net/geolocation'
 
int _timeout = 30
 

Detailed Description

Class for working with the Yandex Locator API.

Constructor & Destructor Documentation

◆ __init__()

wloc.backends.yandex.BackendYandex.__init__ ( self,
str apikey )
Main constructor of the BackendYandex class.
:param apikey: String with the API token (key).

Member Function Documentation

◆ _check_response()

None wloc.backends.BackendCommon._check_response ( r)
staticprotectedinherited
Checks the API response for errors.
:param r: An instance of the Response class.
:exception BackendError: An HTTP error has occurred.

◆ _execute()

list wloc.backends.yandex.BackendYandex._execute ( self,
list netlist )
protected
Internal implementation of Yandex Locator API fetcher.
:param netlist: The list of available Wi-Fi networks.
:return: Coordinates (float).

Reimplemented from wloc.backends.BackendCommon.

◆ _uri()

str wloc.backends.yandex.BackendYandex._uri ( self)
protected
Gets fully-qualified geolocation API URI.
:return: Fully-qualified geolocation API URI.

Reimplemented from wloc.backends.BackendCommon.

◆ get_coords()

list wloc.backends.BackendCommon.get_coords ( self,
list netlist )
inherited
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).