Geolocation is a project mainly written in Python, based on the View license.
Query geolocation services for locations
Query geolocation providers for geodata. Currently only google is supported.
I did this most for fun sometime ago. You probably want to use this library: http://code.google.com/p/geopy/