PHPackages                             zerodahero/address-normalization - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zerodahero/address-normalization

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zerodahero/address-normalization
================================

Converts mailing addresses into a normalized format

3.0.1(2y ago)9114.1k↓10.5%6MITPHPPHP &gt;=8.0

Since May 29Pushed 2y agoCompare

[ Source](https://github.com/zerodahero/address-normalization)[ Packagist](https://packagist.org/packages/zerodahero/address-normalization)[ RSS](/packages/zerodahero-address-normalization/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (13)Used By (0)

Basic Address Normalizer
========================

[](#basic-address-normalizer)

[![Build Status](https://camo.githubusercontent.com/7efcb49f801d925b476210a404199450343ecb5d06af1da01c0ba401085a5457/68747470733a2f2f7472617669732d63692e6f72672f7a65726f64616865726f2f616464726573732d6e6f726d616c697a6174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zerodahero/address-normalization)

Purpose
-------

[](#purpose)

The main purpose of this package is as the first layer of address normalization and standardization. Recommended use is to pre-parse/normalize an address and compare to an existing cache/record set using the hash functions.

A way to normalize US mailing addresses without the need for an external service. This is a port of the perl module Geo::StreetAddress::US originally written by Schuyler D. Erle.

This is a fork from khartnett/address-normalization -- kudos for the original work!

Limitations
-----------

[](#limitations)

This is a very basic normalizer. It realistically only handles US-based addresses, and should not be considered dependable for strict address-to-address comparison. **This normalizer does not verify the validity of the address!** If you are dependent on *accurate* addresses, you **need** to be using some other means (3rd party service, most likely) to verify an address.

Why?
----

[](#why)

I forked and added features to this package because I needed a decent first-layer to pre-normalize addresses *before* sending them our standardization service. This helps us limit the number of calls and strict dependence on the service, but also lets us catch a few easy-to-match scenarios here and there, which is a better user experience.

Alternatives
------------

[](#alternatives)

[Libpostal](https://github.com/openvenues/libpostal) is probably the best of its class in this area. I decided not to use Libpostal because: (1) It requires a few Gbs of space, which is undesirable in my current environment, and (2) it's probably overkill, since I consider our 3rd party service to be authoritative in the matter anyway.

Installation
------------

[](#installation)

`composer require zerodahero/address-normalization`

Usage
-----

[](#usage)

### Normalizing

[](#normalizing)

```
