Package musicbrainz2 :: Module model :: Class Label

[frames] | no frames]

# Class Label

source code

    object --+
             |
        Entity --+
                 |
                Label

Represents a record label.

A label within MusicBrainz is an Entity. It contains information about the label like when it was established, its name, label code and other relationships. All release events may be assigned a label.

Instance Methods

__init__(self, id_=None) Constructor. | source code

getType(self) Returns the type of this label. | source code

setType(self, type_) Sets the type of this label. | source code

getName(self) Returns a string with the name of the label. | source code

setName(self, name) Sets the name of this label. | source code

getSortName(self) Returns the label's sort name. | source code

setSortName(self, sortName) Sets the label'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 label name (using disambiguation). | source code

getBeginDate(self) Returns the date this label was established. | source code

setBeginDate(self, date) Set the date this label was established. | source code

getEndDate(self) Returns the date this label closed. | source code

setEndDate(self, date) Set the date this label closed. | source code

getCountry(self) Returns the country the label is located. | source code

setCountry(self, country) Sets the country the label is located. | source code

getCode(self) Returns the label code. | source code

setCode(self, code) Sets the label code. | source code

getAliases(self) Returns the list of aliases for this label. | source code

addAlias(self, alias) Adds an alias for this label. | 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_UNKNOWN = ``'``http://musicbrainz.org/ns/mmd-1.0#Unknown``'``
| TYPE_DISTRIBUTOR = ``'``http://musicbrainz.org/ns/mmd-1.0#Distribu``...``
| TYPE_HOLDING = ``'``http://musicbrainz.org/ns/mmd-1.0#Holding``'``
| TYPE_PRODUCTION = ``'``http://musicbrainz.org/ns/mmd-1.0#Production``'``
| TYPE_ORIGINAL = ``'``http://musicbrainz.org/ns/mmd-1.0#OriginalPro``...``
| TYPE_BOOTLEG = ``'``http://musicbrainz.org/ns/mmd-1.0#BootlegProdu``...``
| TYPE_REISSUE = ``'``http://musicbrainz.org/ns/mmd-1.0#ReissueProdu``...``

Properties
| type The type of label
| name The name of the label.
| sortName The label's sort name.
| disambiguation The disambiguation comment.
| beginDate The date this label was established.
| endDate The date this label closed.
| country The country the label is located.
| code The label code.
| aliases The list of aliases.
Inherited from `Entity`: `id`, `rating`, `tags` Inherited from `object`: `__class__`

Method Details

### __init__(self, id_=None)
(Constructor)

source code

Constructor.

Parameters:
  - `id_` - a string containing an absolute URI
Overrides: object.__init__

### getType(self)

source code

Returns the type of this label.

Returns:
  a string containing an absolute URI

### setType(self, type_)

source code

Sets the type of this label.

Parameters:
  - `type_` - A string containing the absolute URI of the type of label.

### getName(self)

source code

Returns a string with the name of the label.

Returns:
  a string containing the label's name, or None

### setName(self, name)

source code

Sets the name of this label.

Parameters:
  - `name` - A string containing the name of the label

### getSortName(self)

source code

Returns the label's sort name.

The sort name is the label'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 label's sort name.

Parameters:
  - `sortName` - a string containing the label'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 label with the same name. In this case, disambiguation attributes are added to the labels' names to keep them apart.

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 label name (using disambiguation).

This method returns the label's name together with the disambiguation attribute in parenthesis if it exists.

Returns:
  a string containing the unique name

See Also: getDisambiguation

### getBeginDate(self)

source code

Returns the date this label was established.

Returns:
  A string contained the start date, or None

### setBeginDate(self, date)

source code

Set the date this label was established.

Parameters:
  - `date` - A string in the format of YYYY-MM-DD

### getEndDate(self)

source code

Returns the date this label closed.

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

### setEndDate(self, date)

source code

Set the date this label closed.

The date may have the format 'YYYY', 'YYYY-MM', or 'YYYY-MM-DD', depending on how much detail is known.

Parameters:
  - `date` - A string containing the date, or None

### getCountry(self)

source code

Returns the country the label is located.

Returns:
  a string containing an ISO-3166 country code, or None

See Also: musicbrainz2.utils.getCountryName

### setCountry(self, country)

source code

Sets the country the label is located.

Parameters:
  - `country` - a string containing an ISO-3166 country code

### getCode(self)

source code

Returns the label code.

Label codes have been introduced by the IFPI (International Federation of Phonogram and Videogram Industries) to uniquely identify record labels. The label code consists of 'LC-' and 4 figures (currently being extended to 5 figures).

Returns:
  a string containing the label code, or None

### setCode(self, code)

source code

Sets the label code.

Parameters:
  - `code` - a string containing the label code

### getAliases(self)

source code

Returns the list of aliases for this label.

Returns:
  a list of LabelAlias objects

### addAlias(self, alias)

source code

Adds an alias for this label.

Parameters:
  - `alias` - a LabelAlias object

Class Variable Details

### TYPE_DISTRIBUTOR

Value:

      'http://musicbrainz.org/ns/mmd-1.0#Distributor'

### TYPE_ORIGINAL

Value:

      'http://musicbrainz.org/ns/mmd-1.0#OriginalProduction'

### TYPE_BOOTLEG

Value:

      'http://musicbrainz.org/ns/mmd-1.0#BootlegProduction'

### TYPE_REISSUE

Value:

      'http://musicbrainz.org/ns/mmd-1.0#ReissueProduction'

Property Details

### type

The type of label

Get Method:
  getType(self) - Returns the type of this label.
Set Method:
  setType(self, type_) - Sets the type of this label.

### name

The name of the label.

Get Method:
  getName(self) - Returns a string with the name of the label.
Set Method:
  setName(self, name) - Sets the name of this label.

### sortName

The label's sort name.

Get Method:
  getSortName(self) - Returns the label's sort name.
Set Method:
  setSortName(self, sortName) - Sets the label'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 date this label was established.

Get Method:
  getBeginDate(self) - Returns the date this label was established.
Set Method:
  setBeginDate(self, date) - Set the date this label was established.

### endDate

The date this label closed.

Get Method:
  getEndDate(self) - Returns the date this label closed.
Set Method:
  setEndDate(self, date) - Set the date this label closed.

### country

The country the label is located.

Get Method:
  getCountry(self) - Returns the country the label is located.
Set Method:
  setCountry(self, country) - Sets the country the label is located.

### code

The label code.

Get Method:
  getCode(self) - Returns the label code.
Set Method:
  setCode(self, code) - Sets the label code.

### aliases

The list of aliases.

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