I have a list of US addresses I need to break into city,state, zip code,state etc.
example address : \"16100 Sand Canyon Avenue, Suite 380 Irvine, CA 92618\"
Do
Quite a few of these answers are a few years old now.
The most bulletproof library I've seen recently is usaddress
: https://github.com/datamade/usaddress:
address
which we'd been using for a year now https://pypi.python.org/pypi/address/0.1.1.Pro tip: when testing addresses in all these libraries, use 1) no commas in your address, 2) multi-word city names preferably with "St." in the name to see if the library can differentiate between "street" and "Saint" (e.g., St. Louis), and 3) improper casing. This combo will typically make even the better parsers fall down.