pyspotify
  • Introduction
    • Completion status
    • Requirements
    • Installation
      • Debian package
      • Arch Linux package
      • Using Pip (latest stable release)
      • Using Pip (latest development version)
      • Using setuptools (latest git version)
    • Trying it out
  • Managers
    • Session manager
    • Playlist manager
    • Container manager
  • Audio sinks
    • Implementations
  • API Reference
    • Error handling
    • Session settings
    • Session handling
      • The Session class
    • Spotify links (URIs)
      • The Link class
    • Track subsystem
      • The Track class
    • Album subsystem
      • The Album class
    • Artist subsystem
      • The Artist class
    • Album browsing
      • The AlbumBrowser class
    • Artist browsing
      • The ArtistBrowser class
    • Image subsystem
      • The Image class
    • Search subsystem
      • The Results class
    • Playlists
      • The Playlist class
      • The PlaylistFolder class
    • Playlist containers
      • The PlaylistContainer class
    • Users
    • Toplists
    • Inbox
    • API constants
      • User relation types
  • Changes
    • v1.12 (2015-01-16)
    • v1.11 (2013-07-01)
    • v1.10 (2012-12-12)
    • v1.9.1 (2012-11-23)
    • v1.9 (2012-11-20)
    • v1.8.1 (2012-11-04)
    • v1.8 (2012-11-04)
    • v1.7.1 (2012-09-07)
    • v1.7 (2012-04-22)
    • v1.6.1 (2011-12-29)
    • v1.6 (2011-11-29)
    • v1.5 (2011-10-30)
    • v1.4 (2011-09-24)
    • v1.3 (2011-06-11)
    • v1.2 (2011-06-07)
    • v1.1+mopidy20110405 (2011-04-05)
    • v1.1+mopidy20110331 (2011-03-31)
    • v1.1+mopidy20110330 (2011-03-30)
    • v1.1+mopidy20110223 (2011-02-23)
    • v1.1+mopidy20110106 (2011-01-06)
    • v1.1 (2010-04-25)
  • Development
    • Code style
    • Commit guidelines
    • Running tests
    • Continuous integration server
    • Writing documentation
    • Creating releases
  • Authors
  • Licenses
    • Source code license
    • Documentation license
    • libspotify disclaimer
 
pyspotify
  • Docs »
  • API Reference »
  • Spotify links (URIs)
  • Edit on GitHub

Spotify links (URIs)¶

The Link class¶

class spotify.Link¶

Link objects

LINK_INVALID¶

Link type not valid - default until the library has parsed the link, or when parsing failed.

LINK_TRACK¶
LINK_ALBUM¶
LINK_ARTIST¶
LINK_SEARCH¶
LINK_PLAYLIST¶
LINK_PROFILE¶
LINK_STARRED¶
LINK_LOCALTRACK¶
LINK_IMAGE¶
__str__()¶

Return the link as a string in the Spotify format.

Example: spotify:track:5st5644IlBmKiiRE73UsoZ

type()¶

Return the type of the link as an int. Check value against the LINK_* types.

as_album()¶
Returns:the link as an Album object.
Return type:Album
as_artist()¶
Returns:the link as an Artist object.
Return type:Artist
as_playlist()¶
Returns:the link as a Playlist object.
Return type:Playlist
as_track()¶
Returns:the link as a Track object.
Return type:Track
static from_album(album)¶
Parameters:album (Album) – an album
Returns:link to the album
Return type:Link
Raises:SpotifyError

Create a new Link object from an Album object.

static from_artist(artist)¶
Parameters:artist (Artist) – an artist
Returns:link to the artist
Return type:Link
Raises:SpotifyError

Create a new Link object from an Artist object.

static from_playlist(playlist)¶
Parameters:playlist (Playlist) – a playlist
Returns:link to the playlist
Return type:Link
Raises:SpotifyError

Create a new Link object from a Playlist object.

static from_search(results)¶
Parameters:results (Results) – a result set
Returns:link to the result set
Return type:Link
Raises:SpotifyError

Create a new Link object from a Results object.

static from_string(s)¶
Parameters:s (string) – a Spotify URI
Returns:link to the same resource as the URI string
Return type:Link
Raises:SpotifyError

Create a new Link object from a string. Raises an exception if the string is not a valid Spotify URI.

static from_track(track[, offset])¶
Parameters:
  • track (Track) – a track
  • offset (int) – offset in milliseconds from the start of the track
Returns:

link to the result set

Return type:

Link

Raises:

SpotifyError

Create a new Link object from a Track object, and optionally a time offset in milliseconds from the start of the track.

Next Previous

© Copyright 2009-2015, Doug Winter and contributors.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: v1.x-develop
Versions
latest
v2.x-develop
v1.x-develop
v2.0.0
v1.12
Downloads
pdf
htmlzip
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.