Mercurial > hg > pmhd
annotate musixmatch-master/build/lib/musixmatch/ws.py @ 13:844d341cf643 tip
Back up before ISMIR
author | Yading Song <yading.song@eecs.qmul.ac.uk> |
---|---|
date | Thu, 31 Oct 2013 13:17:06 +0000 |
parents | 8c29444cb5fd |
children |
rev | line source |
---|---|
yading@7 | 1 """ |
yading@7 | 2 This is an utility module that provides a row musiXmatch web API interface. |
yading@7 | 3 Ideally it should be used like this: |
yading@7 | 4 |
yading@7 | 5 >>> import musixmatch |
yading@7 | 6 >>> |
yading@7 | 7 >>> try: |
yading@7 | 8 ... chart = musixmatch.ws.track.chart.get(country='it', f_has_lyrics=1) |
yading@7 | 9 ... except musixmatch.api.Error, e: |
yading@7 | 10 ... pass |
yading@7 | 11 """ |
yading@7 | 12 from warnings import warn |
yading@7 | 13 import os |
yading@7 | 14 import musixmatch.api |
yading@7 | 15 __license__ = musixmatch.__license__ |
yading@7 | 16 __author__ = musixmatch.__author__ |
yading@7 | 17 |
yading@7 | 18 _version = os.environ.get('musixmatch_apiversion', None) |
yading@7 | 19 if not _version: |
yading@7 | 20 _version = '1.1' |
yading@7 | 21 else: |
yading@7 | 22 warn("Use of `musixmatch_apiversion' was deprecated in favour of `musixmatch_wslocation'", DeprecationWarning) |
yading@7 | 23 |
yading@7 | 24 location = os.environ.get('musixmatch_wslocation', 'http://api.musixmatch.com/ws/%s' % _version) |
yading@7 | 25 |
yading@7 | 26 artist = musixmatch.api.Method('artist') |
yading@7 | 27 album = musixmatch.api.Method('album') |
yading@7 | 28 track = musixmatch.api.Method('track') |
yading@7 | 29 tracking = musixmatch.api.Method('tracking') |
yading@7 | 30 matcher = musixmatch.api.Method('matcher') |