Using Mozilla Location services, log location vs. time using WiFi or convert to KML.
Project description
RETIRED: Mozilla Location Services from Python
This project is RETIRED due to discontinuation of Mozilla Location Services. It worked so well, sorry to see it go!
This project can nonetheless be used as a reference for accessing WiFi information from Python.
A future direction might be to use Google Geolocation API
Uses command line access to WiFi information via Mozilla Location Services API from Python. The command line programs used to access WiFi information include:
- Linux: nmcli NetworkManager
- MacOS: CoreLocation.CWWiFiClient or for macOS < 14.4 airport
- Windows: netsh
Install
Get latest release
pip install mozloc
or for latest development version:
git clone https://github.com/scivision/mozilla-location-wifi/
pip install -e ./mozilla-location-wifi
Usage
python -m mozloc
Shows time
lat
lng
accuracy
N BSSIDs heard
.
In urban areas, accuracy of less than 100 meters is possible.
dump raw signals, without using API:
python -m mozloc --dump
macOS
macOS ≥ 14.4 uses CoreLocation.CWWiFiClient as "airport" was removed.
Windows
On Windows, NetSH is used. You may need to disconnect from WiFi (leave WiFi enabled) to make your WiFi chipset scan and be able to get location.
convert to KML
Display logged data in Google Earth or other KML viewer after converting from CSV to KML:
python -m mozloc.csv2kml in.log out.kml
which uses
pip install simplekml
Note that your time MUST be in ISO 8601 format or some KML reading programs such as Google Earth will just show a blank file. E.g.
2016-07-24T12:34:56
TODO
Would like to add Bluetooth beacons. Need to use a new location service.
Notes
To print verbose information about nearby WiFi:
- Windows:
netsh wlan show networks mode=bssid
- MacOS:
airport -s
- Linux:
nmcli dev wifi list
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mozloc-1.8.0.tar.gz
.
File metadata
- Download URL: mozloc-1.8.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b14e9ccbafa589c410c99234dcc52fe8eb430f74b8a996ce0208cac3f0cbb8 |
|
MD5 | a15a8759456974ed72be4e6c7c6c4d9d |
|
BLAKE2b-256 | 8f6095f45d23e3a7988adb59dbcba9eeb6bd422fb0271f81ef73d604d63e9c76 |
File details
Details for the file mozloc-1.8.0-py3-none-any.whl
.
File metadata
- Download URL: mozloc-1.8.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f173a4c899bc16eb5cf66a6f0ccce74410d0215ca5812413549be1ea7a8e56dc |
|
MD5 | 43e9203a380a83a4049c500b7b5b4381 |
|
BLAKE2b-256 | 4850f9b61d4ddd484a115e41992428395b047d16f22035bf95a2b8b8df24b889 |