spotimeta /

Filename Size Date modified Message
spotimeta
tests
49 B
24 B
1.6 KB
82 B
2.1 KB
980 B

Spotimeta - Spotify metadata search and lookup

Introduction

Spotimeta is a simple library for getting data from Spotify's metadata API. Available functions is searching for artists, albums and tracks, as well as looking up the same based on Spotify URIs. The data is returned as simple python dictionaries.

NOTE:

This product uses a SPOTIFY API but is not endorsed, certified or otherwise approved in any way by Spotify. Spotify is the registered trade mark of the Spotify Group.

For more information about the metadata API, see
http://developer.spotify.com/en/metadata-api/overview/

Examples

>>> import spotimeta

Search for a track

>>> search = spotimeta.search_track("Trip back to childhood")
>>> search["total_results"]
1

Print the artist of that track

>>> artist = search["result"][0]["artist"]
>>> artist["name"]
u'St-Petersburg Ska-Jazz Review'

Look up more information about that artist:

>>> lookup = spotimeta.lookup(artist["href"], detail=1)
>>> for album in lookup["result"]["albums"]:
...     album["name"]
u'Too Good To Be True'
u'Too Good To Be True'
u'Live At The Red Club'

It's also possible to look up metadata using spotify URLs:

>>> track = spotimeta.lookup("http://open.spotify.com/track/3Z8cX6y0SeJIsI3yxoaQ8K")
>>> print track["result"]["artist"]["name"], "-", track["result"]["name"]
Kings Of Leon - Closer

Todo

  • Sphinxify docs
  • Implement the caching
  • Deal with expire headers etc.
  • Testcases for search, not just search parser
  • Deal with all the fixmes

Changelog

See the CHANGELOG file

Contact

The author is Rune Halvorsen <runefh@gmail.com>. The project resides at http://bitbucket.org/runeh/spotimeta . If you find bugs, or have feature requests, please report them in the project site issue tracker. Patches very welcome.

License

This software is licensed under the New BSD License. See the LICENCE file in the top distribution directory for the full license text.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.