Skip to content

Problem with address_constants.yaml #36

@nickpalmer2012

Description

@nickpalmer2012

First of all, this library has been a godsend for a project I am working on at work.

I am having issues trying to set up an address_constants.yaml file to handle special cases I am running into.

I am running into special cases where the normalize_address_record(longhand=True) method returns a KeyError.

This is one such case:
Address to be normalized: 3700 US Highway 51, La Place, LA 70068
Result from normalize_address_record(longhand=True): KeyError: 'US HIGHWAY'**
**see full error message in attached .txt file
key_error.txt

This is how my address_constants.yaml file looks right now:

insertion_method: update

STREET_TYPE_ABBREVIATIONS:
    'US Highway ': 'US-'

I just want the address_line_1 to show up as 3700 US-51

What am I doing wrong to handle this special case?

I am working in a jupyter notebook right now. I set the environment variable according to the readme. I used magic commands to set the ADDRESS_CONFIG_DIR environment variable with the magic command %env method. I can confirm that the variable with the file path successfully appear when I print the environment variables within the jupyter notebook.

For context, my project involves comparing street addresses for client facilities scraped from a webpage and comparing that address to the street address that we have on file. I was running into an issue where, for example Your library's longhand method fixes problem where addresses were being flagged when the only difference was street abbreviations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions