UnwiredLabs Location API客户端。

unwiredlabs的Python项目详细描述


这在python中实现了unwiredlabs location api协议

安装

只需使用pip

安装
pip install unwiredlabs

用法

python示例:

import unwiredlabs

key = 'ABCDEF1234567890'  # from the API console

bssid = 'ab:cd:ef:12:34:56'
rssi = -60

request = unwiredlabs.UnwiredRequest()
request.addAccessPoint(bssid, rssi)

connection = unwiredlabs.UnwiredConnection(key=key)
response = connection.performRequest(request)

if response.status != 'Ok':
        print('Error:', response.status)
else:
        print('Response: ', response.coordinate)

命令行客户端

test目录中,您将找到一个命令行客户机来测试是否一切正常:

$ python cmdline_client.py --help
usage: cmdline_client.py [-h] -k KEY [-w WIFI] [-g GPS] [-c CELL]
                                                 [-l LTE] [-u UMTS] [-m CDMA] [-a]

Make a location request against the unwiredlabs location API

optional arguments:
  -h, --help            show this help message and exit
  -k KEY, --key KEY     token from Unwired API panel
  -w WIFI, --wifi WIFI  WIFI BSSID and signal strength (format: XX:XX:XX:XX:XX:XX@RSSI)
  -g GPS, --gps GPS     GPS coordinate (format: latitude,longitude@num_satelites)
  -c CELL, --cell CELL, --celltower CELL
                                                GSM Celltower information (format: MCC,MNC,LAC,CellID@RSSI)
  -l LTE, --lte LTE     LTE Celltower information (format: MCC,MNC,LAC,CellID@RSSI)
  -u UMTS, --umts UMTS  UMTS (3G) Celltower information (format: MCC,MNC,LAC,CellID@RSSI)
  -m CDMA, --cdma CDMA  CDMA/EVDO Celltower information (format: MCC,MNC,LAC,CellID@RSSI)
  -a, --address         Fetch address info in addition to coordinates

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java ParsePushReceiver参数   java如何从设备读取完整数据?   java将java_设置为home,但忽略错误   java如何从歌曲中对专辑进行排序?   java libnaude+windows 10 x64+Eclipse   java如何将maven目标更改为如图所示的想法中的quickicon?   java swing布局中心面板,可滚动显示多个窗口窗格   使用MOSQUITO代理的mqtt中的java SSL   java如何通过属性值获取XML字符串   java在服务器每次启动时停止GWT编译   java如何让javac搜索类路径的子目录?   可以比较java中的两个不同类吗?   JAVAAndroid活动内部类中的lang.NoClassDefFoundError   java HttpServletRequest获取请求头参数块   C++socket与java客户端的连接   java如何在Apache commons http客户端上使用SSL客户端证书   使用预编译正则表达式模式提高java速度   JavaRhino将两个已编译脚本合并为一个脚本