yading@7: """ yading@7: This is an utility module that provides a row musiXmatch web API interface. yading@7: Ideally it should be used like this: yading@7: yading@7: >>> import musixmatch yading@7: >>> yading@7: >>> try: yading@7: ... chart = musixmatch.ws.track.chart.get(country='it', f_has_lyrics=1) yading@7: ... except musixmatch.api.Error, e: yading@7: ... pass yading@7: """ yading@7: from warnings import warn yading@7: import os yading@7: import musixmatch.api yading@7: __license__ = musixmatch.__license__ yading@7: __author__ = musixmatch.__author__ yading@7: yading@7: _version = os.environ.get('musixmatch_apiversion', None) yading@7: if not _version: yading@7: _version = '1.1' yading@7: else: yading@7: warn("Use of `musixmatch_apiversion' was deprecated in favour of `musixmatch_wslocation'", DeprecationWarning) yading@7: yading@7: location = os.environ.get('musixmatch_wslocation', 'http://api.musixmatch.com/ws/%s' % _version) yading@7: yading@7: artist = musixmatch.api.Method('artist') yading@7: album = musixmatch.api.Method('album') yading@7: track = musixmatch.api.Method('track') yading@7: tracking = musixmatch.api.Method('tracking') yading@7: matcher = musixmatch.api.Method('matcher')