# JpPrefecture

日本の都道府県データを検索できる Elixir ライブラリです。

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `jp_prefecture` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:jp_prefecture, "~> 0.1.0"}
  ]
end
```

## Basic Usage

```elixir
# すべての都道府県を取得
JpPrefecture.all()

# ID から取得
JpPrefecture.find(13)
JpPrefecture.find(code: 13)

# 日本語名または英語名から取得
JpPrefecture.find(name: "東京")
JpPrefecture.find(name: "tokyo")

# 地域から検索
JpPrefecture.where(area: "関東")

# 都道府県名から検索（部分一致）
JpPrefecture.where(name: "東京")
JpPrefecture.where(name: "tok")

# ID のリストから検索
JpPrefecture.where(id: [1, 13, 47])
```

`find(name: ...)` は一致した最初の都道府県を返し、該当しない場合は `nil` を返します。`where(...)` は一致した都道府県をリストで返します。

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at <https://hexdocs.pm/jp_prefecture>.
