title: reverse geocoding with python geocoder
body: <p>I'm trying my hands on reverse geocoding with python and the module geocoder</p>
  
  <p>I built this script</p>
  
  <pre><code>#!/Users/admin/anaconda/bin/python
  
  import geocoder
  import unicodecsv
  import logging
  
  
  with open('locs2.csv', 'rb') as f:
      reader = unicodecsv.DictReader(f, encoding='iso-8859-1')
      for line in reader:
          lat = line['lat']
          lon = line['lon']
          g = geocoder.google(['lat','lon'], method=reverse)
          if g.ok:
            g.postal
            logging.info('Geocoding SUCCESS: ' + address)
          else:
            logging.warning('Geocoding ERROR: ' + address)
  </code></pre>
  
  <p>According to the doc <a href="https://pypi.python.org/pypi/geocoder/0.9.1" rel="nofollow">here</a>, we can do reverse. However, when I'm running the script , I have this error <code>NameError: name 'reverse' is not defined</code></p>
  
  <p>Why?</p>
  
  <p>TIA</p>
  
  <p><strong>This is a sample from my file</strong></p>
  
  <pre><code>lat, lon
  48.7082,2.2797
  48.7577,2.2188
  47.8333,2.2500
  48.9833,1.7333
  47.9333,1.9181
  46.2735,4.2586
  </code></pre>
  
  <p>**Edit **: I've amended the script a bit (see below) and I have this error </p>
  
  <pre><code>WARNING:root:Geocoding ERROR:
  </code></pre>
  
  <p><strong>the amended script</strong></p>
  
  <pre><code>#!/Users/admin/anaconda/bin/python
  
  import geocoder
  import unicodecsv
  import logging
  
  pcode=[] 
  lat=[]
  lon=[]
  
  
  with open('locs2.csv', 'rb') as f:
      reader = unicodecsv.DictReader(f, encoding='iso-8859-1')
      for line in reader:
          lat = line['lat']
          lon = line['lon']
          g = geocoder.google([lat,lon], method='reverse')
          if g.ok:
            pcode.extend(g.postal)
            logging.info('Geocoding SUCCESS: '+
  str(lat)+','+str(lon)+','+str(pcode))
          else:
            logging.warning('Geocoding ERROR: ' + str(lat)+','+str(lon))
  
  fields= 'lat', 'lon', 'pcode'
  rows=zip(lat,lon,pcode) 
  
  with open('/Users/admin/python/myfile.csv', 'wb') as outfile: 
      w =  unicodecsv.writer(outfile, encoding='iso-8859-1') 
      w.writerow(fields) 
      for i in rows: 
          w.writerow(i)
  </code></pre>