Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kalessin/japanese-address
Japanese Address Parser
https://github.com/kalessin/japanese-address
Last synced: 10 days ago
JSON representation
Japanese Address Parser
- Host: GitHub
- URL: https://github.com/kalessin/japanese-address
- Owner: kalessin
- License: bsd-3-clause
- Created: 2018-12-22T14:25:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-22T12:08:09.000Z (12 months ago)
- Last Synced: 2024-04-24T13:28:14.010Z (7 months ago)
- Language: Python
- Size: 174 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A Japanese addresses parser
# Install instructions
pip install japanese-address
# Usage
```python
> from japanese_address import parse
> parse('北海道 札幌市 中央区北5条西4-7')
{'prefecture': '北海道',
'prefecture_eng': 'Hokkaido',
'unparsed_right': '北5条西4-7',
'city': '札幌市',
'city_eng': 'Sapporo',
'ward': '中央区',
'ward_eng': 'Chūō'}
> parse('東京都江東区豊洲2丁目4-9')
{'prefecture': '東京都',
'prefecture_eng': 'Tokyo',
'unparsed_right': '4-9',
'ward': '江東区',
'ward_eng': 'Kōtō',
'city_district': '豊洲2丁目'}
```# Data source
The following Wikipedia pages are used to gather data used to parse Japanese
addresses:* [List of cities in Japan](https://en.wikipedia.org/wiki/List_of_cities_in_Japan)
* [List of towns in Japan](https://en.wikipedia.org/wiki/List_of_towns_in_Japan)
* [Wards in Japan](https://en.wikipedia.org/wiki/Wards_of_Japan)To upgrade the data, use the following command:
```bash
$ python dataloader.py
```If everything goes fine, the files `data/cities.py`, `data/towns.py` and `data/wards.py`
will be updated with the latest content available at the mentioned pages. Commit
them to the repository and create a new release.