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.
- Address Parsing: Uses libpostal to split addresses into components.
- Web API: Exposes a
POST /parseendpoint 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.
- Rust: Latest stable version (install Rust)
- libpostal: Ensure libpostal is installed on your system. See the libpostal installation guide.
-
Clone the repository:
git clone https://github.com/wgd-modular/parsezilla.git cd parsezilla -
Build the project:
cargo build --release
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_keyBy 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 8080When the server starts, you'll see a colorful log message, for example:
🦖 Parsezilla is roaring at http://0.0.0.0:8080
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"}
]This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for bug fixes or improvements.
Happy parsing with Parsezilla! 🦖