mozloc


Namemozloc JSON
Version 1.6.0 PyPI version JSON
download
home_page
SummaryUsing Mozilla Location services, log location vs. time using WiFi or convert to KML.
upload_time2023-10-02 17:45:45
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords wifi geolocation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Mozilla Location Services from Python

[![ci](https://github.com/scivision/mozilla-location-wifi/actions/workflows/ci.yml/badge.svg)](https://github.com/scivision/mozilla-location-wifi/actions/workflows/ci.yml)
[![PyPi Download stats](http://pepy.tech/badge/mozloc)](http://pepy.tech/project/mozloc)

Uses command line access to WiFi information via
[Mozilla Location Services API](https://ichnaea.readthedocs.io/en/latest/api/geolocate.html?highlight=macaddress#wifi-access-point-fields)
from Python.
The command line programs used to access WiFi information include:

* Linux: [nmcli](https://developer.gnome.org/NetworkManager/stable/nmcli.html) NetworkManager
* MacOS: [airport](https://ss64.com/osx/airport.html) built into MacOS
* Windows: [netsh](https://learn.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh)

Note that a similar service with better accuracy is available from
[Google](https://developers.google.com/maps/documentation/geolocation/intro).

## Install

Get latest release

```sh
pip install mozloc
```

or for latest development version:

```sh
git clone https://github.com/scivision/mozilla-location-wifi/
pip install -e ./mozilla-location-wifi
```

## Usage

```sh
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:

```sh
python -m mozloc.signal
```

### macOS

On macOS, much more accurate results come by running as root by using sudo.
This is because "airport" only emits BSSID if running with sudo.

Possible future implementation could use
[CoreWLAN](https://developer.apple.com/documentation/corewlan/).

### 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:

```sh
python -m mozloc.csv2kml in.log out.kml
```

which uses

```sh
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.

## Notes

* [Inspired by](https://github.com/flyinva/mozlosh)
* [Alternative using Skyhook and geoclue](https://github.com/scivision/python-geoclue)
* [Raspberry Pi NetworkManager](https://raspberrypi.stackexchange.com/a/73816)

To print verbose information about nearby WiFi:

* Windows: `netsh wlan show networks mode=bssid`
* MacOS: `airport -s`
* Linux: `nmcli dev wifi list`

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "mozloc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "wifi,geolocation",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/3a/06/33034a822e5cdf0a7088b18a63229133f5a6ec08a3e6c5878deb4a580cbd/mozloc-1.6.0.tar.gz",
    "platform": null,
    "description": "# Mozilla Location Services from Python\n\n[![ci](https://github.com/scivision/mozilla-location-wifi/actions/workflows/ci.yml/badge.svg)](https://github.com/scivision/mozilla-location-wifi/actions/workflows/ci.yml)\n[![PyPi Download stats](http://pepy.tech/badge/mozloc)](http://pepy.tech/project/mozloc)\n\nUses command line access to WiFi information via\n[Mozilla Location Services API](https://ichnaea.readthedocs.io/en/latest/api/geolocate.html?highlight=macaddress#wifi-access-point-fields)\nfrom Python.\nThe command line programs used to access WiFi information include:\n\n* Linux: [nmcli](https://developer.gnome.org/NetworkManager/stable/nmcli.html) NetworkManager\n* MacOS: [airport](https://ss64.com/osx/airport.html) built into MacOS\n* Windows: [netsh](https://learn.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh)\n\nNote that a similar service with better accuracy is available from\n[Google](https://developers.google.com/maps/documentation/geolocation/intro).\n\n## Install\n\nGet latest release\n\n```sh\npip install mozloc\n```\n\nor for latest development version:\n\n```sh\ngit clone https://github.com/scivision/mozilla-location-wifi/\npip install -e ./mozilla-location-wifi\n```\n\n## Usage\n\n```sh\npython -m mozloc\n```\n\nShows `time` `lat` `lng` `accuracy` `N BSSIDs heard`.\nIn urban areas, accuracy of less than 100 meters is possible.\n\ndump raw signals, without using API:\n\n```sh\npython -m mozloc.signal\n```\n\n### macOS\n\nOn macOS, much more accurate results come by running as root by using sudo.\nThis is because \"airport\" only emits BSSID if running with sudo.\n\nPossible future implementation could use\n[CoreWLAN](https://developer.apple.com/documentation/corewlan/).\n\n### Windows\n\nOn Windows, NetSH is used.\nYou may need to disconnect from WiFi (leave WiFi enabled) to make your WiFi chipset scan and be able to get location.\n\n## convert to KML\n\nDisplay logged data in Google Earth or other KML viewer after converting from CSV to KML:\n\n```sh\npython -m mozloc.csv2kml in.log out.kml\n```\n\nwhich uses\n\n```sh\npip install simplekml\n```\n\nNote that your time MUST be in ISO 8601 format or some KML reading programs such as Google Earth will just show a blank file.\nE.g.\n\n2016-07-24T12:34:56\n\n## TODO\n\nWould like to add Bluetooth beacons.\n\n## Notes\n\n* [Inspired by](https://github.com/flyinva/mozlosh)\n* [Alternative using Skyhook and geoclue](https://github.com/scivision/python-geoclue)\n* [Raspberry Pi NetworkManager](https://raspberrypi.stackexchange.com/a/73816)\n\nTo print verbose information about nearby WiFi:\n\n* Windows: `netsh wlan show networks mode=bssid`\n* MacOS: `airport -s`\n* Linux: `nmcli dev wifi list`\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Using Mozilla Location services, log location vs. time using WiFi or convert to KML.",
    "version": "1.6.0",
    "project_urls": null,
    "split_keywords": [
        "wifi",
        "geolocation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76e9a19528779189595cfe805405e727ddce5cbd841dd827efb5e391c24f3a27",
                "md5": "200764b7c5afec3b099a408392b57822",
                "sha256": "663055a1f7747eccd5b30d774c8008527e4e6e7f2d2338056a9cd72ea60957b0"
            },
            "downloads": -1,
            "filename": "mozloc-1.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "200764b7c5afec3b099a408392b57822",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 12775,
            "upload_time": "2023-10-02T17:45:43",
            "upload_time_iso_8601": "2023-10-02T17:45:43.394497Z",
            "url": "https://files.pythonhosted.org/packages/76/e9/a19528779189595cfe805405e727ddce5cbd841dd827efb5e391c24f3a27/mozloc-1.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a0633034a822e5cdf0a7088b18a63229133f5a6ec08a3e6c5878deb4a580cbd",
                "md5": "afc85017edbdfffbca249c805121d825",
                "sha256": "4a6c56fd1a96547ce8851c5c9fa955036c387c38aaf92284b2b9d0b6bed70af4"
            },
            "downloads": -1,
            "filename": "mozloc-1.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "afc85017edbdfffbca249c805121d825",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10912,
            "upload_time": "2023-10-02T17:45:45",
            "upload_time_iso_8601": "2023-10-02T17:45:45.700043Z",
            "url": "https://files.pythonhosted.org/packages/3a/06/33034a822e5cdf0a7088b18a63229133f5a6ec08a3e6c5878deb4a580cbd/mozloc-1.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-02 17:45:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mozloc"
}
        
Elapsed time: 0.12583s