discogs_client brief overview:
In [1]:
import discogs_client
In [4]:
token = open('./token.txt').readline().strip()
In [5]:
print token
In [6]:
d = discogs_client.Client('MusicDBCreater/0.1', user_token=token)
Search for a particular release:
In [75]:
results = d.search('Bob Dylan - Time Out of Mind', type = 'release')
In [76]:
type(results)
Out[76]:
In [77]:
len(results)
Out[77]:
In [78]:
print type(results[0]), results[0]
Go to https://github.com/discogs/discogs_client/blob/master/discogs_client/models.py to find out about the different API objects, including the Release class object
In [79]:
r = results[0]
In [80]:
print r.title
In [81]:
print r.year
In [82]:
print r.artists[0]
In [83]:
print r.genres
In [84]:
print r.credits
In [85]:
print r.tracklist[0].position
In [86]:
print r.formats
In [87]:
print results[2].tracklist[0].position
In [88]:
print r.companies
In [89]:
print r.labels
In [90]:
print r.id
Can go to https://www.discogs.com/Bob-Dylan-Time-Out-Of-Mind/release/954191 to check the given release and how this information appears on their website
In [ ]: