Skip to main content

Python interface to The Echo Nest APIs.

Project description

Welcome to pyechonest, a python wrapper around the Echo Nest API (v4).

This client library should allow you to get started using the Echo Nest API quickly and easily. The only requirement is a developer API key, which you can get for free from http://developer.echonest.com/account/register/.

For documentation questions, please refer to the official api docs, which are available at http://developer.echonest.com/.

IMPORTANT: You must let pyechonest know about your API key before you use it. There are two ways to let pyechonest know about your API key:

  1. Set the variable ECHO_NEST_API_KEY in your environment to your key.

    (bourne-like shells) $ export ECHO_NEST_API_KEY=YOUR_API_KEY (c-like shells) $ setenv ECHO_NEST_API_KEY YOUR_API_KEY

  2. In Python, do this:
    >>> from pyechonest import config
    >>> config.ECHO_NEST_API_KEY = YOUR_API_KEY
    
Examples:
Search for artist:
>>> from pyechonest import artist
>>> weezer_results = artist.search(name='weezer')
>>> weezer = weezer_results[0]
>>> weezer_blogs = weezer.blogs
>>> print 'Blogs about weezer:', [blog.get('url') for blog in weezer_blogs]
Get an artist by name:
>>> from pyechonest import artist
>>> a = artist.Artist('lady gaga')
>>> print a.id
Get an artist from their Musicbrainz ID:
>>> from pyechonest import artist
>>> a = artist.Artist('musicbrainz:artist:a74b1b7f-71a5-4011-9441-d0b5e4122711')
>>> print a.name
Get the top hottt artists:
>>> from pyechonest import artist
>>> for hottt_artist in artist.top_hottt():
>>>     print hottt_artist.name, hottt_artist.hotttnesss
Search for songs:
>>> from pyechonest import song
>>> rkp_results = song.search(artist='radiohead', title='karma police')
>>> karma_police = rkp_results[0]
>>> print karma_police.artist_location
>>> print 'tempo:',karma_police.audio_summary['tempo'],'duration:',karma_police.audio_summary['duration']
Get a song’s audio_url and analysis_url:
>>> from pyechonest import song
>>> wn_results = song.search(combined='the national - wasp nest', buckets=['id:7digital'], limit=True)
>>> wasp_nest = wn_results[0]
>>> wn_tracks = wasp_nest.get_tracks('7digital')
>>> print wn_tracks[0].get('preview_url')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyechonest, version 4.2.12
Filename, size File type Python version Upload date Hashes
Filename, size pyechonest-4.2.12.tar.gz (458.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page