{"id":36618153,"url":"https://github.com/naotsugu/jpostal","last_synced_at":"2026-01-29T16:06:53.547Z","repository":{"id":57726424,"uuid":"238463763","full_name":"naotsugu/jpostal","owner":"naotsugu","description":"Japan postal code dictionary(so‐called ken_all.csv) utility.","archived":false,"fork":false,"pushed_at":"2025-11-03T13:18:37.000Z","size":587,"stargazers_count":18,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T16:56:47.772Z","etag":null,"topics":["java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naotsugu.png","metadata":{"files":{"readme":"README.ja.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-05T14:02:08.000Z","updated_at":"2025-11-03T13:18:41.000Z","dependencies_parsed_at":"2025-03-04T12:21:16.029Z","dependency_job_id":"a32b3aeb-c65b-4a01-bb50-8f6cd82f5164","html_url":"https://github.com/naotsugu/jpostal","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/naotsugu/jpostal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naotsugu%2Fjpostal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naotsugu%2Fjpostal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naotsugu%2Fjpostal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naotsugu%2Fjpostal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naotsugu","download_url":"https://codeload.github.com/naotsugu/jpostal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naotsugu%2Fjpostal/sbom","scorecard":{"id":674319,"data":{"date":"2025-08-11","repo":{"name":"github.com/naotsugu/jpostal","commit":"0e3d01aa7fcd4dc436455b61139ec1e3fb04014e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/gradle-build.yml:10","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":3,"reason":"4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gradle-build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/naotsugu/jpostal/gradle-build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gradle-build.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/naotsugu/jpostal/gradle-build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gradle-build.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/naotsugu/jpostal/gradle-build.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/naotsugu/jpostal/releases/23907216","Warn: release artifact v0.1.0 not signed: https://api.github.com/repos/naotsugu/jpostal/releases/23704668","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/naotsugu/jpostal/releases/23907216","Warn: release artifact v0.1.0 does not have provenance: https://api.github.com/repos/naotsugu/jpostal/releases/23704668"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T21:03:35.494Z","repository_id":57726424,"created_at":"2025-08-21T21:03:35.494Z","updated_at":"2025-08-21T21:03:35.494Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28880928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java"],"created_at":"2026-01-12T09:15:25.470Z","updated_at":"2026-01-29T16:06:53.534Z","avatar_url":"https://github.com/naotsugu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/naotsugu/jpostal/actions/workflows/gradle-build.yml/badge.svg)](https://github.com/naotsugu/jpostal/actions/workflows/gradle-build.yml)\n\n\n# JPostal\n\n郵便番号辞書(いわゆる ken_all.csv)のユーティリティです.\n\n![jpostal](doc/images/search.gif)\n\n\u003cbr/\u003e\n\n## Feature\n\n* japanpost.jp から辞書 csv を自動ダウンロード\n* 辞書データは以下を選択可能\n  * 「住所の郵便番号（1レコード1行、UTF-8形式）（CSV形式）」(`utf_all.csv`)\n  * 「読み仮名データの促音・拗音を小書きで表記するもの」(`ken_all.zip`)\n  * 「事業所の個別郵便番号」(`jigyosyo.zip`)\n* 住所情報の整形\n* 辞書の自動アップデート(月次)\n* REST web サーバ付属 \n* CSV 出力\n* 依存ライブラリ無し\n\n\u003cbr/\u003e\n\n## Usage\n\n以下の依存を追加します.\n\n```groovy\ndependencies {\n    implementation 'com.mammb:jpostal:0.5.1'\n}\n```\n\n`Postal` を生成して初期化します.\n\n```java\nPostal postal = Postal.of();\npostal.initialize();\n```\n\n生成したインスタンスに郵便番号のクエリを渡すことで、候補の郵便番号と住所が取得できます.\n\n```java\nString code = \"105001\";\nCollection\u003cAddress\u003e addresses = postal.get(code);\n//[{\"code\": \"1050011\", \"prefecture\": \"東京都\", \"city\": \"港区\", \"town\": \"芝公園\", \"street\": \"\"},\n// {\"code\": \"1050012\", \"prefecture\": \"東京都\", \"city\": \"港区\", \"town\": \"芝大門\", \"street\": \"\"},\n// {\"code\": \"1050013\", \"prefecture\": \"東京都\", \"city\": \"港区\", \"town\": \"浜松町\", \"street\": \"\"}, \n// {\"code\": \"1050014\", \"prefecture\": \"東京都\", \"city\": \"港区\", \"town\": \"芝\", \"street\": \"\"}]\n```\n\n\u003cbr/\u003e\n\n## CSV file\n\n整形済みのCSVファイルを出力することができます.\n\n`-o` オプションで出力ファイル名を指定します。\n\n```\n$ java -jar jpostal-0.5.0.jar -o out.csv\n```\n\n`郵便番号,地方公共団体コード,都道府県名,市区町村名,町域名` の並びのCSVファイルを出力します。\n\n\n\u003cbr/\u003e\n\n## PostalServer\n\nREST サーバが必要な場合は jpostal.jar を実行します.\n\n\n直接ビルドして実行するか、`https://github.com/naotsugu/jpostal/releases` から `jpostal.jar` をダウンロードして実行します.\n\n```\n$ git clone https://github.com/naotsugu/jpostal.git\n$ cd jpostal\n$ ./gradlew jar\n$ java -jar build/libs/jpostal-0.5.0.jar\n```\n\nまたは、`PostalServer` を使います. \n\n\n```java\nPostalServer server = PostalServer.of(postal);\nserver.start();\n```\n\n`http://localhost:8080/postal/105001` のようにアクセスすることで json フォーマットで結果を取得することができます.\n\n`http://localhost:8080/postal/console.html` にアクセスすれば簡易的な住所チェック用のコンソールが表示されます.\n\n\u003cbr/\u003e\n\n## Options\n\n以下のオプションがあります.\n\n```java\nPostal postal = Postal.of()\n    .useLegacySource(false)\n    .fineAddressSupport(true)\n    .leftMatchSupport(true)\n    .leftMatchLimitCount(20)\n    .officeSourceSupport(false)\n    .autoUpdateSupport(true);\n```\n\n\n| Option                 | Default | Description                                                                                         |\n| ---------------------- |---------|-----------------------------------------------------------------------------------------------------|\n| `useLegacySource`   | `false` | 2023年6月から提供開始された、1レコード1行、UTF-8形式ファイルを使用するか、旧来形式ファイルを使用するかを指定します。`true` とした場合、旧来形式のファイルをソースとして使用します。 |\n| `fineAddressSupport`   | `true`  | 詳細な住所加工を行うかどうかを指定します                                                                                |\n| `leftMatchSupport`     | `true`  | 住所の前方一致検索を有効にします                                                                                    |\n| `leftMatchLimitCount`  | `20`    | 前方一致検索時の検索結果数を指定します                                                                                 |\n| `officeSourceSupport`  | `false` | 事業所の個別郵便番号をサポートするかどうかを指定します                                                                         |\n| `autoUpdateSupport`    | `false` | 郵便番号辞書の自動更新を有効にするかどうかを指定します                                                                         |\n\n\u003cbr/\u003e\n\n## Details\n\n### 辞書のダウンロード\n\n`jpostal.jar` 実行時のディレクトリに `ken_all.zip` または `utf_all.csv` が存在する場合は、このファイルを利用します。\n\nファイルが存在しない場合は、日本郵政の辞書ファイルを自動でダウンロードします.\nダウンロードしたファイルは `jpostal.jar` 実行時のディレクトリにダウンロードされるため、次回起動時にはこのファイルを使うようになります.\n\nダウンロードするファイルは「住所の郵便番号（1レコード1行、UTF-8形式）（CSV形式）」です。\n`useLegacySource` に `true` を指定した場合には「読み仮名データの促音・拗音を小書きで表記するもの」の全国版を使用します.\n\nオプションで `officeSourceSupport` が有効化されていた場合は「事業所の個別郵便番号」`jigyosyo.zip` を加えて扱います.\n\n\n### 辞書の更新\n\n郵政郵便番号は月末に更新分が公開されます。\n\n`autoUpdateSupport` を有効にすることで月初(0時〜1時の間のランダムな時刻)に自動更新されます。 \n\n\n### 郵便番号のマッチモード\n\n`leftMatchSupport` を有効にした場合、前方一致で郵便番号を検索します.\n`leftMatchSupport` を無効にした場合は完全一致検索となります.\n\n前方一致検索で取得する結果件数は `leftMatchLimitCount` で指定します.\n\n\n### 住所情報の整形\n\n日本郵政の公開する郵便番号辞書はシステムでそのまま利用できる代物ではないため、各種の整形処理を行っています.\n\n複数行に分割されたレコードを合成した後、[`com.mammb.code.jpostal.source.TownEditor`](src/main/java/com/mammb/code/jpostal/source/TownEditor.java) にある変換処理を行います.\n\n\n例えば以下のようなレコードは、\n\n```\n\"0580343\",..,\"北海道\",\"幌泉郡えりも町\",\"東洋（油駒、南東洋、１３２～１５６、１５８～３５４、３６６、３６７番地）\"\n```\n\n以下のような住所情報として整形します.\n\n```\n\"0580343\",..,\"北海道\",\"幌泉郡えりも町\",\"東洋\",\"油駒\"\n\"0580343\",..,\"北海道\",\"幌泉郡えりも町\",\"東洋\",\"南東洋\"\n\"0580343\",..,\"北海道\",\"幌泉郡えりも町\",\"東洋\",\"３６６番地\"\n\"0580343\",..,\"北海道\",\"幌泉郡えりも町\",\"東洋\",\"３６７番地\"\n\"0580343\",..,\"北海道\",\"幌泉郡えりも町\",\"東洋\",\"\"\n```\n\n`fineAddressSupport` オプションを無効にした場合は以下のように編集されます.\n\n```\n\"0580343\",..,\"北海道\",\"幌泉郡えりも町\",\"東洋\",\"\"\n```\n\nなお、「事業所の個別郵便番号」については住所情報の編集は行いません.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaotsugu%2Fjpostal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaotsugu%2Fjpostal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaotsugu%2Fjpostal/lists"}