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

Type Release

object --+    
         |    
    Entity --+
             |
            Release


Represents a Release.

A release within MusicBrainz is an Entity which contains Track objects. Releases may be of more than one type: There can be albums, singles, compilations, live recordings, official releases, bootlegs etc.

Note: The current MusicBrainz server implementation supports only a limited set of types.

Method Summary
  __init__(self, id_, title)
Constructor.
  addDisc(self, disc)
Adds a disc to this release.
  addReleaseEvent(self, event)
Adds a release event to this release.
  addTrack(self, track)
Adds a track to this release.
  addType(self, type_)
Add a type to the list of types.
  getArtist(self)
Returns the main artist of this release.
  getAsin(self)
Returns the amazon shop identifier (ASIN).
  getDiscs(self)
Returns the discs associated with this release.
  getEarliestReleaseDate(self)
Returns the earliest release date.
  getEarliestReleaseEvent(self)
Returns the earliest release event.
  getReleaseEvents(self)
Returns the list of release events.
  getReleaseEventsAsDict(self)
Returns the release events represented as a dict.
  getTextLanguage(self)
Returns the language used in release and track titles.
  getTextScript(self)
Returns the script used in release and track titles.
  getTitle(self)
Returns the release's title.
  getTracks(self)
Returns the tracks this release contains.
  getTracksCount(self)
Returns the number of tracks on this release.
  getTracksOffset(self)
Returns the offset of the track list.
  getTypes(self)
Returns the types of this release.
  isSingleArtistRelease(self)
Checks if this is a single artist's release.
  setArtist(self, artist)
Sets this release's main artist.
  setAsin(self, asin)
Sets the amazon shop identifier (ASIN).
  setTextLanguage(self, language)
Sets the language used in releaes and track titles.
  setTextScript(self, script)
Sets the script used in releaes and track titles.
  setTitle(self, title)
Sets the release's title.
  setTracksCount(self, value)
Sets the number of tracks on this release.
  setTracksOffset(self, offset)
Sets the offset of the track list.
    Inherited from Entity
  addRelation(self, relation)
Adds a relation.
  getId(self)
Returns a MusicBrainz ID.
  getRelations(self, targetType, relationType, requiredAttributes, direction)
Returns a list of relations.
  getRelationTargets(self, targetType, relationType, requiredAttributes, direction)
Returns a list of relation targets.
  getRelationTargetTypes(self)
Returns a list of target types available for this entity.
  setId(self, value)
Sets a MusicBrainz ID.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
  artist: The main artist of this release.
  asin: The amazon shop identifier.
  discs: The list of associated discs.
  releaseEvents: The list of release events.
  textLanguage: The language used in release and track titles.
  textScript: The script used in release and track titles.
  title: The title of this release.
  tracks: The list of tracks.
  tracksCount: The total number of releases
  tracksOffset: The offset of the track list.
  types: The list of types for this release.
    Inherited from Entity
  id: The MusicBrainz ID.

Class Variable Summary
str TYPE_ALBUM = 'http://musicbrainz.org/ns/mmd-1.0#Album'
str TYPE_AUDIOBOOK = 'http://musicbrainz.org/ns/mmd-1.0#Audi...
str TYPE_BOOTLEG = 'http://musicbrainz.org/ns/mmd-1.0#Bootle...
str TYPE_COMPILATION = 'http://musicbrainz.org/ns/mmd-1.0#Co...
str TYPE_EP = 'http://musicbrainz.org/ns/mmd-1.0#EP'
str TYPE_INTERVIEW = 'http://musicbrainz.org/ns/mmd-1.0#Inte...
str TYPE_LIVE = 'http://musicbrainz.org/ns/mmd-1.0#Live'
str TYPE_NONE = 'http://musicbrainz.org/ns/mmd-1.0#None'
str TYPE_OFFICIAL = 'http://musicbrainz.org/ns/mmd-1.0#Offic...
str TYPE_OTHER = 'http://musicbrainz.org/ns/mmd-1.0#Other'
str TYPE_PROMOTION = 'http://musicbrainz.org/ns/mmd-1.0#Prom...
str TYPE_PSEUDO_RELEASE = 'http://musicbrainz.org/ns/mmd-1.0...
str TYPE_REMIX = 'http://musicbrainz.org/ns/mmd-1.0#Remix'
str TYPE_SINGLE = 'http://musicbrainz.org/ns/mmd-1.0#Single'...
str TYPE_SOUNDTRACK = 'http://musicbrainz.org/ns/mmd-1.0#Sou...
str TYPE_SPOKENWORD = 'http://musicbrainz.org/ns/mmd-1.0#Spo...

