yading@7: """ yading@7: This module contains higher level classes to query Musixmatch API and build yading@7: simple dictionary-like objects representing a track subtitle. yading@7: yading@7: >>> from musixmatch.subtitle import Subtitle yading@7: >>> import musixmatch.api yading@7: >>> yading@7: >>> try: yading@7: ... subtitle = Subtitle(subtitle_id=292) yading@7: ... except musixmatch.api.Error, e: yading@7: ... pass yading@7: """ yading@7: import musixmatch yading@7: __license__ = musixmatch.__license__ yading@7: __author__ = musixmatch.__author__ yading@7: yading@7: from musixmatch.base import Item yading@7: from musixmatch.ws import track yading@7: yading@7: class Subtitle(Item): yading@7: """ yading@7: This class builds a :py:class:`dict` object representing a subtitle of a yading@7: track. It can get subtitle through the :py:class:`musixmatch.api.Method` yading@7: **track.subtitle.get** or from an already well-formed :py:class:`dict`. yading@7: Create a Track object based on a given keyword argument: yading@7: yading@7: :param track_id: musiXmatch track ID yading@7: :param musicbrainz_id: Musicbrainz track ID yading@7: :param track_echonest_id: Echonest track ID yading@7: :param subtitle_data: an already well-formed :py:class:`dict` of track data yading@7: :raises: :py:class:`musixmatch.api.Error` if :py:class:`musixmatch.api.StatusCode` is not 200 yading@7: yading@7: Once information are collected, the following keys are available: yading@7: yading@7: :keyword subtitle_body: the subtitle text yading@7: :keyword subtitle_id: the Musixmatch subtitle id yading@7: :keyword subtitle_language: the subtitle language yading@7: """ yading@7: __api_method__ = track.subtitle.get yading@7: