sima.lib.track.Track(file=None, time=0, pos=- 1, **kwargs)[source]¶Track object. Instantiate with Player replies.
file (str) – media file, defaults to None
time (int) – duration in second, defaults to 0
pos (int) – position in queue, defaults to -1
title|artist|album (str) – defaults to “”
musicbrainz_artistid|musicbrainz_albumartistid (str) – MusicBrainz IDs, defaults to None
Artist¶Get the sima.lib.meta.Artist associated to this track
file¶file is an immutable attribute that’s used for the hash method
sima.lib.meta.Meta(name, mbid=None, **kwargs)[source]¶A generic Class to handle tracks metadata such as artist, album, albumartist names and their associated MusicBrainz’s ID.
Using generic kwargs in constructor for convenience but the actual signature is:
>>> Meta(name, mbid=None, **kwargs)
name (str) – set name attribute
mbid (str) – set MusicBrainz ID
add_alias(other)[source]¶Add alternative name to aliases attibute.
other can be a sima.lib.meta.Meta object in which case aliases are merged.
other (str) – Alias to add, could be any object with __str__ method.
aliases¶aliases_sz¶mbid¶name¶name_sz¶names¶aliases + name
names_sz¶use_mbid = True¶Class attribute to disable use of MusicBrainz IDs
sima.lib.meta.Artist(name, mbid=None, albumartist=None, musicbrainz_artistid=None, musicbrainz_albumartistid=None)[source]¶Bases: sima.lib.meta.Meta
Artist object deriving from Meta.
name (str) – Artist name
mbid (str) – Musicbrainz artist ID
artist (str) – Overrides “name” argument
albumartist (str) – Overrides “name” and “artist” argument
musicbrainz_artistid (str) – Overrides “mbid” argument
musicbrainz_albumartistid (str) – Overrides “musicbrainz_artistid” argument
>>> trk = {'artist':'Art Name',
>>> 'albumartist': 'Alb Art Name', # optional
>>> 'musicbrainz_artistid': '<UUID4>', # optional
>>> 'musicbrainz_albumartistid': '<UUID4>', # optional
>>> }
>>> artobj0 = Artist(**trk)
>>> artobj1 = Artist(name='Tool')