Project

zipcode-fr

0.0
No commit activity in last 3 years
No release in over 3 years
Query city information by zip code and city name, indexed by word prefixes.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.10
>= 0
~> 12.1
~> 0.50.0

Runtime

 Project Readme

zipcode-fr

Find french city data by zip code and name.

Build Status

Usage

require 'zipcode-fr'

# use it directly
z = ZipCode::FR.new
z.load                         # builds memory-backed global index

z.search(:zip, '50000')        # exact zip code search
z.search(:zip, '50')           # prefixes work
z.search(:name, 'VERSAILLES')  # search by name
z.search(:name, 'BORD')        # prefixes work
z.search(:name, 'MARIE')       # prefixes work on inner words

# use it through ZipCode::DB
ZipCode::DB.for(:fr).load
ZipCode::DB.for(:fr).search(:zip, '50000')

Main fields are:

  • :name: normalised name without diacritics nor symbols
  • :zip: zip code, as used by postal service

Extra fields are provided:

  • :insee: INSEE code
  • :alt_name: alternative name used internally by postal service delivery

Data source

Data is downloaded from officially vetted source:

License

MIT