Search code examples
pythongeolocationgps

How can I get the location of a device in python?


so i'm trying to make a program that can give the user there current gps location, I didn't want to use any sort of API's, what are some libraries I can use to go about this?


Solution

  • Yoy have many options:

    Geopy is a Python library that offers services for geocoding and also has modules for gaining access to GPS data from various sources. The geopy library can be used to determine a user's location based on their IP address or Wi-Fi network.

    GPSd is a service daemon that keeps an eye on one or more GPS units and gives access to the GPS data via a number of protocols. The gpsd Python library can be used to interact with the GPSd daemon and retrieve the GPS coordinates from a connected GPS device.

    PySerial : If your computer has a serial port and your GPS device is attached to it, you can read data from the GPS device using the pyserial library. You may speak with the device and other objects using the library.