Geo Location extracted from visitors ip address

Tim Chase python.list at tim.thechases.com
Fri Jul 5 15:58:09 EDT 2013


On 2013-07-05 22:08, Νίκος Gr33k wrote:
> Is there a way to extract out of some environmental variable the
> Geo location of the user being the city the user visits out website
> from?
> 
> Perhaps by utilizing his originated ip address?

Yep.  You can get an 11MB database (17MB uncompressed)

http://dev.maxmind.com/geoip/legacy/downloadable/

which you can use to either populate an existing database with
the .CSV data there, or use the binary data blob in concert with the
Python API

https://github.com/maxmind/geoip-api-python  # Python + C
http://pypi.python.org/pypi/pygeoip/         # pure Python

Just be sure to adhere to the licensing terms.

-tkc







More information about the Python-list mailing list