wloc 1.1.0
Simple Wi-Fi geolocation library and tool
|
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 | |
Wi-Fi simple geolocation class.
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.
|
private |
Checks the number of available wireless networks. :exception NetworksNotFoundError: No wireless networks were found.
|
private |
Receives list of available networks and stores them in a private class property.
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).
None wloc.WiFiLocator.fetch_networks | ( | self | ) |
Automatically gets list of available Wi-Fi networks.
None wloc.WiFiLocator.from_json | ( | self, | |
str | new_list | ||
) |
Gets network list from JSON string. :param new_list: String with JSON.
list wloc.WiFiLocator.networks | ( | self | ) |
Gets list of available networks. :return: List of available networks.
list wloc.WiFiLocator.query_google | ( | self | ) |
Query Google geolocation API. :return: Coordinates (float).
list wloc.WiFiLocator.query_mozilla | ( | self | ) |
Query Mozilla geolocation API. :return: Coordinates (float).
list wloc.WiFiLocator.query_yandex | ( | self | ) |
Query Yandex geolocation API. :return: Coordinates (float).
None wloc.WiFiLocator.remove_network | ( | self, | |
str | hwaddress | ||
) |
Removes specified by hardware address network from list. :param hwaddress: Station hardware address.
str wloc.WiFiLocator.to_json | ( | self | ) |
Returns JSON based on list of available networks. :return: String with JSON.