I have variable address strings such as this:
1234 Maple Ave. Queens, NY 11011
This format varies from string to string so I can use simple string parsing/splitting.
Is there any way I can connect to google maps or some other api that will look up the address and give me all the address units separately?
Ideally I should be able to do something like:
>> address = "1234 Maple Ave. Queens, NY 11011"
>> data = maps_api.extract_data(address)
>> print data.house_number
>> 1234 Maple Ave.
>> print data.city
>> Queens
>> print data.state
>> NY
>> print data.zip
>> 11011
Copyright Notice:Content Author:「TheOne」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/25551301/extract-house-address-city-and-zip-from-an-address-in-python