SnailMailAddressParser

A Javascript/Coffeescript library to parse address strings into their constituent elements

Download as .zip Download as .tar.gz View on GitHub

Try it out!

A few addresses in Canada will work at the moment, but with luck we'll have quite a few more soon.

Sample address Output


Address not working?

File an issue over on Github. Ideally if you format the address in YAML along the following lines we can plug it right into the unit tests:
- given: |
    100 Bay Street
    Toronto, ON M5H 1T1 
  expect:
    municipality: Toronto
    province: ON
    postal: M5H 1T1
    country: Canada
    street_number: 100
    street_name: Bay Street
    street_name_2: 
    addressee: 
    suite: 

Of course please do not hesitate to submit any other suggestions or pull requests.


Using version: