How to get Series information for a release #150
-
Some releases belong to Series, is there a way you can get the series information? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Can you share a release ID that contains a series? I think >>> import discogs_client
>>> d = discogs_client.Client('TestREPL/0.1')
>>> release = d.release(1026691)
>>> print(release.id)
1026691
>>> print(release.fetch('series'))
[]
>>> |
Beta Was this translation helpful? Give feedback.
-
Without knowing what you want to script, a basic Python program might look like this. You could wrap it in a try / except if a given release doesn't have a series, but you just want to make sure you account for the list and the dictionary inside it: import discogs_client
d = discogs_client.Client('SeriesTest/0.1')
release = d.release(31125881)
series_info = release.fetch('series')
print(series_info)
series_id = series_info[0]['id']
series_name = series_info[0]['name']
print('Series name: ', series_name, 'Series ID: ', series_id) And that returns: [{'name': 'Now Yearbook', 'catno': "'93", 'entity_type': '2', 'entity_type_name': 'Series', 'id': 2583262, 'resource_url': 'https://api.discogs.com/labels/2583262'}]
Series name: Now Yearbook Series ID: 2583262 |
Beta Was this translation helpful? Give feedback.
Without knowing what you want to script, a basic Python program might look like this. You could wrap it in a try / except if a given release doesn't have a series, but you just want to make sure you account for the list and the dictionary inside it:
And that returns: