Package musicbrainz2 :: Module model :: Class Artist
[frames] | no frames]

Class Artist

source code

object --+    
         |    
    Entity --+
             |
            Artist

Represents an artist.

Artists in MusicBrainz can have a type. Currently, this type can be either Person or Group for which the following URIs are assigned: Use the TYPE_PERSON and TYPE_GROUP constants for comparison.

Instance Methods
 
__init__(self, id_=None, type_=None, name=None, sortName=None)
Constructor.
source code
 
getType(self)
Returns the artist's type.
source code
 
setType(self, type_)
Sets the artist's type.
source code
 
getName(self)
Returns the artist's name.
source code
 
setName(self, name)
Sets the artist's name.
source code
 
getSortName(self)
Returns the artist's sort name.
source code
 
setSortName(self, sortName)
Sets the artist's sort name.
source code
 
getDisambiguation(self)
Returns the disambiguation attribute.
source code
 
setDisambiguation(self, disambiguation)
Sets the disambiguation attribute.
source code
 
getUniqueName(self)
Returns a unique artist name (using disambiguation).
source code
 
getBeginDate(self)
Returns the birth/foundation date.
source code
 
setBeginDate(self, dateStr)
Sets the begin/foundation date.
source code
 
getEndDate(self)
Returns the death/dissolving date.
source code
 
setEndDate(self, dateStr)
Sets the death/dissolving date.
source code
 
getAliases(self)
Returns the list of aliases for this artist.
source code
 
addAlias(self, alias)
Adds an alias for this artist.
source code
 
getReleases(self)
Returns a list of releases from this artist.
source code
 
addRelease(self, release)
Adds a release to this artist's list of releases.
source code
 
getReleasesOffset(self)
Returns the offset of the release list.
source code
 
setReleasesOffset(self, offset)
Sets the offset of the release list.
source code
 
getReleasesCount(self)
Returns the number of existing releases.
source code
 
setReleasesCount(self, value)
Sets the number of existing releases.
source code

Inherited from Entity: addRelation, addTag, getId, getRelationTargetTypes, getRelationTargets, getRelations, getTag, getTags, setId

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  TYPE_PERSON = 'http://musicbrainz.org/ns/mmd-1.0#Person'
  TYPE_GROUP = 'http://musicbrainz.org/ns/mmd-1.0#Group'
Properties
  type
The artist's type.
  name
The artist's name.
  sortName
The artist's sort name.
  disambiguation
The disambiguation comment.
  beginDate
The begin/foundation date.
  endDate
The death/dissolving date.
  aliases
The list of aliases.
  releases
The list of releases
  releasesOffset
The offset of the release list.
  releasesCount
The total number of releases

Inherited from Entity: id, tags

Inherited from object: __class__

Method Details

__init__(self, id_=None, type_=None, name=None, sortName=None)
(Constructor)

source code 
Constructor.
Parameters:
  • id_ - a string containing an absolute URI
  • type_ - a string containing an absolute URI
  • name - a string containing the artist's name
  • sortName - a string containing the artist's sort name
Overrides: Entity.__init__

getType(self)

source code 
Returns the artist's type.
Returns:
a string containing an absolute URI, or None

setType(self, type_)

source code 
Sets the artist's type.
Parameters:
  • type_ - a string containing an absolute URI

getName(self)

source code 
Returns the artist's name.
Returns:
a string containing the artist's name, or None

setName(self, name)

source code 
Sets the artist's name.
Parameters:
  • name - a string containing the artist's name

getSortName(self)

source code 

Returns the artist's sort name.

The sort name is the artist's name in a special format which is better suited for lexicographic sorting. The MusicBrainz style guide specifies this format.

setSortName(self, sortName)

source code 
Sets the artist's sort name.
Parameters:
  • sortName - a string containing the artist's sort name

See Also: getSortName

getDisambiguation(self)

source code 

Returns the disambiguation attribute.

This attribute may be used if there is more than one artist with the same name. In this case, disambiguation attributes are added to the artists' names to keep them apart.

For example, there are at least three bands named 'Vixen'. Each band has a different disambiguation in the MusicBrainz database, like 'Hip-hop' or 'all-female rock/glam band'.
Returns:
a disambiguation string, or None

See Also: getUniqueName

setDisambiguation(self, disambiguation)

source code 
Sets the disambiguation attribute.
Parameters:
  • disambiguation - a disambiguation string

getUniqueName(self)

source code 

Returns a unique artist name (using disambiguation).

