Я знаю, что это старый пост, но кто-то может найти его полезным:
https://usaddress.readthedocs.io/en/latest/
>>> import usaddress
>>> usaddress.parse('Robie House, 5757 South Woodlawn Avenue, Chicago, IL 60637')
[('Robie', 'BuildingName'),
('House,', 'BuildingName'),
('5757', 'AddressNumber'),
('South', 'StreetNamePreDirectional'),
('Woodlawn', 'StreetName'),
('Avenue,', 'StreetNamePostType'),
('Chicago,', 'PlaceName'),
('IL', 'StateName'),
('60637', 'ZipCode')]
Или:
>>> import usaddress
>>> usaddress.tag('Robie House, 5757 South Woodlawn Avenue, Chicago, IL 60637')
(OrderedDict([
('BuildingName', 'Robie House'),
('AddressNumber', '5757'),
('StreetNamePreDirectional', 'South'),
('StreetName', 'Woodlawn'),
('StreetNamePostType', 'Avenue'),
('PlaceName', 'Chicago'),
('StateName', 'IL'),
('ZipCode', '60637')]),
'Street Address')
>>> usaddress.tag('State & Lake, Chicago')
(OrderedDict([
('StreetName', 'State'),
('IntersectionSeparator', '&'),
('SecondStreetName', 'Lake'),
('PlaceName', 'Chicago')]),
'Intersection')
>>> usaddress.tag('P.O. Box 123, Chicago, IL')
(OrderedDict([
('USPSBoxType', 'P.O. Box'),
('USPSBoxID', '123'),
('PlaceName', 'Chicago'),
('StateName', 'IL')]),
'PO Box')