Method Details

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

Constructor.
Parameters:
id_ - a string containing an absolute URI
title - a string containing the title
Overrides:
musicbrainz2.model.Entity.__init__

addDisc(self, disc)

Adds a disc to this release.
Parameters:
disc - a Disc object

addReleaseEvent(self, event)

Adds a release event to this release.
Parameters:
event - a ReleaseEvent object

See Also: getReleaseEvents

addTrack(self, track)

Adds a track to this release.

This appends a track at the end of this release's track list.
Parameters:
track - a Track object

addType(self, type_)

Add a type to the list of types.
Parameters:
type_ - a string containing absolute URIs

See Also: getTypes

getArtist(self)

Returns the main artist of this release.
Returns:
an Artist object, or None

getAsin(self)

Returns the amazon shop identifier (ASIN).

The ASIN is a 10-letter code (except for books) assigned by Amazon, which looks like 'B000002IT2' or 'B00006I4YD'.
Returns:
a string containing the ASIN, or None

getDiscs(self)

Returns the discs associated with this release.

Discs are currently containers for MusicBrainz DiscIDs. Note that under rare circumstances (identical TOCs), a DiscID could be associated with more than one release.
Returns:
a list of Disc objects

getEarliestReleaseDate(self)

Returns the earliest release date.

This favours complete dates. For example, '2006-09' is returned if there is '2000', too. If there is no release event associated with this release, None is returned.
Returns:
a string containing the date, or None

See Also: getReleaseEvents, getReleaseEventsAsDict

getEarliestReleaseEvent(self)

Returns the earliest release event.

This works like getEarliestReleaseDate, but instead of just the date, this returns a ReleaseEvent object.
Returns:
a ReleaseEvent object, or None

See Also: getReleaseEvents, getEarliestReleaseDate

getReleaseEvents(self)

Returns the list of release events.

A Release may contain a list of so-called release events, each represented using a ReleaseEvent object. Release evens specify where and when this release was, well, released.
Returns:
a list of ReleaseEvent objects

See Also: getReleaseEventsAsDict

getReleaseEventsAsDict(self)

Returns the release events represented as a dict.

Keys are ISO-3166 country codes like 'DE', 'UK', 'FR' etc. Values are dates in 'YYYY', 'YYYY-MM' or 'YYYY-MM-DD' format.
Returns:
a dict containing (countryCode, date) entries

See Also: getReleaseEvents, musicbrainz2.utils.getCountryName

getTextLanguage(self)

Returns the language used in release and track titles.

To represent the language, the ISO-639-2/T standard is used, which provides three-letter terminological language codes like 'ENG', 'DEU', 'JPN', 'KOR', 'ZHO' or 'YID'.

Note that this refers to release and track titles, not lyrics.
Returns:
a string containing the language code, or None

See Also: musicbrainz2.utils.getLanguageName

getTextScript(self)

Returns the script used in release and track titles.

To represent the script, ISO-15924 script codes are used. Valid codes are, among others: 'Latn', 'Cyrl', 'Hans', 'Hebr'

Note that this refers to release and track titles, not lyrics.
Returns:
a string containing the script code, or None

See Also: musicbrainz2.utils.getScriptName

getTitle(self)

Returns the release's title.
Returns:
a string containing the release's title

getTracks(self)

Returns the tracks this release contains.
Returns:
a list containing Track objects

