calliope.musicbrainz

Access data from Musicbrainz.

See also: cpe musicbrainz command.

This module wraps the musicbrainzngs library.

Authentication

Musicbrainz access requires that you set a User Agent string. A default is set by the MusicbrainzContext object which can be overridden using its config.

Caching

Caching of data is handled using the calliope.cache module.

Submodules

Package Contents

Classes

MusicbrainzContext

Configuration for Musicbrainz APIs.

Functions

annotate(context, playlist, include, select_fun=None, update=False)

Annotate each item in a playlist with metadata from Musicbrainz.

resolve_image(context, playlist, max_size = 250)

Resolve a cover image using the Cover Art API.

class calliope.musicbrainz.MusicbrainzContext(config)

Configuration for Musicbrainz APIs.

Keys used from config dict:

  • musicbrainz.app: App name

  • musicbrainz.version: API version

  • musicbrainz.contact: Contact URL

If unset, the defaults reference Calliope and API version 1.

Parameters

config (dict) –

calliope.musicbrainz.annotate(context, playlist, include, select_fun=None, update=False)

Annotate each item in a playlist with metadata from Musicbrainz.

Parameters
calliope.musicbrainz.resolve_image(context, playlist, max_size=250)

Resolve a cover image using the Cover Art API.

See https://musicbrainz.org/doc/Cover_Art_Archive/API for more info.

Parameters