Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This Python 3.x script was written as a function to geocode delimited text files of parsed or un-parsed US addresses using the US Census Geocoder API. It relies on the external censusgeocode module which must be downloaded and installed in advance, as well as several internal Python modules. For best results, input text files should be encoded as UTF-8. After loading the function, it can be called to process a file with the following parameters:

...

ParametersExample 1Example 2

census_geocode(datafile,delim,header,start,addcol)

 

census_geocode('my_addresses.txt','\t','n',0,[2,3,4,5])census_geocode('C:\data\addresses.csv', ',', 'y',0,[3])
(str,str,str,int,list[int]) -> filesFile is: stored in same directory as the script, is tab-delimited, has no header, start reading at the beginning, address, city, state, and ZIP are stored in columns 2 through 5.File is: stored in an absolute location, is comma-delimited, has a header, start reading at the beginning, un-parsed address is stored in the 3rd column.

Download

Also available on github

DateNameDescription
May 20152016geocode_census_funct.zipPython 3.x script with documentation for batch geocoding text files of US addresses

...