See Also: getTracksOffset, getTracksCount

getTracksCount(self)

Returns the number of tracks on this release.

This may or may not match with the number of elements that getTracks 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: setTracksCount, getTracks, getTracksOffset

getTracksOffset(self)

Returns the offset of the track list.

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

See Also: getTracks, getTracksCount

getTypes(self)

Returns the types of this release.

To test for release types, you can use the constants TYPE_ALBUM, TYPE_SINGLE, etc.
Returns:
a list of strings containing absolute URIs

See Also: musicbrainz2.utils.getReleaseTypeName

isSingleArtistRelease(self)

Checks if this is a single artist's release.

Returns True if the release's main artist (getArtist) is also the main artist for all of the tracks. This is checked by comparing the artist IDs.

Note that the release's artist has to be set (see setArtist) for this. The track artists may be unset.
Returns:
True, if this is a single artist's release

setArtist(self, artist)

Sets this release's main artist.
Parameters:
artist - an Artist object

setAsin(self, asin)

Sets the amazon shop identifier (ASIN).
Parameters:
asin - a string containing the ASIN

See Also: getAsin

setTextLanguage(self, language)

Sets the language used in releaes and track titles.
Parameters:
language - a string containing a language code

See Also: getTextLanguage

setTextScript(self, script)

Sets the script used in releaes and track titles.
Parameters:
script - a string containing a script code

See Also: getTextScript

setTitle(self, title)

Sets the release's title.
Parameters:
title - a string containing the release's title, or None

setTracksCount(self, value)

Sets the number of tracks on this release.
Parameters:
value - an integer containing the count, or None

See Also: getTracksCount, setTracksOffset

setTracksOffset(self, offset)

Sets the offset of the track list.
Parameters:
offset - an integer containing the offset, or None

See Also: getTracksOffset, setTracksCount


Property Details

artist

The main artist of this release.
Get Method:
getArtist(self)
Set Method:
setArtist(self, artist)

asin

The amazon shop identifier.
Get Method:
getAsin(self)
Set Method:
setAsin(self, asin)

discs

The list of associated discs.
Get Method:
getDiscs(self)

releaseEvents

The list of release events.
Get Method:
getReleaseEvents(self)

textLanguage

The language used in release and track titles.
Get Method:
getTextLanguage(self)
Set Method:
setTextLanguage(self, language)

textScript

The script used in release and track titles.
Get Method:
getTextScript(self)
Set Method:
setTextScript(self, script)

title

The title of this release.
Get Method:
getTitle(self)
Set Method:
setTitle(self, title)

tracks

The list of tracks.
Get Method:
getTracks(self)

tracksCount

The total number of releases
Get Method:
getTracksCount(self)
Set Method:
setTracksCount(self, value)

tracksOffset

The offset of the track list.
Get Method:
getTracksOffset(self)
Set Method:
setTracksOffset(self, offset)

types

The list of types for this release.
Get Method:
getTypes(self)

Class Variable Details

TYPE_ALBUM

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Album'                              

TYPE_AUDIOBOOK

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Audiobook'                          

TYPE_BOOTLEG

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Bootleg'                            

TYPE_COMPILATION

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Compilation'                        

TYPE_EP

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#EP'                                 

TYPE_INTERVIEW

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Interview'                          

TYPE_LIVE

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Live'                               

TYPE_NONE

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#None'                               

TYPE_OFFICIAL

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Official'                           

TYPE_OTHER

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Other'                              

TYPE_PROMOTION

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Promotion'                          

TYPE_PSEUDO_RELEASE

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Pseudo-Release'                     

TYPE_REMIX

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Remix'                              

TYPE_SINGLE

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Single'                             

TYPE_SOUNDTRACK

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Soundtrack'                         

TYPE_SPOKENWORD

Type:
str
Value:
'http://musicbrainz.org/ns/mmd-1.0#Spokenword'                         

Generated by Epydoc 2.1 on Wed Dec 20 18:19:28 2006 http://epydoc.sf.net