How to return individual address components (city, state, etc.) from GeoPy geocoder?

المشرف العام

Administrator
طاقم الإدارة
I'm using GeoPy to geocode addresses to lat,lng. I would also like to extract the itemized address components (street, city, state, zip) for each address.

GeoPy returns a string with the address -- but I can't find a reliable way to separate each component. For example:

{street: '123 Main Street', city: 'Los Angeles', state: 'CA', zip: 90034, country: 'USA'}The Google geocoding API does return these individual components... is there a way to get these from GeoPy? (or a different geocoding tool?)



أكثر...
 
أعلى