< Home - < Back

python-pygeoip


Information about the package, python-pygeoip, which is shipped with common Linux distributions. The python-pygeoip package is designed for, Pure Python GeoIP API.


Package Name:

python-pygeoip

Summary:

Pure Python GeoIP API

Description:

Pure Python GeoIP API based on MaxMind's C-based Python API but the code itself is ported from the Pure PHP GeoIP API. Create your GeoIP instance with appropriate access flag. `STANDARD` reads data from disk when needed, `MEMORY_CACHE` loads database into memory on instantiation and `MMAP_CACHE` loads database into memory using mmap. import pygeoip gi = pygeoip.GeoIP('/usr/share/geoip/GeoIP.dat', pygeoip.MEMORY_CACHE) Country lookup >>> gi.country_code_by_name('google.com') 'US' >>> gi.country_code_by_addr('64.233.161.99') 'US' >>> gi.country_name_by_addr('64.233.161.99') 'United States' City lookup >>> gi = pygeoip.GeoIP('/usr/share/geoip/GeoLiteCity.dat') >>> gi.record_by_addr('64.233.161.99') { 'city': 'Mountain View', 'region_name': 'CA', 'area_code': 650, 'longitude': -122.0574, 'country_code3': 'USA', 'latitude': 37.419199999999989, 'postal_code': '94043', 'dma_code': 807, 'country_code': 'US', 'country_name': 'United States' } >>> gi.time_zone_by_addr('64.233.161.99') 'America/Los_Angeles' For more information, check out the full API documentation at http://packages.python.org/pygeoip.

Architecture:

noarch

Version:

0.2.6

Release:

1.el6

Size:

102 k

Repository:

epel

From Repository:

Licence:

LGPLv3+



Handy Yum Commands for python-pygeoip


Control the python-pygeoip package with the following handy commands outlined below.


Command

Description of Command

yum install python-pygeoip

This command will install python-pygeoip on the server.

yum remove python-pygeoip

This command will un-install python-pygeoip on the server. When you run this command, you will be asked if you are sure that you want to remove python-pygeoip, so you have to manually confirm that you want to do this.

yum -y remove python-pygeoip

This command will un-install python-pygeoip on the server. When you run this command with th e -y flag, you will not be prompted to check that you are sure you want to remove the package - so be sure you absolutely want to remove python-pygeoip when using the -y flag.

yum update python-pygeoip

This command will update python-pygeoip to the latest version. When you run this command, you will be asked if you are sure that you want to remove python-pygeoip, so you have to manually confirm that you want to do this.

yum -y update python-pygeoip

This command will update python-pygeoip to the latest version. When you run this command with the -y flag, you will not be prompted to check that you are sure you want to remove the package - so be sure you absolutely want to remove python-pygeoip when using the -y flag.

yum info python-pygeoip

This command will show you core information about the python-pygeoip package.

yum deplist python-pygeoip

This command will show you the dependencies for python-pygeoip. Thankfully, when using Yum, if dependencies are required, these are also installed at the same time so you don't have to worry too much about that.

yum check-update python-pygeoip

This command will check if there is an update waiting on python-pygeoip. When you run this command this will return nothing if there is nothing to update, or, will return the package name if the package is due to be updated.