def _getattr_path(obj, path):
    """
    getattr for a dot separated path

    If an AttributeError is raised, it will return None.
    """
    if not path:
        return None
    for attr in path.split('.'):
        obj = getattr(obj, attr, None)
    return obj
