Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update pyechonest/catalog.py

get_catalog_by_name
  • Loading branch information...
commit bbb9f422bd1aa158d930164020e38722d3bfeadf 1 parent d0fbfa0
@markaurelius markaurelius authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 pyechonest/catalog.py
View
11 pyechonest/catalog.py
@@ -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):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.