Geolocate IPv6 with Python

Posted by romia on 2014-09-12 01:30

The Python library is supporting both IPv4 and IPv6 addresses. Users can get the library to process geolocation stuff.

Sample codes:

import IP2Location;

IP2LocObj = IP2Location.IP2Location();
IP2LocObj.open("data/IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-SAMPLE.BIN");
rec = IP2LocObj.get_all("19.5.10.1");

print rec.country_short
print rec.country_long
print rec.region
print rec.city
print rec.isp
print rec.latitude
print rec.longitude
print rec.domain
print rec.zipcode
print rec.timezone
print rec.netspeed
print rec.idd_code
print rec.area_code
print rec.weather_code
print rec.weather_name
print rec.mcc
print rec.mnc
print rec.mobile_brand
print rec.elevation
print rec.usage_type

http://ip2location.com/developers/python

sophisticated | Sun, 2014-09-28 09:12

In commercial use/license does it allow modifications of this library?
We are thinking of using it for our digital forensics needs, which would require some
modifications done to the code. https://www.elvidence.com.au