Extract house address city and zip from an address in Python
NickName:TheOne Ask DateTime:2014-08-28T22:27:09

Extract house address city and zip from an address in Python

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

More about “Extract house address city and zip from an address in Python” related questions

Extract house address city and zip from an address in Python

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 connec...

Show Detail

Split address into house#, streetname, zip5, zip4 in JMETER

I have address example: 123 Main street, City 12345-8761 how can I split the above address into House# 123, Streetname: Main street, zip5-12345, zip4-8761 and I want to store these values in a vari...

Show Detail

Extract street address from a string

Is there any way to extract a street address from a string (say, email) using python? The address does not come in a set format. It can come without state, zip code, city, but I can guess and supply

Show Detail

SQL query to get state,then city and address and zip

I'm trying to get data from database in this format: state |__city | |__address | |__zip I want all unique states and cities with all addresses and zip codes concatenated. Here's

Show Detail

Restrict Results to Full House Address with Door Number Only

I am using the Algolia Places API to autocomplete addresses that a user inputs. I have used the "complete-form" example straight from the documentation: <form action="/billing" class="form"&gt...

Show Detail

Extract City and State from a Full Address String following Specific Format

I have a set of addresses stored as individual strings. Here are possible values of those strings: "Staples Center, 555 Test Drive, Los Angeles, CA 98112" "555 Test Drive, Los Angeles, CA 98112" "...

Show Detail

Extracting ZIP code from the address line

I have a data frame which has address as one of the column, the address can sometimes contain ZIP/PIN code in it and sometimes not. Data Frame: BANK ADDRESS ...

Show Detail

Retrieving a fully qualified street address from ZIP / postal code

I have a form in which my users need to enter the following location data: Full address line (street address, apartment, suite, unit, building, floor) House number City State / province / region Z...

Show Detail

Splitting pandas address into street and house numbers

I have one dataframe with address data structured like this: tbm_a['address'] Rue de blabla 20 Vossenstraat 7 Rue Père Jean 3 boite Z Rue XSZFEFEF 331 I would like to split it in one col

Show Detail

Linkify address working on only one half of the address

The below code shows how I am getting the address from a sample JSON file: String address = ""; if(jObjIndex2.has("address")) { JSONArray jsonAddress = jObjIndex2.getJSONArray("address");

Show Detail