Package entropy :: Module misc :: Class EntropyGeoIP

Class EntropyGeoIP

source code

Entropy geo-tagging interface containing useful methods to ease metadata management and transfor- mation. It's a wrapper over GeoIP at the moment dev-python/geoip-python required

Instance Methods
 
__init__(self, geoip_dbfile) source code
 
get_geoip_country_name_from_ip(self, ip_address)
Returns: string or None
source code
 
get_geoip_country_code_from_ip(self, ip_address)
Returns: string or None
source code
 
get_geoip_record_from_ip(self, ip_address)
@return: dict() or None...
source code
 
get_geoip_record_from_hostname(self, hostname)
Returns: dict() or None
source code
Method Details

get_geoip_country_name_from_ip(self, ip_address)

source code 
Returns:
string or None

get_geoip_country_code_from_ip(self, ip_address)

source code 
Returns:
string or None

get_geoip_record_from_ip(self, ip_address)

source code 

@return: dict() or None
@param1: ip address string
dict data:
    {
        'city': 'Treviso',
        'region': '20',
        'area_code': 0,
        'longitude': 12.244999885559082,
        'country_code3': 'ITA',
        'latitude': 45.666698455810547,
        'postal_code': None,
        'dma_code': 0,
        'country_code': 'IT',
        'country_name': 'Italy'
    }

get_geoip_record_from_hostname(self, hostname)

source code 
Returns:
dict() or None