6. album module

This module contains higher level classes to query Musixmatch API and build simple dictionary-like objects representing an Album or an AlbumsCollection.

>>> from musixmatch.album import Album, AlbumsCollection
>>> import musixmatch.api
>>> 
>>> try:
...     album = Album(album_id=292)
...     collection = AlbumsCollection.fromArtist(country='it', page=1)
... except musixmatch.api.Error, e:
...     pass
class Album(dictionary=None, **keywords)

Bases: musixmatch.base.Item

This class build a dict like object representing an album. It can get album information through the musixmatch.api.Method album.get or from an already well-formed dict. Create an Album object based on a given keyword argument:

Parameters:
  • album_id – musiXmatch album ID
  • album_data – an already well-formed dict of album data.

Once information are collected, the following keys are available:

Parameters:
  • album_id – musiXmatch album ID
  • album_name – album name
  • album_release_date – album release date
  • album_release_type – type of the album
  • album_coverart_100x100 – coverart URL
  • artist_id – album artist musiXmatch ID
  • artist_name – album artist name
class AlbumsCollection(*items)

Bases: musixmatch.base.ItemsCollection

This class build a list like object representing an albums collection. It accepts dict or Album objects.

classmethod fromArtist(**keywords)

This classmethod builds an AlbumsCollection from a artist.albums.get musixmatch.api.Method call.

Parameters:
  • artist_id – album artist musiXmatch ID
  • g_album_name – group albums by name
  • s_release_date – sort albums by release date
Return type:

AlbumsCollection

Previous topic

5. track module

Next topic

7. lyrics module

This Page