This method returns the artist name together with the disambiguation attribute in parenthesis if it exists. Example: 'Vixen (Hip-hop)'.
Returns:
a string containing the unique name

See Also: getDisambiguation

getBeginDate(self)

source code 

Returns the birth/foundation date.

The definition of the begin date depends on the artist's type. For persons, this is the day of birth, for groups it is the day the group was founded.

The returned date has the format 'YYYY', 'YYYY-MM', or 'YYYY-MM-DD', depending on how much detail is known.
Returns:
a string containing the date, or None

See Also: getType

setBeginDate(self, dateStr)

source code 
Sets the begin/foundation date.
Parameters:
  • dateStr - a date string

See Also: getBeginDate

getEndDate(self)

source code 

Returns the death/dissolving date.

The definition of the end date depends on the artist's type. For persons, this is the day of death, for groups it is the day the group was dissolved.
Returns:
a string containing a date, or None

See Also: getBeginDate

setEndDate(self, dateStr)

source code 
Sets the death/dissolving date.
Parameters:
  • dateStr - a string containing a date

getAliases(self)

source code 
Returns the list of aliases for this artist.
Returns:
a list of ArtistAlias objects

addAlias(self, alias)

source code 
Adds an alias for this artist.
Parameters:

getReleases(self)

source code 

Returns a list of releases from this artist.

This may also include releases where this artist isn't the main artist but has just contributed one or more tracks (aka VA-Releases).
Returns:
a list of Release objects

addRelease(self, release)

source code 
Adds a release to this artist's list of releases.
Parameters:

getReleasesOffset(self)

source code 

Returns the offset of the release list.

This is used if the release list is incomplete (ie. the web service only returned part of the release for this artist). Note that the offset value is zero-based, which means release 0 is the first release.
Returns:
an integer containing the offset, or None

setReleasesOffset(self, offset)

source code 
Sets the offset of the release list.
Parameters:
  • offset - an integer containing the offset, or None

See Also: getReleasesOffset

getReleasesCount(self)

source code 

Returns the number of existing releases.

This may or may not match with the number of elements that getReleases returns. If the count is higher than the list, it indicates that the list is incomplete.
Returns:
an integer containing the count, or None

setReleasesCount(self, value)

source code 
Sets the number of existing releases.
Parameters:
  • value - an integer containing the count, or None

Property Details

type

The artist's type.
Get Method:
musicbrainz2.model.Artist.getType(self) - Returns the artist's type.
Set Method:
musicbrainz2.model.Artist.setType(self, type_) - Sets the artist's type.

name

The artist's name.
Get Method:
musicbrainz2.model.Artist.getName(self) - Returns the artist's name.
Set Method:
musicbrainz2.model.Artist.setName(self, name) - Sets the artist's name.

sortName

The artist's sort name.
Get Method:
musicbrainz2.model.Artist.getSortName(self) - Returns the artist's sort name.
Set Method:
musicbrainz2.model.Artist.setSortName(self, sortName) - Sets the artist's sort name.

disambiguation

The disambiguation comment.
Get Method:
musicbrainz2.model.Artist.getDisambiguation(self) - Returns the disambiguation attribute.
Set Method:
musicbrainz2.model.Artist.setDisambiguation(self, disambiguation) - Sets the disambiguation attribute.

beginDate

The begin/foundation date.
Get Method:
musicbrainz2.model.Artist.getBeginDate(self) - Returns the birth/foundation date.
Set Method:
musicbrainz2.model.Artist.setBeginDate(self, dateStr) - Sets the begin/foundation date.

endDate

The death/dissolving date.
Get Method:
musicbrainz2.model.Artist.getEndDate(self) - Returns the death/dissolving date.
Set Method:
musicbrainz2.model.Artist.setEndDate(self, dateStr) - Sets the death/dissolving date.

aliases

The list of aliases.
Get Method:
musicbrainz2.model.Artist.getAliases(self) - Returns the list of aliases for this artist.

releases

The list of releases
Get Method:
musicbrainz2.model.Artist.getReleases(self) - Returns a list of releases from this artist.

releasesOffset

The offset of the release list.
Get Method:
musicbrainz2.model.Artist.getReleasesOffset(self) - Returns the offset of the release list.
Set Method:
musicbrainz2.model.Artist.setReleasesOffset(self, offset) - Sets the offset of the release list.

releasesCount

The total number of releases
Get Method:
musicbrainz2.model.Artist.getReleasesCount(self) - Returns the number of existing releases.
Set Method:
musicbrainz2.model.Artist.setReleasesCount(self, value) - Sets the number of existing releases.