Skip to main content

A Rust Library to parse japanese addresses.

Project description

japanese-address-parser-py

A python toolkit for processing japanese addresses

PyPI - Version PyPI - Downloads Unit test & Code check

What is it?

japanese-address-parser-py is a Python package for parsing japanese addresses. Any address can be processed into structured data.

Installation from PyPI

pip install japanese-address-parser-py

Usage

from japanese_address_parser_py import Parser

address_list = [
    "埼玉県さいたま市浦和区高砂3-15-1",
    "千葉県千葉市中央区市場町1-1",
    "東京都新宿区西新宿2-8-1",
    "神奈川県横浜市中区日本大通1"
]
parser = Parser()
for address in address_list:
    parse_result = parser.parse(address)
    print(parse_result.address)
{'prefecture': '埼玉県', 'town': '高砂三丁目', 'rest': '15-1', 'city': 'さいたま市浦和区'}
{'rest': '1-1', 'town': '市場町', 'prefecture': '千葉県', 'city': '千葉市中央区'}
{'prefecture': '東京都', 'rest': '8-1', 'town': '西新宿二丁目', 'city': '新宿区'}
{'town': '日本大通', 'city': '横浜市中区', 'prefecture': '神奈川県', 'rest': '1'}
from japanese_address_parser_py import Parser

parser = Parser()
address = "神奈川県横浜市中区本町6丁目50-10"
parse_result = parser.parse(address)
print(parse_result.address["prefecture"])
print(parse_result.address["city"])
print(parse_result.address["town"])
print(parse_result.address["rest"])
神奈川県
横浜市中区
本町六丁目
50-10

Development

This library is written in Rust language. You need to set up a Rust development environment to build this library. Also, you need to install maturin because this library uses it in order to generate Python bindings.

# Install maturin
cargo install --locked maturin
# Clone repository
git clone https://github.com/YuukiToriyama/japanese-address-parser.git
# Build python module
cd japanse-address-parser/python
maturin build --release --out dist --find-interpreter
# Install the built library
python3 -m venv .venv
pip3 install dist/japanese_address_parser_py-[version]-cp37-abi3-[arch].whl

Support

This software is maintained by YuukiToriyama. If you have questions, please create an issue.

Where to get source code

The source code is hosted on GitHub at: https://github.com/YuukiToriyama/japanese-address-parser

Acknowledgements

This software was developed inspired by @geolonia/normalize-japanese-addresses.
Also, the parsing process uses Geolonia 住所データ provided by 株式会社Geolonia.

License

This crate is distributed under the terms of the MIT license.

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_parser_py-0.1.0b18.tar.gz (29.5 kB view hashes)

Uploaded Source

Built Distributions

japanese_address_parser_py-0.1.0b18-cp37-abi3-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.7+ Windows x86-64

japanese_address_parser_py-0.1.0b18-cp37-abi3-win32.whl (1.8 MB view hashes)

Uploaded CPython 3.7+ Windows x86

japanese_address_parser_py-0.1.0b18-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

japanese_address_parser_py-0.1.0b18-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (4.1 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

japanese_address_parser_py-0.1.0b18-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (3.8 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

japanese_address_parser_py-0.1.0b18-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (3.6 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ i686

japanese_address_parser_py-0.1.0b18-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.6 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

japanese_address_parser_py-0.1.0b18-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

japanese_address_parser_py-0.1.0b18-cp37-abi3-macosx_11_0_arm64.whl (2.3 MB view hashes)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

japanese_address_parser_py-0.1.0b18-cp37-abi3-macosx_10_12_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

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