Skip to content

Instantly share code, notes, and snippets.

@plamere
Last active January 3, 2016 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plamere/8454347 to your computer and use it in GitHub Desktop.
Save plamere/8454347 to your computer and use it in GitHub Desktop.
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