PHPackages                             nagoring/jp-address - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nagoring/jp-address

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nagoring/jp-address
===================

0.8(9y ago)118MITPHP

Since May 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/nagoring/jp-address)[ Packagist](https://packagist.org/packages/nagoring/jp-address)[ RSS](/packages/nagoring-jp-address/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/36deeb2f2576cb61fedd642cc169f849082454185e0e8668d71ec8946f8099cc/68747470733a2f2f706f7365722e707567782e6f72672f6e61676f72696e672f6a702d616464726573732f762f737461626c65)](https://packagist.org/packages/nagoring/jp-address)[![Total Downloads](https://camo.githubusercontent.com/f7f2444f76d00c0e2a82edd0caad0477757a7d991f619b89251be1146317b2ac/68747470733a2f2f706f7365722e707567782e6f72672f6e61676f72696e672f6a702d616464726573732f646f776e6c6f616473)](https://packagist.org/packages/nagoring/jp-address)[![Latest Unstable Version](https://camo.githubusercontent.com/b225479a8418e620dcb30757be8a4629b1b38fe38b16724e406aaffc35d5a7e4/68747470733a2f2f706f7365722e707567782e6f72672f6e61676f72696e672f6a702d616464726573732f762f756e737461626c65)](https://packagist.org/packages/nagoring/jp-address)[![License](https://camo.githubusercontent.com/ef605f9a665e54c6f2f9804d4077564b52f7a78be82ec1e163c2691a68094a41/68747470733a2f2f706f7365722e707567782e6f72672f6e61676f72696e672f6a702d616464726573732f6c6963656e7365)](https://packagist.org/packages/nagoring/jp-address)[![Monthly Downloads](https://camo.githubusercontent.com/e15261900e0692d30a0c801efc132ef11ece09f3d2489aecd79e7cb8dc9fafa8/68747470733a2f2f706f7365722e707567782e6f72672f6e61676f72696e672f6a702d616464726573732f642f6d6f6e74686c79)](https://packagist.org/packages/nagoring/jp-address)[![Daily Downloads](https://camo.githubusercontent.com/20a7a9abeb1d81e7c22d8351e2eb954ba2f1d249f213459778a4eceb7ee12d50/68747470733a2f2f706f7365722e707567782e6f72672f6e61676f72696e672f6a702d616464726573732f642f6461696c79)](https://packagist.org/packages/nagoring/jp-address)[![composer.lock](https://camo.githubusercontent.com/5967890cf352cf2a10add19111dd2e9d43b7374776cf4993a87a39a5bcc43128/68747470733a2f2f706f7365722e707567782e6f72672f6e61676f72696e672f6a702d616464726573732f636f6d706f7365726c6f636b)](https://packagist.org/packages/nagoring/jp-address)

jp-address
==========

[](#jp-address)

jp-addressとは

都道府県コードと都道府県名を相互に変換するライブラリです。

また住所名からコードを取得することもできます

コードはJIS X 0402 で定義されています。

使い方
---

[](#使い方)

```
$pref = Nago\JpAddress\Pref::getInstance();
$pref->idToName(13); // -----> 東京都
$pref->nameToId("北海道"); // -----> 1
$pref->addressToId('奈良県奈良市雑司町４０６−１'); // ----->29

$city = Nago\JpAddress\City::getInstance();
$address = "鳥取県鳥取市江津730";

//pref_idがほしい
$prefId = $pref->addressToId($address);
$this->assertSame(31, $prefId);

//city_idがほしい
$cityId = $city->prefIdAndAddressToId($prefId, $address);
$this->assertSame(31201, $cityId);

//都道府県市区を取り除いたものがほしい
$this->assertSame('江津730', $city->removePrefAndCityName($address));

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

6

Last Release

3318d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2059881?v=4)[nagomi](/maintainers/nagomi)[@nagomi](https://github.com/nagomi)

---

Top Contributors

[![nagoring](https://avatars.githubusercontent.com/u/4718266?v=4)](https://github.com/nagoring "nagoring (22 commits)")[![ryota-murakami](https://avatars.githubusercontent.com/u/5501268?v=4)](https://github.com/ryota-murakami "ryota-murakami (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nagoring-jp-address/health.svg)

```
[![Health](https://phpackages.com/badges/nagoring-jp-address/health.svg)](https://phpackages.com/packages/nagoring-jp-address)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
