Package pyechonest :: Module artist
[hide private]
[frames] | no frames]

Module artist

source code

Copyright (c) 2010 The Echo Nest. All rights reserved. Created by Tyler Williams on 2010-04-25.

The Artist module loosely covers http://developer.echonest.com/docs/v4/artist.html Refer to the official api documentation if you are unsure about something.

Classes [hide private]
  Artist
An Artist object
Functions [hide private]
 
search(name=None, description=None, style=None, mood=None, start=0, results=15, buckets=None, limit=False, fuzzy_match=False, sort=None, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None, test_new_things=None, rank_type=None, artist_start_year_after=None, artist_start_year_before=None, artist_end_year_after=None, artist_end_year_before=None)
Search for artists by name, description, or constraint.
source code
 
top_hottt(start=0, results=15, buckets=None, limit=False)
Get the top hotttest artists, according to The Echo Nest
source code
 
top_terms(results=15)
Get a list of the top overall terms
source code
 
list_terms(type)
Get a list of best terms to use with search
source code
 
similar(names=None, ids=None, start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None, seed_catalog=None, artist_start_year_before=None, artist_start_year_after=None, artist_end_year_before=None, artist_end_year_after=None)
Return similar artists to this one
source code
 
extract(text='', start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None)
Extract artist names from a block of text.
source code
 
suggest(q='', results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None)
Suggest artists based upon partial names.
source code
Variables [hide private]
  __package__ = 'pyechonest'
Function Details [hide private]

search(name=None, description=None, style=None, mood=None, start=0, results=15, buckets=None, limit=False, fuzzy_match=False, sort=None, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None, test_new_things=None, rank_type=None, artist_start_year_after=None, artist_start_year_before=None, artist_end_year_after=None, artist_end_year_before=None)

source code 

Search for artists by name, description, or constraint.

Args:

Kwargs:

name (str): the name of an artist

description (str): A string describing the artist

style (str): A string describing the style/genre of the artist

mood (str): A string describing the mood of the artist

start (int): An integer starting value for the result set

results (int): An integer number of results to return

buckets (list): A list of strings specifying which buckets to retrieve

limit (bool): A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets

fuzzy_match (bool): A boolean indicating whether or not to search for similar sounding matches (only works with name)

max_familiarity (float): A float specifying the max familiarity of artists to search for

min_familiarity (float): A float specifying the min familiarity of artists to search for

max_hotttnesss (float): A float specifying the max hotttnesss of artists to search for

min_hotttnesss (float): A float specifying the max hotttnesss of artists to search for

artist_start_year_before (int): Returned artists will have started recording music before this year.

artist_start_year_after (int): Returned artists will have started recording music after this year.

artist_end_year_before (int): Returned artists will have stopped recording music before this year.

artist_end_year_after (int): Returned artists will have stopped recording music after this year.

rank_type (str): A string denoting the desired ranking for description searches, either 'relevance' or 'familiarity'

Returns:
A list of Artist objects

Example:

>>> results = artist.search(name='t-pain')
>>> results
[<artist - T-Pain>, <artist - T-Pain & Lil Wayne>, <artist - T Pain & 2 Pistols>, <artist - Roscoe Dash & T-Pain>, <artist - Tony Moxberg & T-Pain>, <artist - Flo-Rida (feat. T-Pain)>, <artist - Shortyo/Too Short/T-Pain>]
>>>

top_hottt(start=0, results=15, buckets=None, limit=False)

source code 

Get the top hotttest artists, according to The Echo Nest

Args:

Kwargs:

results (int): An integer number of results to return

start (int): An integer starting value for the result set

buckets (list): A list of strings specifying which buckets to retrieve

limit (bool): A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets

Returns:
A list of hottt Artist objects

Example:

>>> hot_stuff = artist.top_hottt()
>>> hot_stuff
[<artist - Deerhunter>, <artist - Sufjan Stevens>, <artist - Belle and Sebastian>, <artist - Glee Cast>, <artist - Linkin Park>, <artist - Neil Young>, <artist - Jimmy Eat World>, <artist - Kanye West>, <artist - Katy Perry>, <artist - Bruno Mars>, <artist - Lady Gaga>, <artist - Rihanna>, <artist - Lil Wayne>, <artist - Jason Mraz>, <artist - Green Day>]
>>>

