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第三方库


热门话题
在通过REST Api发送之前,java是否会操纵map中键的顺序?   java实时代码编译?   java在尝试使用JavaFX制作东西时获得0xC0000409   java截图并返回servlet?   java哪个用户认证集成安全性?   SpringJavaMailSender和MS Exchange:java。lang.noclassdeffounderror:com。太阳邮政uti。邮件记录器   Linux上的Java小程序无法获得权限   java如何获得一行(范围)中字符串的组合?   媒体播放器的java意图过滤器(Youtube视频播放)   java如何明确地确定文件是否不是我想要的类型?   Java 8中并发异步方法后跟并行执行方法