calliope.musicbrainz.annotate_helpers

Module Contents

Functions

query_data(cache, item, include)

Query all MusicBrainz data specified by keys in include.

adapt_artist_credit(artist_credit)

Process 'artist-credit' field into a Calliope artist list.

search(context, item[, select_fun])

Search musicbrainz for the best match of item.

calliope.musicbrainz.annotate_helpers.query_data(cache, item, include)

Query all MusicBrainz data specified by keys in include.

Parameters:

include ([str]) –

Return type:

calliope.playlist.Item

calliope.musicbrainz.annotate_helpers.adapt_artist_credit(artist_credit)

Process ‘artist-credit’ field into a Calliope artist list.

Parameters:

artist_credit (Iterable[Dict]) –

Return type:

Iterable[Dict]

calliope.musicbrainz.annotate_helpers.search(context, item, select_fun=select_best)

Search musicbrainz for the best match of item.

Parameters:
  • context – The musicbrainz context

  • item (calliope.playlist.Item) – The item to search the match for

  • select_fun (Callable[[calliope.playlist.Item, List[calliope.playlist.Item]], Optional[calliope.playlist.Item]]) – A selector function which chooses the best match from the retrieved candidates

Returns:

The match or None in case no good match was found.

Return type:

Optional[calliope.playlist.Item]