]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/simaecho.py
Fixed simadb_cli auth (Closes #8)
[mpd-sima.git] / sima / lib / simaecho.py
index cfae27c675530b086a322c61b08fe85cbae7b945..393d723f62e216d7a6027d02c33a363b5f9a2d40 100644 (file)
@@ -50,6 +50,10 @@ class SimaEch:
     root_url = 'http://{host}/api/{version}'.format(**ECH)
     name = 'EchoNest'
     cache = False
+    """HTTP cache to use, in memory or persitent.
+
+    :param BaseCache cache: Set a cache, defaults to `False`.
+    """
     stats = {'etag':0,
              'ccontrol':0,
              'minrl':120,
@@ -94,8 +98,11 @@ class SimaEch:
         # return a sorted list of 2-tuple to have consistent cache
         return sorted(payload.items(), key=lambda param: param[0])
 
-    def get_similar(self, artist=None):
+    def get_similar(self, artist):
         """Fetch similar artists
+
+        :param sima.lib.meta.Artist artist: `Artist` to fetch similar artists from
+        :returns: generator of :class:`sima.lib.meta.Artist`
         """
         payload = self._forge_payload(artist)
         # Construct URL
@@ -106,8 +113,11 @@ class SimaEch:
             mbid = get_mbid(art)
             yield Artist(mbid=mbid, name=art.get('name'))
 
-    def get_toptrack(self, artist=None):
+    def get_toptrack(self, artist):
         """Fetch artist top tracks
+
+        :param sima.lib.meta.Artist artist: `Artist` to fetch top tracks from
+        :returns: generator of :class:`sima.lib.track.Track`
         """
         payload = self._forge_payload(artist, top=True)
         # Construct URL