This Python script utilizes the GeoPy geocoding library to batch geocode a number of addresses, using various services until a pair of latitude/longitude values are returned. Python 3 port and refactor of a script by @rgdonohue.
https://gist.github.com/ericmhuntley/0c293113aa75a254237c143e0cf962fa
Built to anticipate an input csv
should that includes columns named street
, city
, state
, country
.
python geocode.py data.csv 100
Where data.csv
is an appropriately formatted csv
encoded in utf-8
and 100 is the timout between each request in units of milliseconds.
@jazon33y - thanks for the question! This is a fairly thin wrapper around a selection of geocoding services supported by the GeoPy module. For a complete list of supported geocoders (any of which could be easily implemented here, given access to an API key), check out the GeoPy documentation.