Git Product home page Git Product logo

easy-ja-postal-code-generate-json's Introduction

easy-ja-postal-code-generate-json npm version

Features

  • 郵便局のサイトから最新の郵便番号データをダウンロード&json に変換
  • ファイルが 10MB 以上と重い為、郵便番号の上3桁ごとに json ファイルを分割しています。
  • 外部データではなく、自サーバーで住所データが管理できます。

Recommendation

easy-ja-postal-code-search-address
こちらのパッケージと合わせて使う事をオススメします
https://www.npmjs.com/package/easy-ja-postal-code-search-address

Data

日本郵便の全国一括版住所の csv データを使用して加工します。
https://www.post.japanpost.jp/zipcode/dl/oogaki-zip.html

Requirement

  • Node.js: v18.13.0

Usage

npx ejpc-generate-json -d "assets/json/zip" -t

このように index ファイルと頭3桁の数字のファイルが生成されます。

├── 001.json
├── 002.json
├── 003.json
〜
〜
├── 998.json
├── 999.json
├── _time.json
└── index.json
# index.json
# 頭3桁の配列

[
  "001",
  "002",
  "003",
  〜
]
# 001.json

[
  {
    "zip": "0010000",
    "prefectures": "北海道",
    "city": "札幌市北区",
    "other": ""
  },
  {
    "zip": "0010045",
    "prefectures": "北海道",
    "city": "札幌市北区",
    "other": "麻生町"
  },
  {
    "zip": "0010010",
    "prefectures": "北海道",
    "city": "札幌市北区",
    "other": "北十条西(1~4丁目)"
  },
  〜
  〜
]

option

パラメータ 説明 default
-u csv のダウンロード元の URL(基本変更の必要無し) (日本郵便の公式サイトの全国版の zip ファイル URL)
-d 生成した json の出力先ディレクトリ json/zip
-t 生成したタイムスタンプを入力した json も出力 false

Author

License

"easy-ja-postal-code-generate-json" is under MIT license.

easy-ja-postal-code-generate-json's People

Contributors

underground0930 avatar

Watchers

 avatar

Forkers

tokunakimochi

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.