DenisCarriere / geocoder

:earth_asia: Python Geocoder
http://geocoder.readthedocs.org
MIT License
1.63k stars 287 forks source link

Geolytica format is inconsistent with implementation #395

Open bkuczenski opened 5 years ago

bkuczenski commented 5 years ago

Reproduce:

>>> import geocoder
>>> g = geocoder.geolytica('Winfield, BC')
...
/data/virtualenvs/lca-tools/lib/python3.7/site-packages/geocoder/geolytica.py in street(self)
 39     @property
 40     def street(self):
---> 41         return self._standard.get('staddress', '').strip()
 42 
 43     @property
AttributeError: 'dict' object has no attribute 'strip'

This is because geolytica apparently returns empty dicts for staddress and stnumber if not present, and not empty strings.

Solution: either catch the AttributeError or modify the code to meet expectations.

bkuczenski commented 5 years ago

sorry I am still learning how to do pull requests