calliope.musicbrainz.includes

Helpers for filtering data when querying MusicBrainz.

Module Contents

Classes

MBType

Supported MusicBrainz resource types.

IncludeKey

Include flags used in MusicBrainz API queries.

Functions

all_include_key_fullnames()

typenames()

get_key(fullname)

expand_fullname_patterns(patterns)

Helper for tools which accept glob patterns for include-keys.

Attributes

ALL_MB_TYPES

INCLUDE_KEYS

class calliope.musicbrainz.includes.MBType

Bases: enum.Enum

Supported MusicBrainz resource types.

ARTIST = 0
RECORDING = 1
RELEASE = 2
RELEASE_GROUP = 4
WORK = 4
typename(self)
Return type

str

calliope.musicbrainz.includes.ALL_MB_TYPES
class calliope.musicbrainz.includes.IncludeKey

Include flags used in MusicBrainz API queries.

Each MusicBrainz API call has an ‘include’ parameter to control what data is returned. This class represents each possible ‘include’ option.

types :set(MBType)
name :str
response_keys :[str]
applies_to_typename(self, typename)
Return type

bool

fullnames(self)

List all fully qualified names of this key.

A fullname is formatted as typename.keyname, for example:

  • artist.url-rels

  • recording.url-rels

Return type

[str]

outname(self)

Name used in Calliope Item keys.

For example, ‘artist-rels’ becomes ‘artist_rels’.

Return type

str

__str__(self)

Return str(self).

__hash__(self)

Return hash(self).

calliope.musicbrainz.includes.INCLUDE_KEYS
calliope.musicbrainz.includes.all_include_key_fullnames()
Return type

set

calliope.musicbrainz.includes.typenames()
Return type

[str]

calliope.musicbrainz.includes.get_key(fullname)
Return type

IncludeKey

calliope.musicbrainz.includes.expand_fullname_patterns(patterns)

Helper for tools which accept glob patterns for include-keys.

This allows commandline users to specify “artist.*” rather than listing all artist include-keys explicitly.

Parameters

patterns ([str]) –

Return type

[str]