@staticmethod
def _feature_to_record(feature, key_attrs, geo_attr):
    """Convert a Python Geo Interface Feature to a Tamr record

        feature can be a dict representing a Geospatial Feature, or a Feature object
        that implements the __geo_interface__ property.

        :param feature: Python Geo Interface Feature
        :param key_attrs: Sequence of attributes that comprise the primary key for the record
        :param geo_attr: The singluar attribute on the record to use for the geometry
        :return: dict
        """
    if hasattr(feature, '__geo_interface__'):
        feature = feature.__geo_interface__
    record = {}
    props = feature.get('properties')
    if props:
        for prop in props:
            record[prop] = props[prop]
    geometry = feature.get('geometry')
    if geometry:
        geo_type = geometry['type']
        geo_type = geo_type[0].lower() + geo_type[1:]
        record[geo_attr] = {geo_type: geometry['coordinates']}
    bbox = feature.get('bbox')
    if bbox:
        record['bbox'] = bbox
    if 'id' not in feature or feature['id'] is None:
        raise ValueError('id must have a non-null value')
    if key_attrs[1:]:
        key_values = feature['id']
        for i, attr in enumerate(key_attrs):
            record[attr] = key_values[i]
    else:
        record[key_attrs[0]] = feature['id']
    return record
