Permalink
Browse files

Update pyechonest/catalog.py

get_catalog_by_name
  • Loading branch information...
markaurelius committed Dec 19, 2012
1 parent d0fbfa0 commit bbb9f422bd1aa158d930164020e38722d3bfeadf
Showing with 11 additions and 0 deletions.
  1. +11 −0 pyechonest/catalog.py
View
@@ -365,6 +365,17 @@ def ban(self, items, ban=None):
def rate(self, items, rating=None):
return self.get_attribute("rate", item=items, rating=rating)
+
+def get_catalog_by_name(name):
+ """
+ Grabs a catalog by name, if its there on the api key.
+ Otherwise, an error is thrown (mirroring the API)
+ """
+ kwargs = {
+ 'name' : name,
+ }
+ result = util.callm("%s/%s" % ('catalog', 'profile'), kwargs)
+ return Catalog(**util.fix(result['response']['catalog']))
def list_catalogs(results=30, start=0):
"""

0 comments on commit bbb9f42

Please sign in to comment.