Skip to content

wgd-modular/parsezilla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parsezilla 🦖

Parsezilla is a Rust-based address parsing API that leverages libpostal via Rust bindings. It exposes an HTTP endpoint to parse addresses into structured components. Built with Actix-Web for asynchronous performance, Parsezilla also supports customizable bind addresses and ports through CLI options.

Features

  • Address Parsing: Uses libpostal to split addresses into components.
  • Web API: Exposes a POST /parse endpoint accepting JSON with an address.
  • Auto-Capitalization: Capitalizes parsed address components.
  • Configurable Bind & Port: Easily configure the host and port via CLI.
  • Rust-Powered: Built with Actix-Web, Clap, and Colored for a robust experience.

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/wgd-modular/parsezilla.git
    cd parsezilla
  2. Build the project:

    cargo build --release

Usage

Running the Server

For production, the API key is loaded from the PARSEZILLA_API_KEY environment variable. Make sure to set it before running the server:

export PARSEZILLA_API_KEY=my_secret_api_key

By default, the server binds to 127.0.0.1:8080. You can customize the bind address and port via CLI arguments:

cargo run -- --bind 0.0.0.0 --port 8080

When the server starts, you'll see a colorful log message, for example:

🦖 Parsezilla is roaring at http://0.0.0.0:8080

Testing the API

Send a POST request to the /parse endpoint with a JSON payload containing the address. For example, using curl:

curl -X POST http://localhost:8080/parse -H "Content-Type: application/json" -H "x-api-key: my_secret_api_key" -d '{"address": "Apt 4 18 Downey Street, 95926 Chico"}'

Expected response:

[
  {"component": "unit", "value": "Apt 4"},
  {"component": "road", "value": "Downey Street"},
  {"component": "house_number", "value": "18"},
  {"component": "postcode", "value": "95926"},
  {"component": "city", "value": "Chico"}
]

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for bug fixes or improvements.

Happy parsing with Parsezilla! 🦖

About

Parsezilla is a Rust-based address parsing API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages