Postie is a very simple interface for auspostie.com, which is an API for Australian Suburb/Postcode data. It provides a class for searching the service, as well as a CLI tool that does the job as well.
sudo gem install postie
For the CLI tool:
Or, within code:
require 'postie' Postie::Locality.find("Wentworth")
A call to
Locality#find (with either a suburb or postcode) returns an array of Locality objects, with attributes
comments. Just like auspostie.com, if you enter a suburb, it’ll use a partial search (so ‘Melbourne’ will return ‘North Melbourne’), but when using a postcode, the search is exact.
This code is free to use under the terms of the MIT license.
Comments, suggestions and patches are welcome. Send an email to pat at freelancing-gods dot com.