pygeon - Pythonic geolocation

This document refers to version 0.1.0

What is this?

pygeon is a Python module that implements simple IP geolocation for both IPv4 and IPv6. It doesn’t rely on third-party databases that might not be maintained, but instead fetches the necessary data directly from RIPE’s FTP server.


pygeon installs a script that you can use from the command line; e.g.:

$ pygeon -d sqlite:////tmp/ipranges.sqlite3 update
Found 82649 ranges
$ pygeon -d sqlite:////tmp/ipranges.sqlite3

It also provides a Python API that you can use in your own programs:

>>> import pygeon
>>> store = pygeon.SQLAlchemyStore('sqlite:////tmp/ipranges.sqlite3')
>>> geo = pygeon.Geolocator(store)
>>> iprange = geo.lookup('')
>>> print iprange.start
>>> print

Code Documentation


Indices and tables