Python modules for extracting geolocation information
Now that we have reviewed some services to obtain geolocation from the IP address, we are going to review the main modules that we find in Python to obtain this information. We’ll be working with the following modules:
- geoip-python3: Provides GeoIP functionality for Python (https://pypi.org/project/python-geoip-python3)
- python-geoip-geolite2: Provides access to the
geolite2
database. This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com - geoip2: Provides access to the GeoIP2 web services and databases (https://github.com/maxmind/GeoIP2-python, https://pypi.org/project/geoip2/)
- maxminddb-geolite2: Provides a simple MaxMindDB reader extension (https://github.com/rr2do2/maxminddb-geolite2)
geoip-python3
and python-geoip-geolite2
can be installed using the following commands:
$ pip install python-geoip-python3
$ pip install python-geoip-geolite2...