send_the_raven.address.Addresses#
- class send_the_raven.address.Addresses[source]#
Bases:
object
Represents a list of addresses.
- Parameters:
addresses (iterable) – iterable of any to construct Address object.
field_mapping (dict) – A dictionary of field names to be used when constructing the Address objects. The default is
DEFAULT_ADDRESS_MAPPING
. The dict’s keys areAddress
’s attributes. The dict’s values are the key in the input addresses.
- field_mapping#
A dictionary of field names to be used when constructing the Address objects.
- Type:
Example
>>> data = [{'street address': '12 main st', 'city': boston}, {'street address': '14 main st', 'city': boston}] >>> field_mapper = {'street': 'street address'} >>> addresses = Addresses(data, field_mapper)
- __init__(addresses, field_mapping={'address_line_2': 'address_line_2', 'city': 'city', 'full_address': 'full_address', 'id': 'id', 'state': 'state', 'street': 'street', 'zip_code': 'zip_code'})[source]#
- __call__(**kwargs)#
Call self as a function.
Methods
__eq__
(value, /)Return self==value.
__getitem__
(index)__init__
(addresses[, field_mapping])__iter__
()__len__
()normalize_parallel
([number_of_proccesses])Normalize all addresses in parallel.