OccupancyType - a type of occupancy within a building, e.g.NotAddress - a non-address component that doesn’t refer to a recipient.LandmarkName - the name of a landmark, e.g.IntersectionSeparator - a conjunction connecting parts of an intersection, e.g.CornerOf - words indicating that an address is a corner, e.g.BuildingName - the name of a building, e.g.AddressNumberSuffix - a modifier after an address number, e.g ‘B’, ‘1/2’.AddressNumberPrefix - a modifier before an address number, e.g.The address components are based upon the United States Thoroughfare, Landmark, and Postal Address Data Standard, and usaddress knows about the following types of components: tag ( address, tag_mapping = ) (OrderedDict( ), 'Street Address') > import usaddress > address = 'Robie House, 5757 South Woodlawn Avenue, Chicago, IL 60637' > usaddress. You can use these attributes to write custom exception handling, for example: RepeatedLabelError has the attributes original_string (the input string) and parsed_string (the output of the parse method on the input string). When RepeatedLabelError is raised, it is likely that either (1) the input string is not a valid address, or (2) some tokens were labeled incorrectly. Box 123, Chicago, IL' ) (OrderedDict(), 'PO Box')īecause the tag method returns an OrderedDict with labels as keys, it will throw a RepeatedLabelError error when multiple areas of an address have the same label, and thus can’t be concatenated. tag ( 'State & Lake, Chicago' ) (OrderedDict(), 'Intersection') > usaddress.
tag ( 'Robie House, 5757 South Woodlawn Avenue, Chicago, IL 60637' ) (OrderedDict(), 'Street Address') > usaddress.