wloc
0.4.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) |
bool | __check_tokens (self) |
None | __fetch_networks (self) |
list | __run_glike (self, str auri, str akey) |
list | __run_yalike (self, str auri, str akey) |
Private Attributes | |
__gg_apikey | |
__gg_apiuri | |
__mm_apikey | |
__mm_apiuri | |
__netlist | |
__ya_apikey | |
__ya_apiuri | |
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.
|
private |
Checks if API tokens set in configuration file. :return: Check results
|
private |
Receives list of available networks and stores them in a private class property.
|
private |
Internal implementation of Google-like geolocation API fetcher. :param auri: String with Google API URI :param akey: String with Google API key :return: Coordinates (float).
|
private |
Internal implementation of Yandex-like geolocation API fetcher. :param auri: String with Yandex API URI :param akey: String with Yandex API key :return: Coordinates (float).
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.
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.