I am trying to make the common "Postal code to part of address" feature in Japanese website.
So this program will remove meta info like "その他" or "次のビルを除く" ... etc
This is a hobby project and still in development
Add this line to your Gemfile
gem "japan_postal_code", github: "joshua5201/japan_postal_code"
Please download csv file from Japan Post's Website
example:
require 'japan_postal_code'
finder = JapanPostalCode::AddressFinder(filename: "data/02AOMORI.CSV")
=> #<JapanPostalCode::AddressFinder mode: csv, config: {:filename=>"data/02AOMORI.CSV"}>
finder.query("0380211")
=> #<JapanPostalCode::PostalArea:0x00005640b5152ad8 @jis_area_code="02362", @old_code="03802", @code="0380211", @prefecture_kana="アオモリケン", @city_kana="ミナミツガルグンオオワニマチ", @area_kana="オオワニ", @prefecture="青森県", @city="南津軽郡大鰐町", @area="大鰐", @has_multiple_code=false, @has_koaza=true, @has_block_number=false, @has_multiple_block=false>
- Export to SQL Insert statements
- Export diffential csv to SQL (Update data)
- Export to JSON
- Export only desired parts (e.g. by prefecture/city/area)
- Query with database
The gem is available as open source under the terms of the MIT License.