Last active
January 3, 2016 11:09
-
-
Save plamere/8454347 to your computer and use it in GitHub Desktop.
Get similar genres to any genre
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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