Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python :: passing a list as parameter

responses in pyen, a thin library for music data, returns dictionaries in this fashion:

{u'id': u'AR6SPRZ1187FB4958B', u'name': u'Wilco'}

I'm looping through and printing artists:

response = en.get('artist/search', artist_location='Chicago')

artists = response['artists']
for artist in artists:
   sys.stdout.write("song by {}\n".format(artist['name']))

but I'd like to pass a list of ids here:

  response = en.get('song/search', artist_ids = ?) //pass a list here?
  for song in response['songs']:
  sys.stdout.write("\t{}\n".format(song['title']))

Is this possible? How?

like image 689
8-Bit Borges Avatar asked Jul 25 '26 06:07

8-Bit Borges


1 Answers

pyen is a very thin wrapper, you should always check the EchoNest API docs directly. According to the API documentation, the song/search endpoint does not accept multiple artist_ids.

like image 86
alecxe Avatar answered Jul 28 '26 14:07

alecxe