top_terms(results=15)

source code 

Get a list of the top overall terms

Args:

Kwargs:
results (int): An integer number of results to return
Returns:
A list of term document dicts

Example:

>>> terms = artist.top_terms(results=5)
>>> terms
[{u'frequency': 1.0, u'name': u'rock'},
 {u'frequency': 0.99054710039307992, u'name': u'electronic'},
 {u'frequency': 0.96131624654034398, u'name': u'hip hop'},
 {u'frequency': 0.94358477322411127, u'name': u'jazz'},
 {u'frequency': 0.94023302416455468, u'name': u'pop rock'}]
>>>

list_terms(type)

source code 

Get a list of best terms to use with search

Args:

Kwargs:
type (str): the type of term to return, either 'mood' or 'style'

Example:

>>> best_terms = artist.list_terms('mood')
>>> best_terms
[{u'name': u'aggressive'},
 {u'name': u'ambient'},
 {u'name': u'angry'},
 {u'name': u'angst-ridden'},
 {u'name': u'bouncy'},
 {u'name': u'calming'},
 {u'name': u'carefree'}, etc.]

similar(names=None, ids=None, start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None, seed_catalog=None, artist_start_year_before=None, artist_start_year_after=None, artist_end_year_before=None, artist_end_year_after=None)

source code 

Return similar artists to this one

Args:

Kwargs:

ids (str/list): An artist id or list of ids

names (str/list): An artist name or list of names

results (int): An integer number of results to return

buckets (list): A list of strings specifying which buckets to retrieve

limit (bool): A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets

start (int): An integer starting value for the result set

max_familiarity (float): A float specifying the max familiarity of artists to search for

min_familiarity (float): A float specifying the min familiarity of artists to search for

max_hotttnesss (float): A float specifying the max hotttnesss of artists to search for

min_hotttnesss (float): A float specifying the max hotttnesss of artists to search for

seed_catalog (str): A string specifying the catalog similar artists are restricted to

Returns:
A list of similar Artist objects

Example:

>>> some_dudes = [artist.Artist('weezer'), artist.Artist('radiohead')]
>>> some_dudes
[<artist - Weezer>, <artist - Radiohead>]
>>> sims = artist.similar(ids=[art.id for art in some_dudes], results=5)
>>> sims
[<artist - The Smashing Pumpkins>, <artist - Biffy Clyro>, <artist - Death Cab for Cutie>, <artist - Jimmy Eat World>, <artist - Nerf Herder>]
>>>

extract(text='', start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None)

source code 

Extract artist names from a block of text.

Args:

Kwargs:

text (str): The text to extract artists from

start (int): An integer starting value for the result set

results (int): An integer number of results to return

buckets (list): A list of strings specifying which buckets to retrieve

limit (bool): A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets

max_familiarity (float): A float specifying the max familiarity of artists to search for

min_familiarity (float): A float specifying the min familiarity of artists to search for

max_hotttnesss (float): A float specifying the max hotttnesss of artists to search for

min_hotttnesss (float): A float specifying the max hotttnesss of artists to search for

Returns:
A list of Artist objects

Example:

>>> results = artist.extract(text='i saw beyonce at burger king, she was eatin, she was eatin')
>>> results
>>>

suggest(q='', results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None, max_hotttnesss=None, min_hotttnesss=None)

source code 

Suggest artists based upon partial names.

Args:

Kwargs:

q (str): The text to suggest artists from

results (int): An integer number of results to return

buckets (list): A list of strings specifying which buckets to retrieve

limit (bool): A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets

max_familiarity (float): A float specifying the max familiarity of artists to search for

min_familiarity (float): A float specifying the min familiarity of artists to search for

max_hotttnesss (float): A float specifying the max hotttnesss of artists to search for

min_hotttnesss (float): A float specifying the max hotttnesss of artists to search for

Returns:
A list of Artist objects

Example:

>>> results = artist.suggest(text='rad')
>>> results
>>>