Metadata-Version: 2.1
Name: jp-prefecture
Version: 0.1.3
Summary: Simple utilitiy convert name of japanese prefectures
Home-page: https://github.com/iisaka51/jp_prefecture
Author: iisaka51
Author-email: iisaka51@gmail.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Description-Content-Type: text/markdown
License-File: LICENSE

# jp_prefecture.
> Japan prefecture names and codes

Simple utility to convert the name of japanese prefectures.

- full_name from/to code (JIS X 0401-1973).
- short_name to full_name
- alphabet_name from/to full_name

Reference

- [JIS X 0401 JSON API](https://madefor.github.io/jisx0401/)

## Install

`pip install jp_prefecture`

## How to use

```python
from jp_prefecture import jp_prefectures as jp
```

### Conversion

```python
assert ( jp.name2code("京都府")
         == jp.name2code("京都")
         == jp.name2code("Kyoto")
         == jp.name2code("KYOTO")
         == jp.name2code("kyoto")
         == 26 )

assert jp.code2name(26) == "京都府"

assert jp.code2alphabet(26) == "Kyoto"

assert ( jp.name2code("京都府")
         == jp.name2code("京都")
         == "Kyoto" )

assert ( jp.alphabet2name("Kyoto")
         == jp.name2code("KYOTO")
         == jp.name2code("kyoto")
         == "京都府" )

```
