Skip to content

Instantly share code, notes, and snippets.

@plamere
Last active January 3, 2016 11:09
Embed
What would you like to do?
Get similar genres to any genre
import pyen
import sys
en = pyen.Pyen()
if len(sys.argv) > 1:
genre = ' '.join(sys.argv[1:])
response = en.get('genre/similar', name=genre)
for genre in response['genres']:
print genre['name']
else:
print "usage: python sim_genres.py genre name"
@plamere
Copy link
Author

plamere commented Jan 16, 2014

Sample output:

% python sim_genres.py cool jazz
bebop
jazz
hard bop
contemporary post-bop
soul jazz
big band
jazz christmas
stride
jazz funk
jazz fusion
avant-garde jazz
free jazz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment