PyGeoIP is a pure python GeoIP API based on MaxMind’s C-based Python API.
The python implementation is ported from the PHP GeoIP API written by Jim Winstead and Hans Lellelid.

Option 1: Installation using PIP

Option 2: Download and Install from Github repository

An alternative to pip is to download the code from github and then run the installation script.

Option 3: MaxMind – libGeoIP Python Library

MaxMind also offers a Python library that links against the libGeoIP C library.

Prepare Test

pygeoip_test.py

References

1. MaxMind Home: http://www.maxmind.com
2. MaxMind GeoIP Database Download: http://geolite.maxmind.com/download/geoip/database/
3. MaxMind Python Library: http://dev.maxmind.com/geoip/downloadable#Python-5
4. PyGeoIP Installation: http://code.google.com/p/pygeoip/wiki/Install
5. PyGeoIP Usage Guide: http://code.google.com/p/pygeoip/wiki/Usage
6. Python GeoIP (python-geoip) Cities Tutorial: http://pointlessrants.com/post/python-geoip-python-geoip-cities-tutorial-
7. GeoIP Country City Python Tutorial: http://www.ip2location.com/python.aspx
9. Easy IP-to-country lookup in Python: http://blog.brush.co.nz/2009/07/geoip/

About Gugulethu Ncube

IT enthusiast getting things done.