Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update CHANGELOG for 8.0.0 changes. Fix examples to work without eyeD…

…3 and to use 7digital-US catalog. Handle all 2xx, 4xx, 5xx response codes.
  • Loading branch information...
commit f9aeca67131b65b53f10f3b645b70fecc909cfc0 1 parent 10394f6
@ddesroches ddesroches authored
View
11 CHANGELOG
@@ -1,3 +1,14 @@
+Rev 7.1.1 to 8.0.0
+
+Delete old deprecated playlist functions.
+Support new Track attributes 'valence' and 'acousticness'.
+No longer return Track attributes as 0 if they don't exist on the track.
+Audio attributes can now be None.
+No longer always get track analysis details (bars, beats, meta, etc.). You now
+need to call Track.get_analysis() to populate those attributes. See track.py for
+details. (This makes track.track_from_XXX methods much faster for most uses.)
+Handle all 2XX, 4XX, and 5XX response codes from the API.
+
Rev 7.1.0 to 7.1.1
Merge pull request #18 from njl/create_catalog_by_name_factory_function
View
14 examples/show_tempos.py
@@ -1,21 +1,19 @@
-# Shows the tempos for all of the songs in a director
+# Shows the tempos for all of the songs in a directory
# requires eyeD3, available from http://eyed3.nicfit.net/
import sys
import os
-import eyeD3
import tempo
+from pyechonest import track
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())
+ pytrack = track.track_from_filename(mp3)
print 'File: ', mp3
- print 'Artist:', tag.getArtist()
- print 'Title: ', tag.getTitle()
- print 'Tempo: ', my_tempo
+ print 'Artist:', pytrack.artist if hasattr(pytrack, 'artist') else 'Unknown'
+ print 'Title: ', pytrack.title if hasattr(pytrack, 'title') else 'Unknown'
+ print 'Tempo: ', pytrack.tempo
print
View
6 examples/try_new_things.py
@@ -113,7 +113,7 @@ def lookup_seeds(seed_artist_names):
seed_ids = []
for artist_name in seed_artist_names:
try:
- seed_ids.append("-%s" % (artist.Artist(artist_name).id,))
+ seed_ids.append("%s" % (artist.Artist(artist_name).id,))
except Exception:
logger.info('artist "%s" not found.' % (artist_name,))
# we could try to do full artist search here
@@ -125,7 +125,7 @@ def lookup_seeds(seed_artist_names):
def find_playlist(seed_artist_ids, playable=False):
if playable:
logger.info("finding playlist with audio...")
- p = playlist.static(type='artist-radio', artist_id=seed_artist_ids, variety=1, buckets=['id:7digital', 'tracks'], limit=True)
+ p = playlist.static(type='artist-radio', artist_id=seed_artist_ids, variety=1, buckets=['id:7digital-US', 'tracks'], limit=True)
else:
logger.info("finding playlist without audio...")
p = playlist.static(type='artist-radio', artist_id=seed_artist_ids, variety=1)
@@ -180,7 +180,7 @@ def find_playlist(seed_artist_ids, playable=False):
title = s.title
url = ""
if options.audio:
- url = s.get_tracks('7digital', [{}])[0].get('preview_url')
+ url = s.get_tracks('7digital-US', [{}])[0].get('preview_url')
tuple_plist.append((name,title,url))
# write to stdout or file specified
View
2  pyechonest/util.py
@@ -55,7 +55,7 @@ def http_response(self, request, response):
code = response.code
if config.TRACE_API_CALLS:
logger.info("took %2.2fs: (%i)" % (time.time()-request.start_time,code))
- if code in [200, 400, 401, 403, 500]:
+ if code/100 in (2, 4, 5):
return response
else:
urllib2.HTTPErrorProcessor.http_response(self, request, response)
Please sign in to comment.
Something went wrong with that request. Please try again.