Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 22847

Catalin George Festila: Using pygeoip and maxmin database.

$
0
0

I try locate one ip using the databases from maxmind website and is not good for me.
The database records show me the output from country area.
I read the docs from here.
This is the python script I used:
#wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
import pygeoip
gip = pygeoip.GeoIP('GeoLiteCity.dat')
rec = gip.record_by_addr('___________________')
for key,val in rec.items():
print "%s: %s" %(key,val)

Have a great day.

Viewing all articles
Browse latest Browse all 22847

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>