> ## Documentation Index
> Fetch the complete documentation index at: https://villagesql.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# vsql_address_standardizer extension for MySQL

> The vsql_address_standardizer community extension parses freeform US postal addresses in MySQL into house number, street, unit, city, state, and ZIP.

A US postal address arrives as one line of freeform text, and almost every use
of it needs the parts: the house number, the street, the unit, the city, the
state, the ZIP. `vsql_address_standardizer` splits that line apart in SQL and
normalizes what it finds, so `north` becomes `N` and `new york` becomes `NY`.
It was inspired by PostgreSQL's `address_standardizer` contrib module.

|                              |                                                                                         |
| ---------------------------- | --------------------------------------------------------------------------------------- |
| **Maintainer**               | [Japheth Obala](https://github.com/jobala)                                              |
| **Source and documentation** | [jobala/vsql-address-standardizer](https://github.com/jobala/vsql-address-standardizer) |
| **License**                  | GPL-2.0                                                                                 |

<Note>
  A third party writes and maintains this extension. VillageSQL does not build,
  test, or ship it, and the description below follows the maintainer's own
  documentation. Read that documentation before you rely on it.
</Note>

## Install

Build it from the repository, then install it into the server:

```sql theme={null}
INSTALL EXTENSION vsql_address_standardizer;
```

## What it adds

| Function                       | Returns | What it does                                                                                                                                                                              |
| ------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `address_standardize(address)` | text    | The whole address, normalized and rewritten on one line                                                                                                                                   |
| `address_parse_json(address)`  | text    | The parts as a JSON object, keyed `house_number`, `pre_directional`, `street_name`, `street_suffix`, `post_directional`, `unit_designator`, `unit_identifier`, `city`, `state`, and `zip` |
| `address_field(address, name)` | text    | One named part on its own                                                                                                                                                                 |

It handles US addresses only.

## See also

* [Available extensions](/docs/mysql-8.4/dev/extensions) — the full catalog
* [jobala/vsql-address-standardizer](https://github.com/jobala/vsql-address-standardizer) — source, examples, and the known limitations
