Using Hostip Berkeley DB Files From Python

I needed to process some IP addresses the other day to associate them with their originating Country. I implemented the code in Python (as usual), and decided to try out Hostip for the IP address to Country mappings. Hostip provides freely downloadable bdb data files (along with a mysql db and a CSV file). Using the bdb files isn’t straightforward, so here is a general recipe for consuming them: Download the bdb files from hostip. »