Skip to content

Instantly share code, notes, and snippets.

@plamere

plamere/sim_genres.py

Last active Jan 3, 2016
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

This comment has been minimized.

Copy link
Owner Author

@plamere 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
You can’t perform that action at this time.