Giter VIP home page Giter VIP logo

jipcode's Introduction

Build Status

Jipcode

Jipcodeは郵便番号から住所を検索する機能を提供します。 郵便番号と対応する住所のデータは日本郵便の公式サイトで配布されているものを用いています。

Installation

Add this line to your application's Gemfile:

gem 'jipcode'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install jipcode

Usage

検索

郵便番号は1個の番号につき複数の住所が結びつくことがあります。 そのため次のように検索結果は住所情報を含むHashの配列で返ります。 このHashは郵便番号(:zipcode)、都道府県(:prefecture)、市区町村(:city)、町域番地(:town)の値を持ちます。

Jipcode.locate('1510051')
# => [{zipcode: '1510051', prefecture: '東京都', city: '渋谷区', town: '千駄ヶ谷'}]

都道府県コード

次のようにオプションで都道府県コードを検索結果に含めることもできます。

Jipcode.locate('1510051', prefecture_code: true)
# => [{:zipcode=>"1510051", :prefecture=>"東京都", :city=>"渋谷区", :town=>"千駄ヶ谷", :prefecture_code=>13}]

更新

日本郵便の郵便番号データは月末に更新されています。 jipcodeではこれを毎月取り込んでいます。

更新を反映したい時はbundle update jipcodeしてください。

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Jipcode project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

jipcode's People

Contributors

pione30 avatar rinkei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.