'Add data for name where val_map is a map of book_ids to values. If
delete_first is True, all previously stored data for name will be
removed.'

@write_api
def add_custom_book_data(self, name, val_map, delete_first=False):

    missing = (frozenset(val_map) - self._all_book_ids())
    if missing:
        raise ValueError((u'add_custom_book_data:    no    such    book_ids:    %d' % missing))
    self.backend.add_custom_data(name, val_map, delete_first)
