wloc  0.8.0
Simple Wi-Fi geolocation library and tool
wloc.WiFiLocator Class Reference

Public Member Functions

None __init__ (self, str gg_apikey=None, str ya_apikey=None, str mm_apikey=None)
 
None add_network (self, str hwaddress, int strength)
 
None fetch_networks (self)
 
None from_json (self, str new_list)
 
list networks (self)
 
list query_google (self)
 
list query_mozilla (self)
 
list query_yandex (self)
 
None remove_network (self, str hwaddress)
 
str to_json (self)
 

Private Member Functions

None __check_networks (self)
 
None __fetch_networks (self)
 

Private Attributes

 __netlist
 

Detailed Description

Wi-Fi simple geolocation class.

Constructor & Destructor Documentation

◆ __init__()

None wloc.WiFiLocator.__init__ (   self,
str   gg_apikey = None,
str   ya_apikey = None,
str   mm_apikey = None 
)
Main constructor.
:param gg_apikey: Google Geolocation API token.
:param ya_apikey: Yandex Locator API token.
:param mm_apikey: Mozilla Geolocation API token.

Member Function Documentation

◆ __check_networks()

None wloc.WiFiLocator.__check_networks (   self)
private
Checks the number of available wireless networks.
:exception NetworksNotFoundError: No wireless networks were found.

◆ __fetch_networks()

None wloc.WiFiLocator.__fetch_networks (   self)
private
Receives list of available networks and stores them in a private
class property.

◆ add_network()

None wloc.WiFiLocator.add_network (   self,
str  hwaddress,
int  strength 
)
Adds a new network to list.
:param hwaddress: Station hardware address.
:param strength: Signal strength in percents (positive number) or
dBm (negative number).

◆ fetch_networks()

None wloc.WiFiLocator.fetch_networks (   self)
Automatically gets list of available Wi-Fi networks.

◆ from_json()

None wloc.WiFiLocator.from_json (   self,
str  new_list 
)
Gets network list from JSON string.
:param new_list: String with JSON.

◆ networks()

list wloc.WiFiLocator.networks (   self)
Gets list of available networks.
:return: List of available networks.

◆ query_google()

list wloc.WiFiLocator.query_google (   self)
Query Google geolocation API.
:return: Coordinates (float).

◆ query_mozilla()

list wloc.WiFiLocator.query_mozilla (   self)
Query Mozilla geolocation API.
:return: Coordinates (float).

◆ query_yandex()

list wloc.WiFiLocator.query_yandex (   self)
Query Yandex geolocation API.
:return: Coordinates (float).

◆ remove_network()

None wloc.WiFiLocator.remove_network (   self,
str  hwaddress 
)
Removes specified by hardware address network from list.
:param hwaddress: Station hardware address.

◆ to_json()

str wloc.WiFiLocator.to_json (   self)
Returns JSON based on list of available networks.
:return: String with JSON.