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:

- `http://musicbrainz.org/ns/mmd-1.0#Person`
- `http://musicbrainz.org/ns/mmd-1.0#Group`

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

getReleaseGroups(self) Returns a list of release groups from this artist. | source code

addReleaseGroup(self, releaseGroup) Adds a release group to this artist's list of release groups. | source code

getReleaseGroupsOffset(self) Returns the offset of the release group list. | source code

setReleaseGroupsOffset(self, offset) Sets the offset of the release group list. | source code

getReleaseGroupsCount(self) Returns the number of existing release groups. | source code

setReleaseGroupsCount(self, value) Sets the number of existing release groups. | source code

Inherited from `Entity`: `addRelation`, `addTag`, `getId`, `getRating`, `getRelationTargetTypes`, `getRelationTargets`, `getRelations`, `getTag`, `getTags`, `setId`, `setRating` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

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.
| releaseGroups The list of release groups
| releaseGroupsOffset The offset of the release group list.
| releasesCount The total number of release groups
Inherited from `Entity`: `id`, `rating`, `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: object.__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.

See Also: The MusicBrainz Style Guidelines

### 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

See Also: getDisambiguation, getUniqueName

### 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

See Also: setEndDate, getBeginDate

### 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:
  - `alias` - an ArtistAlias object

### 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:
  - `release` - a Release object

### 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

See Also: getReleases, getReleasesCount

### 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

See Also: setReleasesCount, getReleasesOffset

### setReleasesCount(self, value)

source code

Sets the number of existing releases.

Parameters:
  - `value` - an integer containing the count, or None

See Also: getReleasesCount, setReleasesOffset

### getReleaseGroups(self)

source code

Returns a list of release groups from this artist.

Returns:
  a list of ReleaseGroup objects

### addReleaseGroup(self, releaseGroup)

source code

Adds a release group to this artist's list of release groups.

Parameters:
  - `releaseGroup` - a ReleaseGroup object

### getReleaseGroupsOffset(self)

source code

Returns the offset of the release group list.

This is used if the release group list is incomplete (ie. the web service only returned part of the result for this artist). Note that the offset value is zero-based, which means release group `0` is the first release group.

Returns:
  an integer containing the offset, or None

See Also: getReleaseGroups, getReleaseGroupsCount

### setReleaseGroupsOffset(self, offset)

source code

Sets the offset of the release group list.

Parameters:
  - `offset` - an integer containing the offset, or None

See Also: getReleaseGroupsOffset

### getReleaseGroupsCount(self)

source code

Returns the number of existing release groups.

This may or may not match with the number of elements that getReleaseGroups returns. If the count is higher than the list, it indicates that the list is incomplete.

Returns:
  an integer containing the count, or None

See Also: setReleaseGroupsCount, getReleaseGroupsOffset

### setReleaseGroupsCount(self, value)

source code

Sets the number of existing release groups.

Parameters:
  - `value` - an integer containing the count, or None

See Also: getReleaseGroupsCount, setReleaseGroupsOffset

Property Details

### type

The artist's type.

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

### name

The artist's name.

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

### sortName

The artist's sort name.

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

### disambiguation

The disambiguation comment.

Get Method:
  getDisambiguation(self) - Returns the disambiguation attribute.
Set Method:
  setDisambiguation(self, disambiguation) - Sets the disambiguation attribute.

### beginDate

The begin/foundation date.

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

### endDate

The death/dissolving date.

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

### aliases

The list of aliases.

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

### releases

The list of releases

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

### releasesOffset

The offset of the release list.

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

### releaseGroups

The list of release groups

Get Method:
  getReleaseGroups(self) - Returns a list of release groups from this artist.

### releaseGroupsOffset

The offset of the release group list.

Get Method:
  getReleaseGroupsOffset(self) - Returns the offset of the release group list.
Set Method:
  setReleaseGroupsOffset(self, offset) - Sets the offset of the release group list.

### releasesCount

The total number of release groups

Get Method:
  getReleaseGroupsCount(self) - Returns the number of existing release groups.
Set Method:
  setReleaseGroupsCount(self, value) - Sets the number of existing release groups.