From 6621408e6df29a99908ecd19ba6c2636a4d7b05b Mon Sep 17 00:00:00 2001 From: Fable Turas Date: Thu, 29 Aug 2019 09:28:09 -0700 Subject: [PATCH] Update README.rst --- README.rst | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 66172a0..9482357 100644 --- a/README.rst +++ b/README.rst @@ -17,9 +17,32 @@ Use to standardize your addresses. (Note: usaddress-scourgify does not make any attempts at address validation.) -Both functions take an address string, or a dict-like object, and return an address dict with all field values in uppercase format mapped to the keys address_line_1, address_line_2, city, state, postal_code. +Both functions take an address string, or a dict-like object, and return an address dict with all field values in uppercase format mapped to the keys address_line_1, address_line_2, city, state, postal_code... code-block:: python +.. code-block:: python + + normalize_address_record('123 southwest Main street, Boring, or, 97203') + + normalize_address_record({ + 'address_line_1': '123 southwest Main street', + 'address_line_2': 'unit 2' + 'city': 'Boring', + 'state': 'or', + 'postal_code': '97203' + }) + + +expected output + +``{ + 'address_line_1': '123 SW MAIN ST', + 'address_line_2': 'UNIT 2' + 'city': 'BORING', + 'state': 'OR', + 'postal_code': '97203' + }``` + normalized_address_record() uses the included processing functions to remove unacceptable special characters, extra spaces, predictable abnormal character sub-strings and phrases. It also abbreviates directional indicators and street types according to the abbreviation mappings found in address_constants. If applicable, line 2 address elements (ie: Apt, Unit) are separated from line 1 inputs and standard occupancy type abbreviations are applied. You may supply additional additional processing functions as a list of callable supplied to the addtl_funcs parameter. Any additional functions should take a string address and return a tuple of strings (line1, line2).