zip-code-info

This gem returns the state and city of the Sectional Center Facility for a given zip code. It does not use an external service.

The zip code data has been taken from en.wikipedia.org/wiki/ZIP_code_prefixes

Usage

In your Gemfile

gem zip-code-info

The code runs out of a Singleton class. Right now you can call these two methods.

ZipCodeInfo.instance.state_for “99163” #=> WA

ZipCodeInfo.instance.scf_city_for “99163” #=> Spokane

Limitations

  • The city returned is the city where the USPS Sectional Center Facility (SCF) is located.

  • Sometimes the state that a zip code is bound to for USPS is different from the actual state the zip code is in. There are plans to provide both states.

TODO

  • Ability to return the timezone information from a zip code.

  • Provide the USPS state as well as the actual state (see limitations).

Contributing to zip-code-info

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Monica Olinescu. See LICENSE.txt for further details.