Return to David's Python Resources

ip2country

A python module for looking up the country in which a given IP address resides.

Features/quirks:

Download

Installation

Usage

There's a simple demo at the bottom of the file, which you can invoke by simply running the file with the python interpreter

Here's an example:

>>> import ip2country
>>> ip2c = ip2country.IP2Country(verbose=1)
>>> ip2c.lookup("202.27.184.3")