echonest / pyechonest Goto Github PK
View Code? Open in Web Editor NEWPython client for the Echo Nest API
Home Page: http://echonest.github.com/pyechonest/
License: BSD 3-Clause "New" or "Revised" License
Python client for the Echo Nest API
Home Page: http://echonest.github.com/pyechonest/
License: BSD 3-Clause "New" or "Revised" License
Occasionally I am hitting this error:
File "/usr/local/lib/python2.7/dist-packages/pyechonest-4.2.21-py2.7.egg/pyechonest/song.py", line 109, in get_audio_summary
self.cache['audio_summary'] = response['songs'][0]['audio_summary']
IndexError: list index out of range
I expect that due to the migration of Echonest API to Spotify API, I'm now getting an error when I try to retrieve an audio_analysis
object.
But I'm not sure how or where to change the API I'm calling from the Echonest API to the Spotify API.
The code is basically:
from echonest.remix.audio import AudioAnalysis
AudioAnalysis(str(track_md5))
Will pyechonest and remix still work? And if so, where do I need to make configuration changes?
I imagine I am missing something obvious.
diff --git a/examples/show_tempos.py b/examples/show_tempos.py
--- a/examples/show_tempos.py
+++ b/examples/show_tempos.py
@@ -3,18 +3,18 @@
import sys
import os
-import eyeD3
+import eyed3.id3
import tempo
def show_tempo(mp3):
"given an mp3, print out the artist, title and tempo of the song"
- tag = eyeD3.Tag()
- tag.link(mp3)
- my_tempo = tempo.get_tempo(tag.getArtist(), tag.getTitle())
+ tag = eyed3.id3.Tag()
+ tag.parse(mp3)
+ my_tempo = tempo.get_tempo(tag.artist, tag.title)
print 'File: ', mp3
- print 'Artist:', tag.getArtist()
- print 'Title: ', tag.getTitle()
+ print 'Artist:', tag.artist
+ print 'Title: ', tag.title
print 'Tempo: ', my_tempo
print
[x] Bug (Typo)
ingteger
, however expect to see integer
.hotttest
, however expect to see hottest
.Semi-automated issue generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md
To avoid wasting CI processing resources a branch with the fix has been
prepared but a pull request has not yet been created. A pull request fixing
the issue can be prepared from the link below, feel free to create it or
request @timgates42 create the PR.
https://github.com/timgates42/pyechonest/pull/new/bugfix_typos
Thanks.
Line 206 in util
module is broken, and command
easy_install pyechonest
fails on it, after that the code doesn't work as the import util fails
I'm facing a permission problem while I'm using "echonest" plugin under Debian Squeeze (Python 2.6).
$ sudo pip install pyechonest
Downloading/unpacking pyechonest
Downloading pyechonest-8.0.0.tar.gz
Running setup.py egg_info for package pyechonest
Installing collected packages: pyechonest
Running setup.py install for pyechonest
Successfully installed pyechonest
Cleaning up...
$ beet imp autoKratz
Traceback (most recent call last):
File "/usr/local/bin/beet", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2691, in
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 668, in subscribe
callback(dist)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2691, in
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2192, in activate
self.insert_on(path)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2299, in insert_on
self.check_version_conflict()
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2338, in check_version_conflict
for modname in self._get_metadata('top_level.txt'):
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2186, in _get_metadata
for line in self.get_metadata_lines(name):
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1174, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1166, in get_metadata
return self._get(self._fn(self.egg_info,name))
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1281, in _get
stream = open(path, 'rb')
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.6/dist-packages/pyechonest-8.0.0.egg-info/top_level.txt'
$ ls /usr/local/lib/python2.6/dist-packages/pyechonest-8.0.0.egg-info/top_level.txt -alh
-rwx------ 1 root staff 11 Jun 12 13:51 /usr/local/lib/python2.6/dist-packages/pyechonest-8.0.0.egg-info/top_level.txt
Fixed by chmoding to 664:
$ sudo chmod 664 /usr/local/lib/python2.6/dist-packages/pyechonest-8.0.0.egg-info/top_level.txt
I hope it helps :)
you are blowing my mind right now
Some wysiwyg editors today auto-links xxx.yyy and that's the reason why I was brought here (Gmail in my case).
I just thought that it would be very cool if it instead redirects you to a random readme page in Github.
Hello,
Thank you very much for the pyechonest library!!! It is awesome so far : )
To reproduce: call Playlist.static(..., bucket=['id:spotify', 'tracks']) then find that someResultSong.get_foreign_id() returns None although someResultSong.cache['tracks'][0]['foreign_id'] is already filled.
I also noticed that someResultSong.get_foreign_id() also tries to find the foreign_id using only bucket=['id:spotify'](ie.the catalog space) and looking into Song objects... Whereas the right for me would be to have bucket=['id:spotify','tracks'] and look into Song.tracks...
Have a nice day!!! : )
Looking through the code, I'm pretty sure that data must be coming back. It bounces an error if you try to limit without specifying an idspace in buckets arg. Maybe it's being filtered out by the "fix" function?
The last example isn't working for me.
Traceback (most recent call last):
File "song.py", line 5, in
slow_show = ss_results[0]
IndexError: list index out of range
Did you guys actually register http://readme.md/ to redirect to your projects README file?
Add support for new (Jan 2014) Genre API, per the following links
http://developer.echonest.com/docs/v4/genre.html
http://blog.echonest.com/post/73516217273/the-future-of-music-genres-is-here
example from documentation: s = song.Song('SOPEXHZ12873FD2AC7)'
calls this request: http://developer.echonest.com/api/v4/song/profile?api_key=&id=SOPEXHZ12873FD2AC7
which returns successfully despite not having any results in "songs"
as a result, this initialization results in the following stack trace:
Traceback (most recent call last):
File "chordials.py", line 51, in <module>
s = song.Song('SOPEXHZ12873FD2AC7')
File "build/bdist.macosx-10.9-intel/egg/pyechonest/song.py", line 72, in __init__
File "build/bdist.macosx-10.9-intel/egg/pyechonest/proxies.py", line 153, in __init__
IndexError: list index out of range
Site seems down.
Hi,
documentation links echoprintstring Track attribute to http://echoprint.me/ but I can't find explanation of what this data is supposed to represent.
How can I decode echoprintstring value to meaningful representation?
Thanks
I promised I would report the KeyError that I had been seeing. Here it is:
File "/usr/local/lib/python2.7/dist-packages/pyechonest-4.2.21-py2.7.egg/pyechonest/artist.py", line 338, in get_images
self.cache['images'] = ResultList(response['images'], 0, response['total'])
KeyError: 'total'
References to get_tracks should be
song.get_tracks('id:7digital-xx')
instead of
song.get_tracks('id:7digital')
As it doesn't seem to like 7digital alone
File "audio.py", line 15, in get_song_data
track = song.get_tracks('7digital')[0]
File "build/bdist.linux-x86_64/egg/pyechonest/song.py", line 347, in get_tracks
File "build/bdist.linux-x86_64/egg/pyechonest/proxies.py", line 159, in get_attribute
File "build/bdist.linux-x86_64/egg/pyechonest/proxies.py", line 23, in get_attribute
File "build/bdist.linux-x86_64/egg/pyechonest/util.py", line 252, in callm
File "build/bdist.linux-x86_64/egg/pyechonest/util.py", line 122, in get_successful_response
pyechonest.util.EchoNestAPIError: (u'Echo Nest API Error 5: bucket - Invalid parameter: bucket "id:7digital" is not one of "song_hotttnesss", "song_hotttnesss_rank", "artist_familiarity", "artist_familiarity_rank", "artist_hotttnesss", "artist_hotttnesss_rank", "artist_discovery", "artist_discovery_rank", "audio_summary", "artist_location", "tracks", "scores", "song_type", "song_discovery", "song_discovery_rank", "song_currency", "song_currency_rank", "id:7digital-US", "id:7digital-AU", "id:7digital-UK", "id:facebook", "id:fma", "id:emi_open_collection", "id:emi_bluenote", "id:emi_artists", "id:twitter", "id:spotify-WW", "id:seatwave", "id:lyricfind-US", "id:jambase", "id:musixmatch-WW", "id:rdio-US", "id:rdio-AT", "id:rdio-AU", "id:rdio-BR", "id:rdio-CA", "id:rdio-CH", "id:rdio-DE", "id:rdio-DK", "id:rdio-ES", "id:rdio-FI", "id:rdio-FR", "id:rdio-IE", "id:rdio-IT", "id:rdio-NL", "id:rdio-NO", "id:rdio-NZ", "id:rdio-PT", "id:rdio-SE", "id:emi_electrospective", "id:rdio-WW", "id:rdio-EE", "id:rdio-LT", "id:rdio-LV", "id:rdio-IS", "id:rdio-BE", "id:rdio-MX", "id:seatgeek", "id:rdio-GB", "id:rdio-CZ", "id:rdio-CO", "id:rdio-PL", "id:rdio-MY", "id:rdio-HK", "id:rdio-CL", "id:twitter_numeric", "id:7digital-ES", "id:openaura", or "id:<CATALOG ID>" [HTTP 400]',)
I think that the link "readme.md" should NOT redirect to this repo's readme.
Hi,
How to get the API key? When I click the link which is given on the installation page(http://developer.echonest.com/) I have got the error message "This site can’t be reached".
Kindly advise?
Thank you
Regards
Prabu M
Per this Stack Overflow question, the pyechonest
documentation does not appear to correctly correspond with the API docs. Please double-check e.g. the descriptions of the possible values of key
and mode
.
>>> from pyechonest import catalog
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "...\Python\Python37\lib\site-packages\pyechonest\catalog.py", line 327
if since:
^
TabError: inconsistent use of tabs and spaces in indentation```
Maybe this is because artist_location
is fairly new to the API? (It's still in beta). Right now you can get an artist's location by doing artist.songs[0].artist_location
, but it would be nice to be able to just do artist.artist_location
.
Hi,
It seems this code is meant for Python 2.7, is that right? Any advice for people using Python 3.4?
So I have an issue uploading a music file through the http proxy I am behind this query works
>>> song.search(artist="radiohead",title="Creep")
[<song - Creep>, <song - CREEP (LYRICS!)>, <song - Creep (Acoustic)>, <song - Creep (Radio Edit)>, <song - CREEP (Live)/(LYRICS!)>, <song - Creep (BBC Radio 1 Evening Session)>]
however doing this returns ...
>>> track.track_from_filename(filename)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.6-intel/egg/pyechonest/track.py", line 217, in track_from_filename
File "build/bdist.macosx-10.6-intel/egg/pyechonest/track.py", line 196, in track_from_file
File "build/bdist.macosx-10.6-intel/egg/pyechonest/track.py", line 174, in _track_from_string
File "build/bdist.macosx-10.6-intel/egg/pyechonest/track.py", line 152, in _upload
File "build/bdist.macosx-10.6-intel/egg/pyechonest/util.py", line 202, in callm
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 958, in request
self._send_request(method, url, body, headers)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 992, in _send_request
self.endheaders(body)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 954, in endheaders
self._send_output(message_body)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 814, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 776, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 757, in connect
self.timeout, self.source_address)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
raise err
socket.error: [Errno 60] Operation timed out
I have tried to "socksipy" (http://socksipy.sourceforge.net) to force the sockets to use the proxy like this:
>>> socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,"socks.example.com")
>>> socket.socket = socks.socksocket
but to no avail.
I think that problems lies in the function util.callm or in httplib.HTTPConnection therefore I have also tried.
>>> track.util.opener = urllib2.build_opener(urllib2.ProxyHandler(),track.util.MyBaseHandler(), track.util.MyErrorProcessor())
Hello,
I get the following error when trying to execute example code for song.search
found on this page: http://echonest.github.io/pyechonest/song.html
Traceback (most recent call last):
File "test.py", line 4, in <module>
results = pyechonest.song.search(artist='shakira', title='she wolf', buckets=['id:7digital', 'tracks'], limit=True, results=1)
File "build/bdist.linux-x86_64/egg/pyechonest/song.py", line 447, in search
File "build/bdist.linux-x86_64/egg/pyechonest/util.py", line 208, in callm
pyechonest.util.EchoNestIOError: Echo Nest Unknown Error
Hi!
Using your pyechonest library to access your API it frequently happens that song-ids provided by MSD result in empty responses.
s = song.Song('SOMNXCC12AB0187BE7', buckets=['tracks', 'id:7digital-US'])
Traceback (most recent call last):
File "...", line 153, in
s = song.Song('SOMNXCC12AB0187BE7', buckets=['tracks', 'id:7digital-US'])
File "...\pyechonest-7.1.0-py2.7.egg\pyechonest\song.py", line 72, in init
super(Song, self).init(id, buckets, **kwargs)
File "...\pyechonest-7.1.0-py2.7.egg\pyechonest\proxies.py", line 173, in init
kwargs.update(profile.get('songs')[0])
IndexError: list index out of range
Hi!
I tried with various settings but always receive the same empty result.
ss_results = song.search(artist='radiohead', title='karma police', buckets=['id:7digital', 'tracks'])
slow_show = ss_results[0]
ss_tracks = slow_show.get_tracks('7digital')
print ss_tracks
[]
Also using direct access with song-id does not work. Either the data is not sent by the server or the data is not parsed by the pyechonet library.
Alex
I'm having trouble getting the Dynamic Playlist object to work. I really want to be able to use a seed_catalog to generate the playlist, but any method to fetch songs e.g. get_lookahead_songs() returns None.
standard_playlist1 = playlist.Playlist(seed_catalog=u'CAZZOPK15261351B73')
print standard_playlist1
>> <Dynamic Playlist - 96d0aed056df4e64997a16c670eae817>
print standard_playlist1.get_lookahead_songs()
>> None
I have tried simple using an artist_id or artist argument, but it's not working.
On the other hand, the static playlist works great through any generation method (artist, artist_id or seed catalog). Based on the documentation and the existence of a deprecated dynamic playlist, is this still something of a work in progress?
The URL in the README.md is not available?
developer.echonest.com
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.