API - davekilian/rapi GitHub Wiki

Overview

rapi

  • auth(username, password) -- Create a session
  • readlibrary(session) -- Gets the contents of the user's library

rapi.Artist

  • id -- A string containing the artist's unique ID
  • name -- The human-readable display name of the album
  • image -- The URl to a picture of the artist
  • albumids -- A list of IDs of albums by this artist

rapi.Album

  • id -- A string containing the album's unique ID
  • artistid -- The ID of the album artist
  • name -- The human-readable display name of the album
  • art -- The URL to the album's album art
  • year -- The year this album was released
  • trackids -- A list of IDs of tracks in this album

rapi.Track

  • id -- A string containing the track's unique ID
  • albumid -- A string containing the ID of the album this tracks appears in
  • artistid -- A string containing the ID of the song's album artist
  • name -- The track title
  • duration -- The duration of the track in seconds
  • genre -- The track's musical genre
  • stream(format) -- Opens a stream to the track's contents

auth

Create a session

session = rapi.auth('[email protected]', 'password')

library

Get the contents of the user's library. Returns a list(string) containing the ID of every track in the user's library

tracks = rapi.library(session)
for track in tracks:
    print track.id