?

Log in

No account? Create an account
wolog.net
Thursday, April 14th, 2005

Date:2005-04-14 17:10
Subject:ipfree.py
Security:Public

I'm processing some log data coming in from around the world, so I thought it would be nice to be able to look up IP addresses by country. Although more specific geographic data on IP numbers seems to be available only for a price, the country mapping is available for free in the Perl module Geo::IPfree.

I've turned this into a Python module, ipfree.py. Unlike the Perl package, which stores the database in an auxiliary file, this Python module is just a single file containing the entire database and a simple lookup function. It's a bit big (nearly a megabyte), but it's easy to use and it works.

>>> import ipfree
>>> ipfree.lookup('129.97.128.15')
('CA', 'Canada')
>>> ipfree.lookup('194.109.137.226')
('NL', 'Netherlands')
>>>
Hope someone out there has a use for it.

12 comments | post a comment



Date:2005-04-14 20:48
Subject:Kingman adopts Condorcet voting.
Security:Public

The proposed bylaw change has passed by a two-thirds majority vote! Kingman will be the first house in the USCA to use Condorcet voting. We will use the Schulze completion method, just like the Debian project.

Here is the software we will use. It should run on Linux, Mac OS, or Windows.

3 comments | post a comment


browse days
my journal