#parser

japanese-address-parser

A Rust Library to parse japanese addresses

28 releases

new 0.1.0 May 16, 2024
0.1.0-beta.18 May 5, 2024
0.1.0-beta.17 Apr 28, 2024
0.1.0-beta.11 Mar 31, 2024
0.1.0-alpha.2 Nov 30, 2023

#50 in Geospatial

Download history 3/week @ 2024-01-29 23/week @ 2024-02-12 11/week @ 2024-02-19 132/week @ 2024-02-26 31/week @ 2024-03-04 30/week @ 2024-03-11 123/week @ 2024-03-18 117/week @ 2024-03-25 129/week @ 2024-04-01 159/week @ 2024-04-08 298/week @ 2024-04-15 288/week @ 2024-04-22 182/week @ 2024-04-29 56/week @ 2024-05-06

829 downloads per month

MIT license

75KB
1.5K SLoC

japanese-address-parser

Docs Crates.io (latest) Rust Version Unit test & Code check

A Rust Library to parse japanese addresses.

Usage

Add this to your Cargo.toml

cargo add japanese-address-parser
# or
cargo add japanese-address-parser -F blocking

Async Version

use japanese_address_parser::parser::Parser;

#[tokio::main]
async fn main() {
    let parser: Parser = Default::default();
    let parse_result = parser.parse("東京都千代田区丸の内1-1-1").await;
    println!("{:?}", parse_result);
}

Blocking Version

use japanese_address_parser::parser::Parser;

fn main() {
    let parser: Parser = Default::default();
    let parse_result = parser.parse_blocking("東京都千代田区丸の内1-1-1"); // `parse_blocking()` is available on `blocking` feature only
    println!("{:?}", parse_result);
}

Wasm support

npmjs

This crate is designed to be buildable for wasm32-unknown-unknown with wasm-pack. Pre-compiled wasm module is available npmjs.com

npm install @toriyama/japanese-address-parser
import init, {Parser} from "@toriyama/japanese-address-parser"

init().then(() => {
    const parser = new Parser()
    parser.parse("東京都千代田区丸の内1-1-1").then(parseResult => {
        console.log(JSON.stringify(parseResult, null, "\t"))
    })
})

Python support(experimental)

PyPI - Version

This library can be called from Python world. For more detail, see python module's README.

Road to v1

The goals that this library aims to achieve are below.

  • Supports not only wasm target but also various platforms and architectures.
  • Enables more advanced normalization. For example, provides more detailed analysis than town level.
  • Provides latlng of the given address.
  • Enables processing of town names that have ceased to exist as a result of municipal mergers.

Support

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

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.

Dependencies

~9–22MB
~336K SLoC