Project

locus

0.0
No commit activity in last 3 years
No release in over 3 years
The gem uses the downloadable geonames.org database for retrieving additional information about postal codes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Locus

Build Status Code Coverage Code Climate Gem Version Dependency Status

Get information about postal codes.

Currently only 'admin code1' and 'admin name1' are looked up (1. order subdivision (state)).

Uses data files from geonames.org.

Installation

Add this line to your application's Gemfile:

gem 'locus'

Or install it yourself as:

$ gem install locus

Usage

Locus::Place.find_by_postal_code('12053', :de).state_code  # => 'BE'

A data file for DE, CH and AT is included with the gem. To update your data file:

wget http://download.geonames.org/export/zip/{DE,AT,CH}.zip
# unzip ...
rake locus:import:zip[postal_codes.yml,"DE.txt CH.txt AT.txt"]`

Tell the gem to use your updated data file:

Locus.zip_path = '/path/to/updated/postal_codes.yml'

Changes

0.2.x

  • format of data file changed. Use the new provided file or update yours using the rake task

Contributing

Awesome :-)