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

Module track

source code

Classes [hide private]
  Track
Represents an audio analysis from The Echo Nest.
Functions [hide private]
 
_wait_for_pending_track(trid, timeout) source code
 
_track_from_response(result, timeout=300)
This is the function that actually creates the track object
source code
 
_upload(param_dict, timeout, data=None)
Calls upload either with a local audio file, or a url. Returns a track object.
source code
 
_profile(param_dict) source code
 
_analyze(param_dict, timeout) source code
 
_track_from_data(audio_data, filetype, timeout) source code
 
track_from_file(file_object, filetype, timeout=300)
Create a track object from a file-like object.
source code
 
track_from_filename(filename, filetype=None, timeout=300)
Create a track object from a filename.
source code
 
track_from_url(url, timeout=300)
Create a track object from a public http URL.
source code
 
track_from_id(identifier)
Create a track object from an Echo Nest track ID.
source code
 
track_from_md5(md5)
Create a track object from an md5 hash.
source code
 
track_from_reanalyzing_id(identifier, timeout=300)
Create a track object from an Echo Nest track ID, reanalyzing the track first.
source code
 
track_from_reanalyzing_md5(md5, timeout=300)
Create a track object from an md5 hash, reanalyzing the track first.
source code
Variables [hide private]
  DEFAULT_ASYNC_TIMEOUT = 300
  __package__ = 'pyechonest'
Function Details [hide private]

track_from_file(file_object, filetype, timeout=300)

source code 

Create a track object from a file-like object.

Args:
file_object: a file-like Python object filetype: the file type (ex. mp3, ogg, wav)
Example:
>>> f = open("Miaow-01-Tempered-song.mp3")
>>> t = track.track_from_file(f, 'mp3')
>>> t
< Track >
>>>

track_from_filename(filename, filetype=None, timeout=300)

source code 

Create a track object from a filename.

Args:
filename: A string containing the path to the input file. filetype: A string indicating the filetype; Defaults to None (type determined by file extension).
Example:
>>> t = track.track_from_filename("Miaow-01-Tempered-song.mp3")
>>> t
< Track >
>>>

track_from_url(url, timeout=300)

source code 

Create a track object from a public http URL.

Args:
url: A string giving the URL to read from. This must be on a public machine accessible by HTTP.
Example:
>>> t = track.track_from_url("http://www.miaowmusic.com/mp3/Miaow-01-Tempered-song.mp3")
>>> t
< Track >
>>>

track_from_id(identifier)

source code 

Create a track object from an Echo Nest track ID.

Args:
identifier: A string containing the ID of a previously analyzed track.
Example:
>>> t = track.track_from_id("TRWFIDS128F92CC4CA")
>>> t
<track - Let The Spirit>
>>>

track_from_md5(md5)

source code 

Create a track object from an md5 hash.

Args:
md5: A string 32 characters long giving the md5 checksum of a track already analyzed.
Example:
>>> t = track.track_from_md5('b8abf85746ab3416adabca63141d8c2d')
>>> t
<track - Neverwas Restored (from Neverwas Soundtrack)>
>>>

track_from_reanalyzing_id(identifier, timeout=300)

source code 

Create a track object from an Echo Nest track ID, reanalyzing the track first.

Args:
identifier (str): A string containing the ID of a previously analyzed track
Example:
>>> t = track.track_from_reanalyzing_id('TRXXHTJ1294CD8F3B3')
>>> t
<track - Neverwas Restored>
>>>

track_from_reanalyzing_md5(md5, timeout=300)

source code 

Create a track object from an md5 hash, reanalyzing the track first.

Args:
md5 (str): A string containing the md5 of a previously analyzed track
Example:
>>> t = track.track_from_reanalyzing_md5('b8abf85746ab3416adabca63141d8c2d')
>>> t
<track - Neverwas Restored>
>>>