A Catalog object
id (str): Catalog ID
name (str): Catalog Name
read (list): A list of catalog items (objects if they are resolved, else dictionaries)
feed (list): A list of dictionaries for news, blogs, reviews, audio, video for a catalog’s artists
Create an catalog object like so:
>>> c = catalog.Catalog('CAGPXKK12BB06F9DE9') # get existing catalog
>>> c = catalog.Catalog('test_song_catalog', 'song') # get existing or create new catalog
Create a catalog object (get a catalog by ID or get or create one given by name and type)
Example:
>>> c = catalog.Catalog('my_songs', type='song')
>>> c.id
u'CAVKUPC12BCA792120'
>>> c.name
u'my_songs'
>>>
Deletes the entire catalog
Args:
Kwargs:
Example:
>>> c
<catalog - test_song_catalog>
>>> c.delete()
{u'id': u'CAXGUPY12BB087A21D'}
>>>
Returns feed (news, blogs, reviews, audio, video) for the catalog artists; response depends on requested buckets
Args:
buckets (list): A list of strings specifying which feed items to retrieve
results (int): An integer number of results to return
start (int): An integer starting value for the result set
Example:
>>> c
<catalog - my_artists>
>>> c.get_feed(results=15)
{u'date_found': u'2011-02-06T07:50:25',
u'date_posted': u'2011-02-06T07:50:23',
u'id': u'caec686c0dff361e4c53dceb58fb9d2f',
u'name': u'Linkin Park \u2013 \u201cWaiting For The End\u201d + \u201cWhen They Come For Me\u201d 2/5 SNL',
u'references': [{u'artist_id': u'ARQUMH41187B9AF699',
u'artist_name': u'Linkin Park'}],
u'summary': u'<span>Linkin</span> <span>Park</span> performed "Waiting For The End" and "When They Come For Me" on Saturday Night Live. Watch the videos below and pick up their album A Thousand Suns on iTunes, Amazon MP3, CD Social Bookmarking ... ',
u'type': u'blogs',
u'url': u'http://theaudioperv.com/2011/02/06/linkin-park-waiting-for-the-end-when-they-come-for-me-25-snl/'}
>>>
Returns data from the catalog; also expanded for the requested buckets
Args:
buckets (list): A list of strings specifying which buckets to retrieve
results (int): An integer number of results to return
start (int): An integer starting value for the result set
Example:
>>> c
<catalog - my_songs>
>>> c.read_items(results=1)
[
{
"artist_id": "AR78KRI1187B98E6F2",
"artist_name": "Art of Noise",
"date_added": "2012-04-02T16:50:02",
"foreign_id": "CAHLYLR13674D1CF83:song:1000",
"request": {
"artist_name": "The Art Of Noise",
"item_id": "1000",
"song_name": "Love"
},
"song_id": "SOSBCTO1311AFE7AE0",
"song_name": "Love"
}
]
Check the status of a catalog update
Args:
Kwargs:
Example:
>>> c
<catalog - test_song_catalog>
>>> c.profile()
{u'id': u'CAGPXKK12BB06F9DE9',
u'name': u'test_song_catalog',
u'pending_tickets': [],
u'resolved': 2,
u'total': 4,
u'type': u'song'}
>>>
Returns data from the catalog; also expanded for the requested buckets. This method is provided for backwards-compatibility
Args:
buckets (list): A list of strings specifying which buckets to retrieve
results (int): An integer number of results to return
start (int): An integer starting value for the result set
Example:
>>> c
<catalog - my_songs>
>>> c.read_items(results=1)
[<song - Harmonice Mundi II>]
>>>
Check the status of a catalog update
Kwargs:
Example:
>>> ticket
u'7dcad583f2a38e6689d48a792b2e4c96'
>>> c.status(ticket)
{u'ticket_status': u'complete', u'update_info': []}
>>>
Update a catalog object
Kwargs:
Example:
>>> c = catalog.Catalog('my_songs', type='song')
>>> items
[{'action': 'update',
'item': {'artist_name': 'dAn ThE aUtOmAtOr',
'disc_number': 1,
'genre': 'Instrumental',
'item_id': '38937DDF04BC7FC4',
'play_count': 5,
'release': 'Bombay the Hard Way: Guns, Cars & Sitars',
'song_name': 'Inspector Jay From Dehli',
'track_number': 9,
'url': 'file://localhost/Users/tylerw/Music/iTunes/iTunes%20Media/Music/Dan%20the%20Automator/Bombay%20the%20Hard%20Way_%20Guns,%20Cars%20&%20Sitars/09%20Inspector%20Jay%20From%20Dehli.m4a'}}]
>>> ticket = c.update(items)
>>> ticket
u'7dcad583f2a38e6689d48a792b2e4c96'
>>> c.status(ticket)
{u'ticket_status': u'complete', u'update_info': []}
>>>
Returns list of all catalogs created on this API key
Args:
results (int): An integer number of results to return
start (int): An integer starting value for the result set
Example:
>>> catalog.list_catalogs()
[<catalog - test_artist_catalog>, <catalog - test_song_catalog>, <catalog - my_songs>]
>>>