#parser

japanese-address-parser

A Rust Library to parse japanese addresses

25 releases

new 0.1.0-beta.16 Apr 28, 2024
0.1.0-beta.15 Apr 21, 2024
0.1.0-beta.11 Mar 31, 2024
0.1.0-beta.8 Feb 12, 2024
0.1.0-alpha.2 Nov 30, 2023

#57 in Geospatial

Download history 10/week @ 2024-01-06 1/week @ 2024-01-13 9/week @ 2024-01-20 3/week @ 2024-02-03 20/week @ 2024-02-10 11/week @ 2024-02-17 15/week @ 2024-02-24 139/week @ 2024-03-02 37/week @ 2024-03-09 98/week @ 2024-03-16 30/week @ 2024-03-23 165/week @ 2024-03-30 228/week @ 2024-04-06 15/week @ 2024-04-13 323/week @ 2024-04-20

731 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

Async Version

use japanese_address_parser::parser::Parser;

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

Blocking Version

use japanese_address_parser::api::{BlockingApi, BlockingApiImpl};
use japanese_address_parser::parser::parse_blocking;

fn main() {
    let blocking_api = BlockingApiImpl::new();
    let parse_result = parse_blocking(blocking_api, "東京都千代田区丸の内1-1-1");
    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.

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
~332K SLoC