PageRenderTime 906ms CodeModel.GetById 211ms app.highlight 165ms RepoModel.GetById 147ms app.codeStats 236ms

/src/pyechonest/doc/build/html/song.html

http://echo-nest-remix.googlecode.com/
HTML | 478 lines | 456 code | 22 blank | 0 comment | 0 complexity | e7b07fa2fc3c30e74a9db4aad4f7a6d0 MD5 | raw file
  1
  2
  3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  4  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5
  6<html xmlns="http://www.w3.org/1999/xhtml">
  7  <head>
  8    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9    
 10    <title>Song – song methods &mdash; pyechonest v4 documentation</title>
 11    <link rel="stylesheet" href="_static/default.css" type="text/css" />
 12    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
 13    <script type="text/javascript">
 14      var DOCUMENTATION_OPTIONS = {
 15        URL_ROOT:    '',
 16        VERSION:     '4',
 17        COLLAPSE_INDEX: false,
 18        FILE_SUFFIX: '.html',
 19        HAS_SOURCE:  true
 20      };
 21    </script>
 22    <script type="text/javascript" src="_static/jquery.js"></script>
 23    <script type="text/javascript" src="_static/underscore.js"></script>
 24    <script type="text/javascript" src="_static/doctools.js"></script>
 25    <link rel="top" title="pyechonest v4 documentation" href="index.html" />
 26    <link rel="next" title="Track – track methods" href="track.html" />
 27    <link rel="prev" title="Artist – artist methods" href="artist.html" /> 
 28  </head>
 29  <body>
 30    <div class="related">
 31      <h3>Navigation</h3>
 32      <ul>
 33        <li class="right" style="margin-right: 10px">
 34          <a href="genindex.html" title="General Index"
 35             accesskey="I">index</a></li>
 36        <li class="right" >
 37          <a href="py-modindex.html" title="Python Module Index"
 38             >modules</a> |</li>
 39        <li class="right" >
 40          <a href="track.html" title="Track – track methods"
 41             accesskey="N">next</a> |</li>
 42        <li class="right" >
 43          <a href="artist.html" title="Artist – artist methods"
 44             accesskey="P">previous</a> |</li>
 45        <li><a href="index.html">pyechonest v4 documentation</a> &raquo;</li> 
 46      </ul>
 47    </div>  
 48
 49    <div class="document">
 50      <div class="documentwrapper">
 51        <div class="bodywrapper">
 52          <div class="body">
 53            
 54  <div class="section" id="song-song-methods">
 55<h1>Song &#8211; song methods<a class="headerlink" href="#song-song-methods" title="Permalink to this headline">ś</a></h1>
 56<dl class="class">
 57<dt id="pyechonest.song.Song">
 58<em class="property">class </em><tt class="descclassname">pyechonest.song.</tt><tt class="descname">Song</tt><big>(</big><em>id</em>, <em>buckets=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song" title="Permalink to this definition">ś</a></dt>
 59<dd><p>A Song object</p>
 60<dl class="docutils">
 61<dt>Attributes: </dt>
 62<dd><p class="first">id (str): Echo Nest Song ID</p>
 63<p>title (str): Song Title</p>
 64<p>artist_name (str): Artist Name</p>
 65<p>artist_id (str): Artist ID</p>
 66<p>audio_summary (dict): An Audio Summary dict</p>
 67<p>song_hotttnesss (float): A float representing a song&#8217;s hotttnesss</p>
 68<p>artist_hotttnesss (float): A float representing a song&#8217;s parent artist&#8217;s hotttnesss</p>
 69<p>artist_familiarity (float): A float representing a song&#8217;s parent artist&#8217;s familiarity</p>
 70<p class="last">artist_location (dict): A dictionary of strings specifying a song&#8217;s parent artist&#8217;s location, lattitude and longitude</p>
 71</dd>
 72</dl>
 73<p>Create a song object like so:</p>
 74<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOPEXHZ12873FD2AC7&#39;</span><span class="p">)</span>
 75</pre></div>
 76</div>
 77<dl class="method">
 78<dt id="pyechonest.song.Song.__init__">
 79<tt class="descname">__init__</tt><big>(</big><em>id</em>, <em>buckets=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song.__init__" title="Permalink to this definition">ś</a></dt>
 80<dd><p>Song class</p>
 81<dl class="docutils">
 82<dt>Args:</dt>
 83<dd>id (str): a song ID</dd>
 84<dt>Kwargs:</dt>
 85<dd>buckets (list): A list of strings specifying which buckets to retrieve</dd>
 86<dt>Returns:</dt>
 87<dd>A Song object</dd>
 88</dl>
 89<p>Example:</p>
 90<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOPEXHZ12873FD2AC7&#39;</span><span class="p">,</span> <span class="n">buckets</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;song_hotttnesss&#39;</span><span class="p">,</span> <span class="s">&#39;artist_hotttnesss&#39;</span><span class="p">])</span>
 91<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">song_hotttnesss</span>
 92<span class="go">0.58602500000000002</span>
 93<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">artist_hotttnesss</span>
 94<span class="go">0.80329715999999995</span>
 95<span class="gp">&gt;&gt;&gt; </span>
 96</pre></div>
 97</div>
 98</dd></dl>
 99
100<dl class="method">
101<dt id="pyechonest.song.Song.__repr__">
102<tt class="descname">__repr__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyechonest.song.Song.__repr__" title="Permalink to this definition">ś</a></dt>
103<dd></dd></dl>
104
105<dl class="method">
106<dt id="pyechonest.song.Song.__str__">
107<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyechonest.song.Song.__str__" title="Permalink to this definition">ś</a></dt>
108<dd></dd></dl>
109
110<dl class="method">
111<dt id="pyechonest.song.Song.get_artist_familiarity">
112<tt class="descname">get_artist_familiarity</tt><big>(</big><em>cache=True</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song.get_artist_familiarity" title="Permalink to this definition">ś</a></dt>
113<dd><p>Get our numerical estimation of how familiar a song&#8217;s artist currently is to the world</p>
114<dl class="docutils">
115<dt>Args:</dt>
116<dd>cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True.</dd>
117<dt>Returns:</dt>
118<dd>A float representing familiarity.</dd>
119<dt>Example:</dt>
120<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOQKVPH12A58A7AF4D&#39;</span><span class="p">)</span>
121<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">get_artist_familiarity</span><span class="p">()</span>
122<span class="go">0.639626025843539</span>
123<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">artist_familiarity</span>
124<span class="go">0.639626025843539</span>
125<span class="gp">&gt;&gt;&gt; </span>
126</pre></div>
127</div>
128</dd>
129</dl>
130</dd></dl>
131
132<dl class="method">
133<dt id="pyechonest.song.Song.get_artist_hotttnesss">
134<tt class="descname">get_artist_hotttnesss</tt><big>(</big><em>cache=True</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song.get_artist_hotttnesss" title="Permalink to this definition">ś</a></dt>
135<dd><p>Get our numerical description of how hottt a song&#8217;s artist currently is</p>
136<p>Args:</p>
137<dl class="docutils">
138<dt>Kwargs:</dt>
139<dd>cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True.</dd>
140<dt>Returns:</dt>
141<dd>A float representing hotttnesss.</dd>
142<dt>Example:</dt>
143<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOOLGAZ127F3E1B87C&#39;</span><span class="p">)</span>
144<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">artist_hotttnesss</span>
145<span class="go">0.45645633000000002</span>
146<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">get_artist_hotttnesss</span><span class="p">()</span>
147<span class="go">0.45645633000000002</span>
148<span class="gp">&gt;&gt;&gt; </span>
149</pre></div>
150</div>
151</dd>
152</dl>
153</dd></dl>
154
155<dl class="method">
156<dt id="pyechonest.song.Song.get_artist_location">
157<tt class="descname">get_artist_location</tt><big>(</big><em>cache=True</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song.get_artist_location" title="Permalink to this definition">ś</a></dt>
158<dd><p>Get the location of a song&#8217;s artist.</p>
159<dl class="docutils">
160<dt>Args:</dt>
161<dd>cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True.</dd>
162<dt>Returns:</dt>
163<dd>An artist location object.</dd>
164<dt>Example:</dt>
165<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOQKVPH12A58A7AF4D&#39;</span><span class="p">)</span>
166<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">artist_location</span>
167<span class="go">{u&#39;latitude&#39;: 34.053489999999996, u&#39;location&#39;: u&#39;Los Angeles, CA&#39;, u&#39;longitude&#39;: -118.24532000000001}</span>
168<span class="gp">&gt;&gt;&gt; </span>
169</pre></div>
170</div>
171</dd>
172</dl>
173</dd></dl>
174
175<dl class="method">
176<dt id="pyechonest.song.Song.get_audio_summary">
177<tt class="descname">get_audio_summary</tt><big>(</big><em>cache=True</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song.get_audio_summary" title="Permalink to this definition">ś</a></dt>
178<dd><p>Get an audio summary of a song containing mode, tempo, key, duration, time signature, loudness, danceability, energy, and analysis_url.</p>
179<p>Args:</p>
180<dl class="docutils">
181<dt>Kwargs:</dt>
182<dd>cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True.</dd>
183<dt>Returns:</dt>
184<dd>A dictionary containing mode, tempo, key, duration, time signature, loudness, danceability, energy and analysis_url keys.</dd>
185<dt>Example:</dt>
186<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOGNMKX12B0B806320&#39;</span><span class="p">)</span>
187<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">audio_summary</span>
188<span class="go">{u&#39;analysis_url&#39;: u&#39;https://echonest-analysis.s3.amazonaws.com:443/TR/TRCPUOG123E85891F2/3/full.json?Signature=wcML1ZKsl%2F2FU4k68euHJcF7Jbc%3D&amp;Expires=1287518562&amp;AWSAccessKeyId=AKIAIAFEHLM3KJ2XMHRA&#39;,</span>
189<span class="go"> u&#39;danceability&#39;: 0.20964757782725996,</span>
190<span class="go"> u&#39;duration&#39;: 472.63301999999999,</span>
191<span class="go"> u&#39;energy&#39;: 0.64265230549809549,</span>
192<span class="go"> u&#39;key&#39;: 0,</span>
193<span class="go"> u&#39;loudness&#39;: -9.6820000000000004,</span>
194<span class="go"> u&#39;mode&#39;: 1,</span>
195<span class="go"> u&#39;tempo&#39;: 126.99299999999999,</span>
196<span class="go"> u&#39;time_signature&#39;: 4}</span>
197<span class="gp">&gt;&gt;&gt; </span>
198</pre></div>
199</div>
200</dd>
201</dl>
202</dd></dl>
203
204<dl class="method">
205<dt id="pyechonest.song.Song.get_foreign_id">
206<tt class="descname">get_foreign_id</tt><big>(</big><em>idspace=''</em>, <em>cache=True</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song.get_foreign_id" title="Permalink to this definition">ś</a></dt>
207<dd><p>Get the foreign id for this song for a specific id space</p>
208<p>Args:</p>
209<dl class="docutils">
210<dt>Kwargs:</dt>
211<dd>idspace (str): A string indicating the idspace to fetch a foreign id for.</dd>
212<dt>Returns:</dt>
213<dd>A foreign ID string</dd>
214</dl>
215<p>Example:</p>
216<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOYRVMR12AF729F8DC&#39;</span><span class="p">)</span>
217<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">get_foreign_id</span><span class="p">(</span><span class="s">&#39;CAGPXKK12BB06F9DE9&#39;</span><span class="p">)</span>
218</pre></div>
219</div>
220<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span>
221</pre></div>
222</div>
223</dd></dl>
224
225<dl class="method">
226<dt id="pyechonest.song.Song.get_song_hotttnesss">
227<tt class="descname">get_song_hotttnesss</tt><big>(</big><em>cache=True</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song.get_song_hotttnesss" title="Permalink to this definition">ś</a></dt>
228<dd><p>Get our numerical description of how hottt a song currently is</p>
229<p>Args:</p>
230<dl class="docutils">
231<dt>Kwargs:</dt>
232<dd>cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True.</dd>
233<dt>Returns:</dt>
234<dd>A float representing hotttnesss.</dd>
235<dt>Example:</dt>
236<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOLUHKP129F0698D49&#39;</span><span class="p">)</span>
237<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">get_song_hotttnesss</span><span class="p">()</span>
238<span class="go">0.57344379999999995</span>
239<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">song_hotttnesss</span>
240<span class="go">0.57344379999999995</span>
241<span class="gp">&gt;&gt;&gt; </span>
242</pre></div>
243</div>
244</dd>
245</dl>
246</dd></dl>
247
248<dl class="method">
249<dt id="pyechonest.song.Song.get_tracks">
250<tt class="descname">get_tracks</tt><big>(</big><em>catalog</em>, <em>cache=True</em><big>)</big><a class="headerlink" href="#pyechonest.song.Song.get_tracks" title="Permalink to this definition">ś</a></dt>
251<dd><p>Get the tracks for a song given a catalog.</p>
252<dl class="docutils">
253<dt>Args:</dt>
254<dd>catalog (str): a string representing the catalog whose track you want to retrieve.</dd>
255<dt>Returns:</dt>
256<dd>A list of Track dicts.</dd>
257<dt>Example:</dt>
258<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">Song</span><span class="p">(</span><span class="s">&#39;SOWDASQ12A6310F24F&#39;</span><span class="p">)</span>
259<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">get_tracks</span><span class="p">(</span><span class="s">&#39;7digital&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
260<span class="go">{u&#39;catalog&#39;: u&#39;7digital&#39;,</span>
261<span class="go"> u&#39;foreign_id&#39;: u&#39;7digital:track:8445818&#39;,</span>
262<span class="go"> u&#39;id&#39;: u&#39;TRJGNNY12903CC625C&#39;,</span>
263<span class="go"> u&#39;preview_url&#39;: u&#39;http://previews.7digital.com/clips/34/8445818.clip.mp3&#39;,</span>
264<span class="go"> u&#39;release_image&#39;: u&#39;http://cdn.7static.com/static/img/sleeveart/00/007/628/0000762838_200.jpg&#39;}</span>
265<span class="gp">&gt;&gt;&gt; </span>
266</pre></div>
267</div>
268</dd>
269</dl>
270</dd></dl>
271
272</dd></dl>
273
274<dl class="staticmethod">
275<dt id="pyechonest.song.identify">
276<em class="property">static </em><tt class="descclassname">song.</tt><tt class="descname">identify</tt><big>(</big><em>filename=None</em>, <em>query_obj=None</em>, <em>code=None</em>, <em>artist=None</em>, <em>title=None</em>, <em>release=None</em>, <em>duration=None</em>, <em>genre=None</em>, <em>buckets=None</em>, <em>codegen_start=0</em>, <em>codegen_duration=30</em><big>)</big><a class="headerlink" href="#pyechonest.song.identify" title="Permalink to this definition">ś</a></dt>
277<dd><p>Identify a song.</p>
278<p>Args:</p>
279<dl class="docutils">
280<dt>Kwargs:</dt>
281<dd><p class="first">filename (str): The path of the file you want to analyze (requires codegen binary!)</p>
282<p>query_obj (dict or list): A dict or list of dicts containing a &#8216;code&#8217; element with an fp code</p>
283<p>code (str): A fingerprinter code</p>
284<p>artist (str): An artist name</p>
285<p>title (str): A song title</p>
286<p>release (str): A release name</p>
287<p>duration (int): A song duration</p>
288<p>genre (str): A string representing the genre</p>
289<p>buckets (list): A list of strings specifying which buckets to retrieve</p>
290<p>codegen_start (int): The point (in seconds) where the codegen should start</p>
291<p class="last">codegen_duration (int): The duration (in seconds) the codegen should analyze</p>
292</dd>
293<dt>Example:</dt>
294<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">qo</span>
295<span class="go">{&#39;code&#39;: &#39;eJxlldehHSEMRFsChAjlAIL-S_CZvfaXXxAglEaBTen300Qu__lAyoJYhVQdXTvXrmvXdTsKZOqoU1q63QNydBGfOd1cGX3scpb1jEiWRLaPcJureC6RVkXE69jL8pGHjpP48pLI1m7r9oiEyBXvoVv45Q-5IhylYLkIRxGO4rp18ZpEOmpFPopwfJjL0u3WceO3HB1DIvJRnkQeO1PCLIsIjBWEzYaShq4pV9Z0KzDiQ8SbSNuSyBZPOOxIJKR7dauEmXwotxDCqllEAVZlrX6F8Y-IJ0e169i_HQaqslaVtTq1W-1vKeupImzrxWWVI5cPlw-XDxckN-3kyeXDm3jKmqv6PtB1gfH1Eey5qu8qvAuMC4zLfPv1l3aqviylJhytFhF0mzqs6aYpYU04mlqgKWtNjppwNKWubR2FowlHUws0gWmPi668dSHq6rOuPuhqgRcVKKM8s-fZS937nBe23iz3Uctx9607z-kLph1i8YZ8f_TfzLXseBh7nXy9nn1YBAg4Nwjp4AzTL23M_U3Rh0-sdDFtyspNOb1bYeZZqz2Y6TaHmXeuNmfFdTueLuvdsbOU9luvtIkl4vI5F_92PVprM1-sdJ_o9_Guc0b_WimpD_Rt1DFg0sY3wyw08e6jlqhjH3o76naYvzWqhX9rOv15Y7Ww_MIF8dXzw30s_uHO5PPDfUonnzq_NJ8J93mngAkIz5jA29SqxGwwvxQsih-sozX0zVk__RFaf_qyG9hb8dktZZXd4a8-1ljB-c5bllXOe1HqHplzeiN4E7q9ZRdmJuI73gBEJ_HcAxUm74PAVDNL47D6OAfzTHI0mHpXAmY60QNmlqjDfIPzwUDYhVnoXqtvZGrBdMi3ClQUQ8D8rX_1JE_In94CBXER4lrrw0H867ei8x-OVz8c-Osh5plzTOySpKIROmFkbn5xVuK784vTyPpS3OlcSjHpL16saZnm4Bk66hte9sd80Dcj02f7xDVrExjk32cssKXjmflU_SxXmn4Y9Ttued10YM552h5Wtt_WeVR4U6LPWfbIdW31J4JOXnpn4qhH7yE_pdBH9E_sMwbNFr0z0IW5NA8aOZhLmOh3zSVNRZwxiZc5pb8fikGzIf-ampJnCSb3r-ZPfjPuvLm7CY_Vfa_k7SCzdwHNg5mICTSHDxyBWmaOSyLQpPmCSXyF-eL7MHo7zNd668JMb_N-AJJRuMwrX0jNx7a8-Rj5oN6nyWoL-jRv4pu7Ue821TzU3MhvpD9Fo-XI&#39;,</span>
296<span class="go"> &#39;code_count&#39;: 151,</span>
297<span class="go"> &#39;low_rank&#39;: 0,</span>
298<span class="go"> &#39;metadata&#39;: {&#39;artist&#39;: &#39;Harmonic 313&#39;,</span>
299<span class="go">              &#39;bitrate&#39;: 198,</span>
300<span class="go">              &#39;codegen_time&#39;: 0.57198400000000005,</span>
301<span class="go">              &#39;decode_time&#39;: 0.37954599999999999,</span>
302<span class="go">              &#39;duration&#39;: 226,</span>
303<span class="go">              &#39;filename&#39;: &#39;koln.mp3&#39;,</span>
304<span class="go">              &#39;genre&#39;: &#39;Electronic&#39;,</span>
305<span class="go">              &#39;given_duration&#39;: 30,</span>
306<span class="go">              &#39;release&#39;: &#39;When Machines Exceed Human Intelligence&#39;,</span>
307<span class="go">              &#39;sample_rate&#39;: 44100,</span>
308<span class="go">              &#39;samples_decoded&#39;: 661816,</span>
309<span class="go">              &#39;start_offset&#39;: 0,</span>
310<span class="go">              &#39;title&#39;: &#39;kln&#39;,</span>
311<span class="go">              &#39;version&#39;: 3.1499999999999999},</span>
312<span class="go"> &#39;tag&#39;: 0}</span>
313<span class="gp">&gt;&gt;&gt; </span><span class="n">song</span><span class="o">.</span><span class="n">identify</span><span class="p">(</span><span class="n">query_obj</span><span class="o">=</span><span class="n">qo</span><span class="p">)</span>
314<span class="go">[&lt;song - Köln&gt;]</span>
315<span class="gp">&gt;&gt;&gt; </span>
316</pre></div>
317</div>
318</dd>
319</dl>
320</dd></dl>
321
322<dl class="staticmethod">
323<dt id="pyechonest.song.search">
324<em class="property">static </em><tt class="descclassname">song.</tt><tt class="descname">search</tt><big>(</big><em>title=None</em>, <em>artist=None</em>, <em>artist_id=None</em>, <em>combined=None</em>, <em>description=None</em>, <em>style=None</em>, <em>mood=None</em>, <em>results=None</em>, <em>start=None</em>, <em>max_tempo=None</em>, <em>min_tempo=None</em>, <em>max_duration=None</em>, <em>min_duration=None</em>, <em>max_loudness=None</em>, <em>min_loudness=None</em>, <em>artist_max_familiarity=None</em>, <em>artist_min_familiarity=None</em>, <em>artist_max_hotttnesss=None</em>, <em>artist_min_hotttnesss=None</em>, <em>song_max_hotttnesss=None</em>, <em>song_min_hotttnesss=None</em>, <em>mode=None</em>, <em>min_energy=None</em>, <em>max_energy=None</em>, <em>min_danceability=None</em>, <em>max_danceability=None</em>, <em>key=None</em>, <em>max_latitude=None</em>, <em>min_latitude=None</em>, <em>max_longitude=None</em>, <em>min_longitude=None</em>, <em>sort=None</em>, <em>buckets=None</em>, <em>limit=False</em>, <em>test_new_things=None</em>, <em>rank_type=None</em><big>)</big><a class="headerlink" href="#pyechonest.song.search" title="Permalink to this definition">ś</a></dt>
325<dd><p>Search for songs by name, description, or constraint.</p>
326<p>Args:</p>
327<dl class="docutils">
328<dt>Kwargs:</dt>
329<dd><p class="first">title (str): the name of a song</p>
330<p>artist (str): the name of an artist</p>
331<p>artist_id (str): the artist_id</p>
332<p>combined (str): the artist name and song title</p>
333<p>description (str): A string describing the artist and song</p>
334<p>style (str): A string describing the style/genre of the artist and song</p>
335<p>mood (str): A string describing the mood of the artist and song</p>
336<p>results (int): An integer number of results to return</p>
337<p>max_tempo (float): The max tempo of song results</p>
338<p>min_tempo (float): The min tempo of song results</p>
339<p>max_duration (float): The max duration of song results</p>
340<p>min_duration (float): The min duration of song results</p>
341<p>max_loudness (float): The max loudness of song results</p>
342<p>min_loudness (float): The min loudness of song results</p>
343<p>artist_max_familiarity (float): A float specifying the max familiarity of artists to search for</p>
344<p>artist_min_familiarity (float): A float specifying the min familiarity of artists to search for</p>
345<p>artist_max_hotttnesss (float): A float specifying the max hotttnesss of artists to search for</p>
346<p>artist_min_hotttnesss (float): A float specifying the max hotttnesss of artists to search for</p>
347<p>song_max_hotttnesss (float): A float specifying the max hotttnesss of songs to search for</p>
348<p>song_min_hotttnesss (float): A float specifying the max hotttnesss of songs to search for</p>
349<p>max_energy (float): The max energy of song results</p>
350<p>min_energy (float): The min energy of song results</p>
351<p>max_dancibility (float): The max dancibility of song results</p>
352<p>min_dancibility (float): The min dancibility of song results</p>
353<p>mode (int): 0 or 1 (minor or major)</p>
354<p>key (int): 0-11 (c, c-sharp, d, e-flat, e, f, f-sharp, g, a-flat, a, b-flat, b)</p>
355<p>max_latitude (float): A float specifying the max latitude of artists to search for</p>
356<p>min_latitude (float): A float specifying the min latitude of artists to search for</p>
357<p>max_longitude (float): A float specifying the max longitude of artists to search for</p>
358<p>min_longitude (float): A float specifying the min longitude of artists to search for</p>
359<p>sort (str): A string indicating an attribute and order for sorting the results</p>
360<p>buckets (list): A list of strings specifying which buckets to retrieve</p>
361<p>limit (bool): A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets</p>
362<p class="last">rank_type (str): A string denoting the desired ranking for description searches, either &#8216;relevance&#8217; or &#8216;familiarity&#8217;</p>
363</dd>
364<dt>Returns:</dt>
365<dd>A list of Song objects</dd>
366</dl>
367<p>Example:</p>
368<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">results</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">artist</span><span class="o">=</span><span class="s">&#39;shakira&#39;</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="s">&#39;she wolf&#39;</span><span class="p">,</span> <span class="n">buckets</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;id:7digital&#39;</span><span class="p">,</span> <span class="s">&#39;tracks&#39;</span><span class="p">],</span> <span class="n">limit</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">results</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
369<span class="gp">&gt;&gt;&gt; </span><span class="n">results</span>
370<span class="go">[&lt;song - She Wolf&gt;]</span>
371<span class="gp">&gt;&gt;&gt; </span><span class="n">results</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">get_tracks</span><span class="p">(</span><span class="s">&#39;7digital&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
372<span class="go">{u&#39;catalog&#39;: u&#39;7digital&#39;,</span>
373<span class="go"> u&#39;foreign_id&#39;: u&#39;7digital:track:7854109&#39;,</span>
374<span class="go"> u&#39;id&#39;: u&#39;TRTOBSE12903CACEC4&#39;,</span>
375<span class="go"> u&#39;preview_url&#39;: u&#39;http://previews.7digital.com/clips/34/7854109.clip.mp3&#39;,</span>
376<span class="go"> u&#39;release_image&#39;: u&#39;http://cdn.7static.com/static/img/sleeveart/00/007/081/0000708184_200.jpg&#39;}</span>
377<span class="gp">&gt;&gt;&gt; </span>
378</pre></div>
379</div>
380</dd></dl>
381
382<dl class="staticmethod">
383<dt id="pyechonest.song.profile">
384<em class="property">static </em><tt class="descclassname">song.</tt><tt class="descname">profile</tt><big>(</big><em>ids</em>, <em>buckets=None</em>, <em>limit=False</em><big>)</big><a class="headerlink" href="#pyechonest.song.profile" title="Permalink to this definition">ś</a></dt>
385<dd><p>get the profiles for multiple songs at once</p>
386<dl class="docutils">
387<dt>Args:</dt>
388<dd>ids (str or list): a song ID or list of song IDs</dd>
389<dt>Kwargs:</dt>
390<dd><p class="first">buckets (list): A list of strings specifying which buckets to retrieve</p>
391<p class="last">limit (bool): A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets</p>
392</dd>
393<dt>Returns:</dt>
394<dd>A list of term document dicts</dd>
395</dl>
396<p>Example:</p>
397<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">song_ids</span> <span class="o">=</span> <span class="p">[</span><span class="s">u&#39;SOGNMKX12B0B806320&#39;</span><span class="p">,</span> <span class="s">u&#39;SOLUHKP129F0698D49&#39;</span><span class="p">,</span> <span class="s">u&#39;SOOLGAZ127F3E1B87C&#39;</span><span class="p">,</span> <span class="s">u&#39;SOQKVPH12A58A7AF4D&#39;</span><span class="p">,</span> <span class="s">u&#39;SOHKEEM1288D3ED9F5&#39;</span><span class="p">]</span>
398<span class="gp">&gt;&gt;&gt; </span><span class="n">songs</span> <span class="o">=</span> <span class="n">song</span><span class="o">.</span><span class="n">profile</span><span class="p">(</span><span class="n">song_ids</span><span class="p">,</span> <span class="n">buckets</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;audio_summary&#39;</span><span class="p">])</span>
399<span class="go">[&lt;song - chickfactor&gt;,</span>
400<span class="go"> &lt;song - One Step Closer&gt;,</span>
401<span class="go"> &lt;song - And I Am Telling You I&#39;m Not Going (Glee Cast Version)&gt;,</span>
402<span class="go"> &lt;song - In This Temple As In The Hearts Of Man For Whom He Saved The Earth&gt;,</span>
403<span class="go"> &lt;song - Octet&gt;]</span>
404<span class="gp">&gt;&gt;&gt; </span><span class="n">songs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">audio_summary</span>
405<span class="go">{u&#39;analysis_url&#39;: u&#39;https://echonest-analysis.s3.amazonaws.com:443/TR/TRKHTDL123E858AC4B/3/full.json?Signature=sE6OwAzg6UvrtiX6nJJW1t7E6YI%3D&amp;Expires=1287585351&amp;AWSAccessKeyId=AKIAIAFEHLM3KJ2XMHRA&#39;,</span>
406<span class="go"> u&#39;danceability&#39;: None,</span>
407<span class="go"> u&#39;duration&#39;: 211.90485000000001,</span>
408<span class="go"> u&#39;energy&#39;: None,</span>
409<span class="go"> u&#39;key&#39;: 7,</span>
410<span class="go"> u&#39;loudness&#39;: -16.736999999999998,</span>
411<span class="go"> u&#39;mode&#39;: 1,</span>
412<span class="go"> u&#39;tempo&#39;: 94.957999999999998,</span>
413<span class="go"> u&#39;time_signature&#39;: 4}</span>
414<span class="gp">&gt;&gt;&gt; </span>
415</pre></div>
416</div>
417</dd></dl>
418
419</div>
420
421
422          </div>
423        </div>
424      </div>
425      <div class="sphinxsidebar">
426        <div class="sphinxsidebarwrapper">
427  <h4>Previous topic</h4>
428  <p class="topless"><a href="artist.html"
429                        title="previous chapter">Artist &#8211; artist methods</a></p>
430  <h4>Next topic</h4>
431  <p class="topless"><a href="track.html"
432                        title="next chapter">Track &#8211; track methods</a></p>
433  <h3>This Page</h3>
434  <ul class="this-page-menu">
435    <li><a href="_sources/song.txt"
436           rel="nofollow">Show Source</a></li>
437  </ul>
438<div id="searchbox" style="display: none">
439  <h3>Quick search</h3>
440    <form class="search" action="search.html" method="get">
441      <input type="text" name="q" size="18" />
442      <input type="submit" value="Go" />
443      <input type="hidden" name="check_keywords" value="yes" />
444      <input type="hidden" name="area" value="default" />
445    </form>
446    <p class="searchtip" style="font-size: 90%">
447    Enter search terms or a module, class or function name.
448    </p>
449</div>
450<script type="text/javascript">$('#searchbox').show(0);</script>
451        </div>
452      </div>
453      <div class="clearer"></div>
454    </div>
455    <div class="related">
456      <h3>Navigation</h3>
457      <ul>
458        <li class="right" style="margin-right: 10px">
459          <a href="genindex.html" title="General Index"
460             >index</a></li>
461        <li class="right" >
462          <a href="py-modindex.html" title="Python Module Index"
463             >modules</a> |</li>
464        <li class="right" >
465          <a href="track.html" title="Track – track methods"
466             >next</a> |</li>
467        <li class="right" >
468          <a href="artist.html" title="Artist – artist methods"
469             >previous</a> |</li>
470        <li><a href="index.html">pyechonest v4 documentation</a> &raquo;</li> 
471      </ul>
472    </div>
473    <div class="footer">
474        &copy; Copyright 2010, The Echo Nest.
475      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.5.
476    </div>
477  </body>
478</html>