Skip to main content

Japanese address parser

Project description

A Japanese addresses parser

Install instructions

pip install japanese-address

Usage

> 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:

To upgrade the data, use the following command:

$ 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

japanese-address-0.2.tar.gz (22.3 kB view hashes)

Uploaded Source

Built Distribution

japanese_address-0.2-py3-none-any.whl (23.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page