pylast (version 0.5)
index
/usr/lib/pymodules/python2.6/pylast.py

# -*- coding: utf-8 -*-
#
# pylast - A Python interface to Last.fm (and other API compatible social networks)
#
# Copyright 2008-2010 Amr Hassan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# http://code.google.com/p/pylast/

 
Modules
       
collections
hashlib
htmlentitydefs
xml.dom.minidom
shelve
sys
tempfile
time
xml

 
Classes
       
__builtin__.object
Scrobbler
SessionKeyGenerator
__builtin__.tuple(__builtin__.object)
Image
ImageSizes
LibraryItem
LovedTrack
PlayedTrack
Shout
SimilarItem
TopItem
exceptions.Exception(exceptions.BaseException)
MalformedResponseError
NetworkError
ScrobblingError
BadAuthenticationError
BadSessionError
BadTimeError
BannedClientError
WSError
_BaseObject(__builtin__.object)
Album(_BaseObject, _Taggable)
Artist(_BaseObject, _Taggable)
Country
Event
Group
Library
Playlist
Tag
Track(_BaseObject, _Taggable)
User
AuthenticatedUser
Venue
XSPF
_Network(__builtin__.object)
LastFMNetwork
LibreFMNetwork
_Search(_BaseObject)
AlbumSearch
ArtistSearch
TagSearch
TrackSearch
VenueSearch
_Taggable(__builtin__.object)
Album(_BaseObject, _Taggable)
Artist(_BaseObject, _Taggable)
Track(_BaseObject, _Taggable)

 
class Album(_BaseObject, _Taggable)
    An album.
 
 
Method resolution order:
Album
_BaseObject
_Taggable
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, artist, title, network)
Create an album instance.
# Parameters:
    * artist: An artist name or an Artist object.
    * title: The album title.
__ne__(self, other)
__repr__(self)
__str__ = r(*args)
get_artist(self)
Returns the associated Artist object.
get_cover_image(self, size=3)
Returns a uri to the cover image
size can be one of:
    COVER_EXTRA_LARGE
    COVER_LARGE
    COVER_MEDIUM
    COVER_SMALL
get_id(self)
Returns the ID
get_listener_count(self)
Returns the number of liteners on the network
get_mbid(self)
Returns the MusicBrainz id of the album.
get_name(self)
Returns the album title (alias to Album.get_title).
get_playcount(self)
Returns the number of plays on the network
get_release_date(self)
Retruns the release date of the album.
get_title(self)
Returns the album title.
get_top_tags(self, limit=None)
Returns a list of the most-applied tags to this album.
get_tracks(self)
Returns the list of Tracks on this album.
get_url(self, domain_name=0)
Returns the url of the album page on the network. 
# Parameters:
* domain_name str: The network's language domain. Possible values:
    o DOMAIN_ENGLISH
    o DOMAIN_GERMAN
    o DOMAIN_SPANISH
    o DOMAIN_FRENCH
    o DOMAIN_ITALIAN
    o DOMAIN_POLISH
    o DOMAIN_PORTUGUESE
    o DOMAIN_SWEDISH
    o DOMAIN_TURKISH
    o DOMAIN_RUSSIAN
    o DOMAIN_JAPANESE
    o DOMAIN_CHINESE
get_wiki_content(self)
Returns the content of the wiki.
get_wiki_published_date(self)
Returns the date of publishing this version of the wiki.
get_wiki_summary(self)
Returns the summary of the wiki.

Data and other attributes defined here:
artist = None
title = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

Methods inherited from _Taggable:
add_tag(self, tag)
Adds one tag.
* tag: a tag name or a Tag object.
add_tags(self, tags)
Adds one or several tags.
* tags: A sequence of tag names or Tag objects.
clear_tags(self)
Clears all the user-set tags.
get_tags(self)
Returns a list of the tags set by the user to this object.
remove_tag(self, tag)
Remove a user's tag from this object.
remove_tags(self, tags)
Removes one or several tags from this object.
* tags: a sequence of tag names or Tag objects.
set_tags(self, tags)
Sets this object's tags to only those tags.
* tags: a sequence of tag names or Tag objects.

 
class AlbumSearch(_Search)
    Search for an album by name.
 
 
Method resolution order:
AlbumSearch
_Search
_BaseObject
__builtin__.object

Methods defined here:
__init__(self, album_name, network)
get_next_page(self)
Returns the next page of results as a sequence of Album objects.

Methods inherited from _Search:
get_total_result_count(self)
Returns the total count of all the results.

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class Artist(_BaseObject, _Taggable)
    An artist.
 
 
Method resolution order:
Artist
_BaseObject
_Taggable
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, name, network)
Create an artist object.
# Parameters:
    * name str: The artist's name.
__ne__(self, other)
__repr__(self)
__str__ = r(*args)
get_bio_content(self)
Returns the content of the artist's biography.
get_bio_published_date(self)
Returns the date on which the artist's biography was published.
get_bio_summary(self)
Returns the summary of the artist's biography.
get_cover_image(self, size=4)
Returns a uri to the cover image
size can be one of:
    COVER_MEGA
    COVER_EXTRA_LARGE
    COVER_LARGE
    COVER_MEDIUM
    COVER_SMALL
get_images(self, order='popularity', limit=None)
Returns a sequence of Image objects
if limit is None it will return all
order can be IMAGES_ORDER_POPULARITY or IMAGES_ORDER_DATE.
 
If limit==None, it will try to pull all the available data.
get_listener_count(self)
Returns the number of liteners on the network.
get_mbid(self)
Returns the MusicBrainz ID of this artist.
get_name(self, properly_capitalized=False)
Returns the name of the artist.
If properly_capitalized was asserted then the name would be downloaded
overwriting the given one.
get_playcount(self)
Returns the number of plays on the network.
get_shouts(self, limit=50)
Returns a sequqence of Shout objects
get_similar(self, limit=None)
Returns the similar artists on the network.
get_top_albums(self)
Retuns a list of the top albums.
get_top_fans(self, limit=None)
Returns a list of the Users who played this artist the most.
# Parameters:
    * limit int: Max elements.
get_top_tracks(self)
Returns a list of the most played Tracks by this artist.
get_upcoming_events(self)
Returns a list of the upcoming Events for this artist.
get_url(self, domain_name=0)
Returns the url of the artist page on the network. 
# Parameters:
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE
is_streamable(self)
Returns True if the artist is streamable.
share(self, users, message=None)
Shares this artist (sends out recommendations). 
# Parameters:
    * users [User|str,]: A list that can contain usernames, emails, User objects, or all of them.
    * message str: A message to include in the recommendation message.
shout(self, message)
Post a shout

Data and other attributes defined here:
name = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

Methods inherited from _Taggable:
add_tag(self, tag)
Adds one tag.
* tag: a tag name or a Tag object.
add_tags(self, tags)
Adds one or several tags.
* tags: A sequence of tag names or Tag objects.
clear_tags(self)
Clears all the user-set tags.
get_tags(self)
Returns a list of the tags set by the user to this object.
get_top_tags(self, limit=None)
Returns a list of the most frequently used Tags on this object.
remove_tag(self, tag)
Remove a user's tag from this object.
remove_tags(self, tags)
Removes one or several tags from this object.
* tags: a sequence of tag names or Tag objects.
set_tags(self, tags)
Sets this object's tags to only those tags.
* tags: a sequence of tag names or Tag objects.

 
class ArtistSearch(_Search)
    Search for an artist by artist name.
 
 
Method resolution order:
ArtistSearch
_Search
_BaseObject
__builtin__.object

Methods defined here:
__init__(self, artist_name, network)
get_next_page(self)
Returns the next page of results as a sequence of Artist objects.

Methods inherited from _Search:
get_total_result_count(self)
Returns the total count of all the results.

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class AuthenticatedUser(User)
    
Method resolution order:
AuthenticatedUser
User
_BaseObject
__builtin__.object

Methods defined here:
__init__(self, network)
get_name(self)
Returns the name of the authenticated user.
get_recommended_artists(self, limit=50)
Returns a sequence of Event objects
if limit==None it will return all
get_recommended_events(self, limit=50)
Returns a sequence of Event objects
if limit==None it will return all

Methods inherited from User:
__eq__(self, another)
__ne__(self, another)
__repr__(self)
__str__ = r(*args)
compare_with_user(self, user, shared_artists_limit=None)
Compare this user with another Last.fm user.
Returns a sequence (tasteometer_score, (shared_artist1, shared_artist2, ...))
user: A User object or a username string/unicode object.
get_age(self)
Returns the user's age.
get_country(self)
Returns the name of the country of the user.
get_friends(self, limit=50)
Returns a list of the user's friends.
get_gender(self)
Returns the user's gender. Either USER_MALE or USER_FEMALE.
get_id(self)
Returns the user id.
get_image(self)
Returns the user's avatar.
get_language(self)
Returns the language code of the language used by the user.
get_library(self)
Returns the associated Library object.
get_loved_tracks(self, limit=50)
Returns this user's loved track as a sequence of LovedTrack objects
in reverse order of their timestamp, all the way back to the first track.
 
If limit==None, it will try to pull all the available data.
 
This method uses caching. Enable caching only if you're pulling a
large amount of data.
 
Use extract_items() with the return of this function to
get only a sequence of Track objects with no playback dates.
get_neighbours(self, limit=50)
Returns a list of the user's friends.
get_now_playing(self)
Returns the currently playing track, or None if nothing is playing.
get_past_events(self, limit=50)
Returns a sequence of Event objects
if limit==None it will return all
get_playcount(self)
Returns the user's playcount so far.
get_playlists(self)
Returns a list of Playlists that this user owns.
get_recent_tracks(self, limit=10)
Returns this user's played track as a sequence of PlayedTrack objects
in reverse order of their playtime, all the way back to the first track.
 
If limit==None, it will try to pull all the available data.
 
This method uses caching. Enable caching only if you're pulling a
large amount of data.
 
Use extract_items() with the return of this function to
get only a sequence of Track objects with no playback dates.
get_shouts(self, limit=50)
Returns a sequqence of Shout objects
get_top_albums(self, period='overall')
Returns the top albums played by a user. 
* period: The period of time. Possible values:
  o PERIOD_OVERALL
  o PERIOD_7DAYS
  o PERIOD_3MONTHS
  o PERIOD_6MONTHS
  o PERIOD_12MONTHS
get_top_artists(self, period='overall')
Returns the top artists played by a user. 
* period: The period of time. Possible values:
  o PERIOD_OVERALL
  o PERIOD_7DAYS
  o PERIOD_3MONTHS
  o PERIOD_6MONTHS
  o PERIOD_12MONTHS
get_top_tags(self, limit=None)
Returns a sequence of the top tags used by this user with their counts as (Tag, tagcount). 
* limit: The limit of how many tags to return.
get_top_tracks(self, period='overall')
Returns the top tracks played by a user. 
* period: The period of time. Possible values:
  o PERIOD_OVERALL
  o PERIOD_7DAYS
  o PERIOD_3MONTHS
  o PERIOD_6MONTHS
  o PERIOD_12MONTHS
get_upcoming_events(self)
Returns all the upcoming events for this user.
get_url(self, domain_name=0)
Returns the url of the user page on the network. 
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE
get_weekly_album_charts(self, from_date=None, to_date=None)
Returns the weekly album charts for the week starting from the from_date value to the to_date value.
get_weekly_artist_charts(self, from_date=None, to_date=None)
Returns the weekly artist charts for the week starting from the from_date value to the to_date value.
get_weekly_chart_dates(self)
Returns a list of From and To tuples for the available charts.
get_weekly_track_charts(self, from_date=None, to_date=None)
Returns the weekly track charts for the week starting from the from_date value to the to_date value.
is_subscriber(self)
Returns whether the user is a subscriber or not. True or False.
shout(self, message)
Post a shout

Data and other attributes inherited from User:
name = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class BadAuthenticationError(ScrobblingError)
    
Method resolution order:
BadAuthenticationError
ScrobblingError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self)

Methods inherited from ScrobblingError:
__str__ = r(*args)

Data descriptors inherited from ScrobblingError:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class BadSessionError(ScrobblingError)
    
Method resolution order:
BadSessionError
ScrobblingError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self)

Methods inherited from ScrobblingError:
__str__ = r(*args)

Data descriptors inherited from ScrobblingError:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class BadTimeError(ScrobblingError)
    
Method resolution order:
BadTimeError
ScrobblingError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self)

Methods inherited from ScrobblingError:
__str__ = r(*args)

Data descriptors inherited from ScrobblingError:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class BannedClientError(ScrobblingError)
    
Method resolution order:
BannedClientError
ScrobblingError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self)

Methods inherited from ScrobblingError:
__str__ = r(*args)

Data descriptors inherited from ScrobblingError:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class Country(_BaseObject)
    A country at Last.fm.
 
 
Method resolution order:
Country
_BaseObject
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, name, network)
__ne__(self, other)
__repr__(self)
__str__ = r(*args)
get_name(self)
Returns the country name.
get_top_artists(self)
Returns a sequence of the most played artists.
get_top_tracks(self)
Returns a sequence of the most played tracks
get_url(self, domain_name=0)
Returns the url of the event page on the network. 
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE

Data and other attributes defined here:
name = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class Event(_BaseObject)
    An event.
 
 
Method resolution order:
Event
_BaseObject
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, event_id, network)
__ne__(self, other)
__repr__(self)
__str__ = r(*args)
attend(self, attending_status)
Sets the attending status.
* attending_status: The attending status. Possible values:
  o EVENT_ATTENDING
  o EVENT_MAYBE_ATTENDING
  o EVENT_NOT_ATTENDING
get_artists(self)
Returns a list of the participating Artists.
get_attendance_count(self)
Returns the number of attending people.
get_attendees(self)
Get a list of attendees for an event
get_cover_image(self, size=4)
Returns a uri to the cover image
size can be one of:
    COVER_MEGA
    COVER_EXTRA_LARGE
    COVER_LARGE
    COVER_MEDIUM
    COVER_SMALL
get_description(self)
Returns the description of the event.
get_headliner(self)
Returns the headliner of the event.
get_id(self)
Returns the id of the event on the network.
get_review_count(self)
Returns the number of available reviews for this event.
get_shouts(self, limit=50)
Returns a sequqence of Shout objects
get_start_date(self)
Returns the date when the event starts.
get_title(self)
Returns the title of the event.
get_url(self, domain_name=0)
Returns the url of the event page on the network. 
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE
get_venue(self)
Returns the venue where the event is held.
share(self, users, message=None)
Shares this event (sends out recommendations). 
* users: A list that can contain usernames, emails, User objects, or all of them.
* message: A message to include in the recommendation message.
shout(self, message)
Post a shout

Data and other attributes defined here:
id = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class Group(_BaseObject)
    A Last.fm group.
 
 
Method resolution order:
Group
_BaseObject
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, group_name, network)
__ne__(self, other)
__repr__(self)
__str__ = r(*args)
get_members(self, limit=50)
Returns a sequence of User objects
if limit==None it will return all
get_name(self)
Returns the group name.
get_url(self, domain_name=0)
Returns the url of the group page on the network. 
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE
get_weekly_album_charts(self, from_date=None, to_date=None)
Returns the weekly album charts for the week starting from the from_date value to the to_date value.
get_weekly_artist_charts(self, from_date=None, to_date=None)
Returns the weekly artist charts for the week starting from the from_date value to the to_date value.
get_weekly_chart_dates(self)
Returns a list of From and To tuples for the available charts.
get_weekly_track_charts(self, from_date=None, to_date=None)
Returns the weekly track charts for the week starting from the from_date value to the to_date value.

Data and other attributes defined here:
name = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class Image(__builtin__.tuple)
    Image(title, url, dateadded, format, owner, sizes, votes)
 
 
Method resolution order:
Image
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
__repr__(self)

Static methods defined here:
__new__(_cls, title, url, dateadded, format, owner, sizes, votes)

Data descriptors defined here:
dateadded
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
format
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
owner
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
sizes
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
title
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
url
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
votes
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
class ImageSizes(__builtin__.tuple)
    ImageSizes(original, large, largesquare, medium, small, extralarge)
 
 
Method resolution order:
ImageSizes
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
__repr__(self)

Static methods defined here:
__new__(_cls, original, large, largesquare, medium, small, extralarge)

Data descriptors defined here:
extralarge
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
large
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
largesquare
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
medium
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
original
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
small
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
class LastFMNetwork(_Network)
    A Last.fm network object
 
api_key: a provided API_KEY
api_secret: a provided API_SECRET
session_key: a generated session_key or None
username: a username of a valid user
password_hash: the output of pylast.md5(password) where password is the user's password
 
if username and password_hash were provided and not session_key, session_key will be
generated automatically when needed.
        
Either a valid session_key or a combination of username and password_hash must be present for scrobbling.
 
Most read-only webservices only require an api_key and an api_secret, see about obtaining them from:
http://www.last.fm/api/account
 
 
Method resolution order:
LastFMNetwork
_Network
__builtin__.object

Methods defined here:
__init__(self, api_key='', api_secret='', session_key='', username='', password_hash='')
__repr__(self)

Methods inherited from _Network:
__str__(self)
create_new_playlist(self, title, description)
Creates a playlist for the authenticated user and returns it
    title: The title of the new playlist.
    description: The description of the new playlist.
disable_caching(self)
Disables all caching features.
disable_proxy(self)
Disable using the web proxy
enable_caching(self, file_path=None)
Enables caching request-wide for all cachable calls.
In choosing the backend used for caching, it will try _SqliteCacheBackend first if
the module sqlite3 is present. If not, it will fallback to _ShelfCacheBackend which uses shelve.Shelf objects.
 
* file_path: A file path for the backend storage file. If 
None set, a temp file would probably be created, according the backend.
enable_proxy(self, host, port)
Enable a default web proxy
get_album(self, artist, title)
Return an Album object
get_album_by_mbid(self, mbid)
Looks up an album by its MusicBrainz ID
get_artist(self, artist_name)
Return an Artist object
get_artist_by_mbid(self, mbid)
Loooks up an artist by its MusicBrainz ID
get_authenticated_user(self)
Returns the authenticated user
get_country(self, country_name)
Returns a country object
get_group(self, name)
Returns a Group object
get_scrobbler(self, client_id, client_version)
Returns a Scrobbler object used for submitting tracks to the server
 
Quote from http://www.last.fm/api/submissions:
========
Client identifiers are used to provide a centrally managed database of 
the client versions, allowing clients to be banned if they are found to 
be behaving undesirably. The client ID is associated with a version 
number on the server, however these are only incremented if a client is 
banned and do not have to reflect the version of the actual client application.
 
During development, clients which have not been allocated an identifier should 
use the identifier tst, with a version number of 1.0. Do not distribute code or
client implementations which use this test identifier. Do not use the identifiers
used by other clients.
=========
 
To obtain a new client identifier please contact:
    * Last.fm: submissions@last.fm
    * # TODO: list others
 
...and provide us with the name of your client and its homepage address.
get_tag(self, name)
Returns a tag object
get_top_tags(self, limit=None)
Returns a sequence of the most used tags as a sequence of TopItem objects.
get_track(self, artist, title)
Return a Track object
get_track_by_mbid(self, mbid)
Looks up a track by its MusicBrainz ID
get_user(self, username)
Returns a user object
is_caching_enabled(self)
Returns True if caching is enabled.
is_proxy_enabled(self)
Returns True if a web proxy is enabled.
scrobble(self, artist, title, timestamp, album=None, album_artist=None, track_number=None, duration=None, stream_id=None, context=None, mbid=None)
Used to add a track-play to a user's profile.
 
Parameters:
    artist (Required) : The artist name.
    title (Required) : The track name.
    timestamp (Required) : The time the track started playing, in UNIX timestamp format (integer number of seconds since 00:00:00, January 1st 1970 UTC). This must be in the UTC time zone.
    album (Optional) : The album name.
    album_artist (Optional) : The album artist - if this differs from the track artist.
    context (Optional) : Sub-client version (not public, only enabled for certain API keys)
    stream_id (Optional) : The stream id for this track received from the radio.getPlaylist service.
    track_number (Optional) : The track number of the track on the album.
    mbid (Optional) : The MusicBrainz Track ID.
    duration (Optional) : The length of the track in seconds.
scrobble_many(self, tracks)
Used to scrobble a batch of tracks at once. The parameter tracks is a sequence of dicts per
track containing the keyword arguments as if passed to the scrobble() method.
search_for_album(self, album_name)
Searches for an album by its name. Returns a AlbumSearch object.
Use get_next_page() to retreive sequences of results.
search_for_artist(self, artist_name)
Searches of an artist by its name. Returns a ArtistSearch object.
Use get_next_page() to retreive sequences of results.
search_for_tag(self, tag_name)
Searches of a tag by its name. Returns a TagSearch object.
Use get_next_page() to retreive sequences of results.
search_for_track(self, artist_name, track_name)
Searches of a track by its name and its artist. Set artist to an empty string if not available.
Returns a TrackSearch object.
Use get_next_page() to retreive sequences of results.
search_for_venue(self, venue_name, country_name)
Searches of a venue by its name and its country. Set country_name to an empty string if not available.
Returns a VenueSearch object.
Use get_next_page() to retreive sequences of results.
update_now_playing(self, artist, title, album=None, album_artist=None, duration=None, track_number=None, mbid=None, context=None)
Used to notify Last.fm that a user has started listening to a track. 
 
Parameters:
    artist (Required) : The artist name
    title (Required) : The track title
    album (Optional) : The album name.
    album_artist (Optional) : The album artist - if this differs from the track artist.
    duration (Optional) : The length of the track in seconds.
    track_number (Optional) : The track number of the track on the album.
    mbid (Optional) : The MusicBrainz Track ID.
    context (Optional) : Sub-client version (not public, only enabled for certain API keys)

Data descriptors inherited from _Network:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Library(_BaseObject)
    A user's Last.fm library.
 
 
Method resolution order:
Library
_BaseObject
__builtin__.object

Methods defined here:
__init__(self, user, network)
__repr__(self)
__str__ = r(*args)
add_album(self, album)
Add an album to this library.
add_artist(self, artist)
Add an artist to this library.
add_track(self, track)
Add a track to this library.
get_albums(self, limit=50)
Returns a sequence of Album objects
if limit==None it will return all (may take a while)
get_artists(self, limit=50)
Returns a sequence of Album objects
if limit==None it will return all (may take a while)
get_tracks(self, limit=50)
Returns a sequence of Album objects
if limit==None it will return all (may take a while)
get_user(self)
Returns the user who owns this library.

Data and other attributes defined here:
user = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class LibraryItem(__builtin__.tuple)
    LibraryItem(item, playcount, tagcount)
 
 
Method resolution order:
LibraryItem
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
__repr__(self)

Static methods defined here:
__new__(_cls, item, playcount, tagcount)

Data descriptors defined here:
item
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
playcount
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
tagcount
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
class LibreFMNetwork(_Network)
    A preconfigured _Network object for Libre.fm
 
api_key: a provided API_KEY
api_secret: a provided API_SECRET
session_key: a generated session_key or None
username: a username of a valid user
password_hash: the output of pylast.md5(password) where password is the user's password
 
if username and password_hash were provided and not session_key, session_key will be
generated automatically when needed.
 
 
Method resolution order:
LibreFMNetwork
_Network
__builtin__.object

Methods defined here:
__init__(self, api_key='', api_secret='', session_key='', username='', password_hash='')
__repr__(self)

Methods inherited from _Network:
__str__(self)
create_new_playlist(self, title, description)
Creates a playlist for the authenticated user and returns it
    title: The title of the new playlist.
    description: The description of the new playlist.
disable_caching(self)
Disables all caching features.
disable_proxy(self)
Disable using the web proxy
enable_caching(self, file_path=None)
Enables caching request-wide for all cachable calls.
In choosing the backend used for caching, it will try _SqliteCacheBackend first if
the module sqlite3 is present. If not, it will fallback to _ShelfCacheBackend which uses shelve.Shelf objects.
 
* file_path: A file path for the backend storage file. If 
None set, a temp file would probably be created, according the backend.
enable_proxy(self, host, port)
Enable a default web proxy
get_album(self, artist, title)
Return an Album object
get_album_by_mbid(self, mbid)
Looks up an album by its MusicBrainz ID
get_artist(self, artist_name)
Return an Artist object
get_artist_by_mbid(self, mbid)
Loooks up an artist by its MusicBrainz ID
get_authenticated_user(self)
Returns the authenticated user
get_country(self, country_name)
Returns a country object
get_group(self, name)
Returns a Group object
get_scrobbler(self, client_id, client_version)
Returns a Scrobbler object used for submitting tracks to the server
 
Quote from http://www.last.fm/api/submissions:
========
Client identifiers are used to provide a centrally managed database of 
the client versions, allowing clients to be banned if they are found to 
be behaving undesirably. The client ID is associated with a version 
number on the server, however these are only incremented if a client is 
banned and do not have to reflect the version of the actual client application.
 
During development, clients which have not been allocated an identifier should 
use the identifier tst, with a version number of 1.0. Do not distribute code or
client implementations which use this test identifier. Do not use the identifiers
used by other clients.
=========
 
To obtain a new client identifier please contact:
    * Last.fm: submissions@last.fm
    * # TODO: list others
 
...and provide us with the name of your client and its homepage address.
get_tag(self, name)
Returns a tag object
get_top_tags(self, limit=None)
Returns a sequence of the most used tags as a sequence of TopItem objects.
get_track(self, artist, title)
Return a Track object
get_track_by_mbid(self, mbid)
Looks up a track by its MusicBrainz ID
get_user(self, username)
Returns a user object
is_caching_enabled(self)
Returns True if caching is enabled.
is_proxy_enabled(self)
Returns True if a web proxy is enabled.
scrobble(self, artist, title, timestamp, album=None, album_artist=None, track_number=None, duration=None, stream_id=None, context=None, mbid=None)
Used to add a track-play to a user's profile.
 
Parameters:
    artist (Required) : The artist name.
    title (Required) : The track name.
    timestamp (Required) : The time the track started playing, in UNIX timestamp format (integer number of seconds since 00:00:00, January 1st 1970 UTC). This must be in the UTC time zone.
    album (Optional) : The album name.
    album_artist (Optional) : The album artist - if this differs from the track artist.
    context (Optional) : Sub-client version (not public, only enabled for certain API keys)
    stream_id (Optional) : The stream id for this track received from the radio.getPlaylist service.
    track_number (Optional) : The track number of the track on the album.
    mbid (Optional) : The MusicBrainz Track ID.
    duration (Optional) : The length of the track in seconds.
scrobble_many(self, tracks)
Used to scrobble a batch of tracks at once. The parameter tracks is a sequence of dicts per
track containing the keyword arguments as if passed to the scrobble() method.
search_for_album(self, album_name)
Searches for an album by its name. Returns a AlbumSearch object.
Use get_next_page() to retreive sequences of results.
search_for_artist(self, artist_name)
Searches of an artist by its name. Returns a ArtistSearch object.
Use get_next_page() to retreive sequences of results.
search_for_tag(self, tag_name)
Searches of a tag by its name. Returns a TagSearch object.
Use get_next_page() to retreive sequences of results.
search_for_track(self, artist_name, track_name)
Searches of a track by its name and its artist. Set artist to an empty string if not available.
Returns a TrackSearch object.
Use get_next_page() to retreive sequences of results.
search_for_venue(self, venue_name, country_name)
Searches of a venue by its name and its country. Set country_name to an empty string if not available.
Returns a VenueSearch object.
Use get_next_page() to retreive sequences of results.
update_now_playing(self, artist, title, album=None, album_artist=None, duration=None, track_number=None, mbid=None, context=None)
Used to notify Last.fm that a user has started listening to a track. 
 
Parameters:
    artist (Required) : The artist name
    title (Required) : The track title
    album (Optional) : The album name.
    album_artist (Optional) : The album artist - if this differs from the track artist.
    duration (Optional) : The length of the track in seconds.
    track_number (Optional) : The track number of the track on the album.
    mbid (Optional) : The MusicBrainz Track ID.
    context (Optional) : Sub-client version (not public, only enabled for certain API keys)

Data descriptors inherited from _Network:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class LovedTrack(__builtin__.tuple)
    LovedTrack(track, date, timestamp)
 
 
Method resolution order:
LovedTrack
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
__repr__(self)

Static methods defined here:
__new__(_cls, track, date, timestamp)

Data descriptors defined here:
date
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
timestamp
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
track
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
class MalformedResponseError(exceptions.Exception)
    Exception conveying a malformed response from Last.fm.
 
 
Method resolution order:
MalformedResponseError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, network, underlying_error)
__str__(self)

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class NetworkError(exceptions.Exception)
    Exception conveying a problem in sending a request to Last.fm
 
 
Method resolution order:
NetworkError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, network, underlying_error)
__str__(self)

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class PlayedTrack(__builtin__.tuple)
    PlayedTrack(track, playback_date, timestamp)
 
 
Method resolution order:
PlayedTrack
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
__repr__(self)

Static methods defined here:
__new__(_cls, track, playback_date, timestamp)

Data descriptors defined here:
playback_date
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
timestamp
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
track
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
class Playlist(_BaseObject)
    A Last.fm user playlist.
 
 
Method resolution order:
Playlist
_BaseObject
__builtin__.object

Methods defined here:
__init__(self, user, id, network)
__str__ = r(*args)
add_track(self, track)
Adds a Track to this Playlist.
get_cover_image(self, size=3)
Returns a uri to the cover image
size can be one of:
    COVER_MEGA
    COVER_EXTRA_LARGE
    COVER_LARGE
    COVER_MEDIUM
    COVER_SMALL
get_creation_date(self)
Returns the creation date of this playlist.
get_description(self)
Returns the description of this playlist.
get_duration(self)
Returns the duration of this playlist in milliseconds.
get_id(self)
Returns the playlist id.
get_size(self)
Returns the number of tracks in this playlist.
get_title(self)
Returns the title of this playlist.
get_tracks(self)
Returns a list of the tracks on this user playlist.
get_url(self, domain_name=0)
Returns the url of the playlist on the network. 
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE
get_user(self)
Returns the owner user of this playlist.
has_track(self, track)
Checks to see if track is already in the playlist.
* track: Any Track object.
is_streamable(self)
Returns True if the playlist is streamable.
For a playlist to be streamable, it needs at least 45 tracks by 15 different artists.

Data and other attributes defined here:
id = None
user = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class Scrobbler(__builtin__.object)
    A class for scrobbling tracks to Last.fm
 
  Methods defined here:
__init__(self, network, client_id, client_version)
report_now_playing(self, artist, title, album='', duration='', track_number='', mbid='')
scrobble(self, artist, title, time_started, source, mode, duration, album='', track_number='', mbid='')
Scrobble a track. parameters:
artist: Artist name.
title: Track title.
time_started: UTC timestamp of when the track started playing.
source: The source of the track
    SCROBBLE_SOURCE_USER: Chosen by the user (the most common value, unless you have a reason for choosing otherwise, use this).
    SCROBBLE_SOURCE_NON_PERSONALIZED_BROADCAST: Non-personalised broadcast (e.g. Shoutcast, BBC Radio 1).
    SCROBBLE_SOURCE_PERSONALIZED_BROADCAST: Personalised recommendation except Last.fm (e.g. Pandora, Launchcast).
    SCROBBLE_SOURCE_LASTFM: ast.fm (any mode). In this case, the 5-digit recommendation_key value must be set.
    SCROBBLE_SOURCE_UNKNOWN: Source unknown.
mode: The submission mode
    SCROBBLE_MODE_PLAYED: The track was played.
    SCROBBLE_MODE_LOVED: The user manually loved the track (implies a listen)
    SCROBBLE_MODE_SKIPPED: The track was skipped (Only if source was Last.fm)
    SCROBBLE_MODE_BANNED: The track was banned (Only if source was Last.fm)
duration: Track duration in seconds.
album: The album name.
track_number: The track number on the album.
mbid: MusicBrainz ID.
scrobble_many(self, tracks)
Scrobble several tracks at once.
 
tracks: A sequence of a sequence of parameters for each trach. The order of parameters
    is the same as if passed to the scrobble() method.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
nowplaying_url = None
session_id = None
submissions_url = None

 
class ScrobblingError(exceptions.Exception)
    
Method resolution order:
ScrobblingError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, message)
__str__ = r(*args)

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class SessionKeyGenerator(__builtin__.object)
    Methods of generating a session key:
1) Web Authentication:
    a. network = get_*_network(API_KEY, API_SECRET)
    b. sg = SessionKeyGenerator(network)
    c. url = sg.get_web_auth_url()
    d. Ask the user to open the url and authorize you, and wait for it.
    e. session_key = sg.get_web_auth_session_key(url)
2) Username and Password Authentication:
    a. network = get_*_network(API_KEY, API_SECRET)
    b. username = raw_input("Please enter your username: ")
    c. password_hash = pylast.md5(raw_input("Please enter your password: ")
    d. session_key = SessionKeyGenerator(network).get_session_key(username, password_hash)
 
A session key's lifetime is infinie, unless the user provokes the rights of the given API Key.
 
If you create a Network object with just a API_KEY and API_SECRET and a username and a password_hash, a
SESSION_KEY will be automatically generated for that network and stored in it so you don't have to do this
manually, unless you want to.
 
  Methods defined here:
__init__(self, network)
get_session_key(self, username, password_hash)
Retrieve a session key with a username and a md5 hash of the user's password.
get_web_auth_session_key(self, url)
Retrieves the session key of a web authorization process by its url.
get_web_auth_url(self)
The user must open this page, and you first, then call get_web_auth_session_key(url) after that.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Shout(__builtin__.tuple)
    Shout(body, author, date)
 
 
Method resolution order:
Shout
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
__repr__(self)

Static methods defined here:
__new__(_cls, body, author, date)

Data descriptors defined here:
author
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
body
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
date
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
class SimilarItem(__builtin__.tuple)
    SimilarItem(item, match)
 
 
Method resolution order:
SimilarItem
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
__repr__(self)

Static methods defined here:
__new__(_cls, item, match)

Data descriptors defined here:
item
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
match
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
class Tag(_BaseObject)
    A Last.fm object tag.
 
 
Method resolution order:
Tag
_BaseObject
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, name, network)
__ne__(self, other)
__repr__(self)
__str__ = r(*args)
get_name(self, properly_capitalized=False)
Returns the name of the tag.
get_similar(self)
Returns the tags similar to this one, ordered by similarity.
get_top_albums(self)
Retuns a list of the top albums.
get_top_artists(self)
Returns a sequence of the most played artists.
get_top_tracks(self)
Returns a list of the most played Tracks by this artist.
get_url(self, domain_name=0)
Returns the url of the tag page on the network. 
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE
get_weekly_artist_charts(self, from_date=None, to_date=None)
Returns the weekly artist charts for the week starting from the from_date value to the to_date value.
get_weekly_chart_dates(self)
Returns a list of From and To tuples for the available charts.

Data and other attributes defined here:
name = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class TagSearch(_Search)
    Search for a tag by tag name.
 
 
Method resolution order:
TagSearch
_Search
_BaseObject
__builtin__.object

Methods defined here:
__init__(self, tag_name, network)
get_next_page(self)
Returns the next page of results as a sequence of Tag objects.

Methods inherited from _Search:
get_total_result_count(self)
Returns the total count of all the results.

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class TopItem(__builtin__.tuple)
    TopItem(item, weight)
 
 
Method resolution order:
TopItem
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
__repr__(self)

Static methods defined here:
__new__(_cls, item, weight)

Data descriptors defined here:
item
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
weight
itemgetter(item, ...) --> itemgetter object
 
Return a callable object that fetches the given item(s) from its operand.
After, f=itemgetter(2), the call f(r) returns r[2].
After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
class Track(_BaseObject, _Taggable)
    A Last.fm track.
 
 
Method resolution order:
Track
_BaseObject
_Taggable
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, artist, title, network)
__ne__(self, other)
__repr__(self)
__str__ = r(*args)
ban(self)
Ban this track from ever playing on the radio.
get_album(self)
Returns the album object of this track.
get_artist(self)
Returns the associated Artist object.
get_duration(self)
Returns the track duration.
get_id(self)
Returns the track id on the network.
get_listener_count(self)
Returns the listener count.
get_mbid(self)
Returns the MusicBrainz ID of this track.
get_name(self, properly_capitalized=False)
Returns the track title (alias to Track.get_title).
get_playcount(self)
Returns the play count.
get_shouts(self, limit=50)
Returns a sequqence of Shout objects
get_similar(self)
Returns similar tracks for this track on the network, based on listening data.
get_title(self, properly_capitalized=False)
Returns the track title.
get_top_fans(self, limit=None)
Returns a list of the Users who played this track.
get_url(self, domain_name=0)
Returns the url of the track page on the network. 
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE
get_wiki_content(self)
Returns the content of the wiki.
get_wiki_published_date(self)
Returns the date of publishing this version of the wiki.
get_wiki_summary(self)
Returns the summary of the wiki.
is_fulltrack_available(self)
Returns True if the fulltrack is available for streaming.
is_streamable(self)
Returns True if the track is available at Last.fm.
love(self)
Adds the track to the user's loved tracks.
share(self, users, message=None)
Shares this track (sends out recommendations). 
* users: A list that can contain usernames, emails, User objects, or all of them.
* message: A message to include in the recommendation message.

Data and other attributes defined here:
artist = None
title = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

Methods inherited from _Taggable:
add_tag(self, tag)
Adds one tag.
* tag: a tag name or a Tag object.
add_tags(self, tags)
Adds one or several tags.
* tags: A sequence of tag names or Tag objects.
clear_tags(self)
Clears all the user-set tags.
get_tags(self)
Returns a list of the tags set by the user to this object.
get_top_tags(self, limit=None)
Returns a list of the most frequently used Tags on this object.
remove_tag(self, tag)
Remove a user's tag from this object.
remove_tags(self, tags)
Removes one or several tags from this object.
* tags: a sequence of tag names or Tag objects.
set_tags(self, tags)
Sets this object's tags to only those tags.
* tags: a sequence of tag names or Tag objects.

 
class TrackSearch(_Search)
    Search for a track by track title. If you don't wanna narrow the results down
by specifying the artist name, set it to empty string.
 
 
Method resolution order:
TrackSearch
_Search
_BaseObject
__builtin__.object

Methods defined here:
__init__(self, artist_name, track_title, network)
get_next_page(self)
Returns the next page of results as a sequence of Track objects.

Methods inherited from _Search:
get_total_result_count(self)
Returns the total count of all the results.

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class User(_BaseObject)
    A Last.fm user.
 
 
Method resolution order:
User
_BaseObject
__builtin__.object

Methods defined here:
__eq__(self, another)
__init__(self, user_name, network)
__ne__(self, another)
__repr__(self)
__str__ = r(*args)
compare_with_user(self, user, shared_artists_limit=None)
Compare this user with another Last.fm user.
Returns a sequence (tasteometer_score, (shared_artist1, shared_artist2, ...))
user: A User object or a username string/unicode object.
get_age(self)
Returns the user's age.
get_country(self)
Returns the name of the country of the user.
get_friends(self, limit=50)
Returns a list of the user's friends.
get_gender(self)
Returns the user's gender. Either USER_MALE or USER_FEMALE.
get_id(self)
Returns the user id.
get_image(self)
Returns the user's avatar.
get_language(self)
Returns the language code of the language used by the user.
get_library(self)
Returns the associated Library object.
get_loved_tracks(self, limit=50)
Returns this user's loved track as a sequence of LovedTrack objects
in reverse order of their timestamp, all the way back to the first track.
 
If limit==None, it will try to pull all the available data.
 
This method uses caching. Enable caching only if you're pulling a
large amount of data.
 
Use extract_items() with the return of this function to
get only a sequence of Track objects with no playback dates.
get_name(self, properly_capitalized=False)
Returns the nuser name.
get_neighbours(self, limit=50)
Returns a list of the user's friends.
get_now_playing(self)
Returns the currently playing track, or None if nothing is playing.
get_past_events(self, limit=50)
Returns a sequence of Event objects
if limit==None it will return all
get_playcount(self)
Returns the user's playcount so far.
get_playlists(self)
Returns a list of Playlists that this user owns.
get_recent_tracks(self, limit=10)
Returns this user's played track as a sequence of PlayedTrack objects
in reverse order of their playtime, all the way back to the first track.
 
If limit==None, it will try to pull all the available data.
 
This method uses caching. Enable caching only if you're pulling a
large amount of data.
 
Use extract_items() with the return of this function to
get only a sequence of Track objects with no playback dates.
get_shouts(self, limit=50)
Returns a sequqence of Shout objects
get_top_albums(self, period='overall')
Returns the top albums played by a user. 
* period: The period of time. Possible values:
  o PERIOD_OVERALL
  o PERIOD_7DAYS
  o PERIOD_3MONTHS
  o PERIOD_6MONTHS
  o PERIOD_12MONTHS
get_top_artists(self, period='overall')
Returns the top artists played by a user. 
* period: The period of time. Possible values:
  o PERIOD_OVERALL
  o PERIOD_7DAYS
  o PERIOD_3MONTHS
  o PERIOD_6MONTHS
  o PERIOD_12MONTHS
get_top_tags(self, limit=None)
Returns a sequence of the top tags used by this user with their counts as (Tag, tagcount). 
* limit: The limit of how many tags to return.
get_top_tracks(self, period='overall')
Returns the top tracks played by a user. 
* period: The period of time. Possible values:
  o PERIOD_OVERALL
  o PERIOD_7DAYS
  o PERIOD_3MONTHS
  o PERIOD_6MONTHS
  o PERIOD_12MONTHS
get_upcoming_events(self)
Returns all the upcoming events for this user.
get_url(self, domain_name=0)
Returns the url of the user page on the network. 
* domain_name: The network's language domain. Possible values:
  o DOMAIN_ENGLISH
  o DOMAIN_GERMAN
  o DOMAIN_SPANISH
  o DOMAIN_FRENCH
  o DOMAIN_ITALIAN
  o DOMAIN_POLISH
  o DOMAIN_PORTUGUESE
  o DOMAIN_SWEDISH
  o DOMAIN_TURKISH
  o DOMAIN_RUSSIAN
  o DOMAIN_JAPANESE
  o DOMAIN_CHINESE
get_weekly_album_charts(self, from_date=None, to_date=None)
Returns the weekly album charts for the week starting from the from_date value to the to_date value.
get_weekly_artist_charts(self, from_date=None, to_date=None)
Returns the weekly artist charts for the week starting from the from_date value to the to_date value.
get_weekly_chart_dates(self)
Returns a list of From and To tuples for the available charts.
get_weekly_track_charts(self, from_date=None, to_date=None)
Returns the weekly track charts for the week starting from the from_date value to the to_date value.
is_subscriber(self)
Returns whether the user is a subscriber or not. True or False.
shout(self, message)
Post a shout

Data and other attributes defined here:
name = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class Venue(_BaseObject)
    A venue where events are held.
 
 
Method resolution order:
Venue
_BaseObject
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, id, network)
__repr__(self)
__str__ = r(*args)
get_id(self)
Returns the id of the venue.
get_past_events(self)
Returns the past events held in this venue.
get_upcoming_events(self)
Returns the upcoming events in this venue.

Data and other attributes defined here:
id = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class VenueSearch(_Search)
    Search for a venue by its name. If you don't wanna narrow the results down
by specifying a country, set it to empty string.
 
 
Method resolution order:
VenueSearch
_Search
_BaseObject
__builtin__.object

Methods defined here:
__init__(self, venue_name, country_name, network)
get_next_page(self)
Returns the next page of results as a sequence of Track objects.

Methods inherited from _Search:
get_total_result_count(self)
Returns the total count of all the results.

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
class WSError(exceptions.Exception)
    Exception related to the Network web service
 
 
Method resolution order:
WSError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, network, status, details)
__str__ = r(*args)
get_id(self)
Returns the exception ID, from one of the following:
STATUS_INVALID_SERVICE = 2
STATUS_INVALID_METHOD = 3
STATUS_AUTH_FAILED = 4
STATUS_INVALID_FORMAT = 5
STATUS_INVALID_PARAMS = 6
STATUS_INVALID_RESOURCE = 7
STATUS_TOKEN_ERROR = 8
STATUS_INVALID_SK = 9
STATUS_INVALID_API_KEY = 10
STATUS_OFFLINE = 11
STATUS_SUBSCRIBERS_ONLY = 12
STATUS_TOKEN_UNAUTHORIZED = 14
STATUS_TOKEN_EXPIRED = 15

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class XSPF(_BaseObject)
    A Last.fm XSPF playlist.
 
 
Method resolution order:
XSPF
_BaseObject
__builtin__.object

Methods defined here:
__eq__(self, other)
__init__(self, uri, network)
__ne__(self, other)
__str__ = r(*args)
get_tracks(self)
Returns the tracks on this playlist.
get_uri(self)
Returns the Last.fm playlist URI.

Data and other attributes defined here:
uri = None

Methods inherited from _BaseObject:
__hash__(self)

Data descriptors inherited from _BaseObject:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _BaseObject:
network = None

 
Functions
       
extract_items(topitems_or_libraryitems)
Extracts a sequence of items from a sequence of TopItem or LibraryItem objects.
get_lastfm_network(api_key='', api_secret='', session_key='', username='', password_hash='')
Returns a preconfigured _Network object for Last.fm
 
api_key: a provided API_KEY
api_secret: a provided API_SECRET
session_key: a generated session_key or None
username: a username of a valid user
password_hash: the output of pylast.md5(password) where password is the user's password
 
if username and password_hash were provided and not session_key, session_key will be
generated automatically when needed.
        
Either a valid session_key or a combination of username and password_hash must be present for scrobbling.
 
Most read-only webservices only require an api_key and an api_secret, see about obtaining them from:
http://www.last.fm/api/account
get_librefm_network(api_key='', api_secret='', session_key='', username='', password_hash='')
Returns a preconfigured _Network object for Libre.fm
 
api_key: a provided API_KEY
api_secret: a provided API_SECRET
session_key: a generated session_key or None
username: a username of a valid user
password_hash: the output of pylast.md5(password) where password is the user's password
 
if username and password_hash were provided and not session_key, session_key will be
generated automatically when needed.
md5(text)
Returns the md5 hash of a string.

 
Data
        COVER_EXTRA_LARGE = 3
COVER_LARGE = 2
COVER_MEDIUM = 1
COVER_MEGA = 4
COVER_SMALL = 0
DOMAIN_CHINESE = 11
DOMAIN_ENGLISH = 0
DOMAIN_FRENCH = 3
DOMAIN_GERMAN = 1
DOMAIN_ITALIAN = 4
DOMAIN_JAPANESE = 10
DOMAIN_POLISH = 5
DOMAIN_PORTUGUESE = 6
DOMAIN_RUSSIAN = 9
DOMAIN_SPANISH = 2
DOMAIN_SWEDISH = 7
DOMAIN_TURKISH = 8
EVENT_ATTENDING = '0'
EVENT_MAYBE_ATTENDING = '1'
EVENT_NOT_ATTENDING = '2'
IMAGES_ORDER_DATE = 'dateadded'
IMAGES_ORDER_POPULARITY = 'popularity'
PERIOD_12MONTHS = '12month'
PERIOD_3MONTHS = '3month'
PERIOD_6MONTHS = '6month'
PERIOD_7DAYS = '7day'
PERIOD_OVERALL = 'overall'
SCROBBLE_MODE_BANNED = 'B'
SCROBBLE_MODE_LOVED = 'L'
SCROBBLE_MODE_PLAYED = ''
SCROBBLE_MODE_SKIPPED = 'S'
SCROBBLE_SOURCE_LASTFM = 'L'
SCROBBLE_SOURCE_NON_PERSONALIZED_BROADCAST = 'R'
SCROBBLE_SOURCE_PERSONALIZED_BROADCAST = 'E'
SCROBBLE_SOURCE_UNKNOWN = 'U'
SCROBBLE_SOURCE_USER = 'P'
STATUS_AUTH_FAILED = 4
STATUS_INVALID_API_KEY = 10
STATUS_INVALID_FORMAT = 5
STATUS_INVALID_METHOD = 3
STATUS_INVALID_PARAMS = 6
STATUS_INVALID_RESOURCE = 7
STATUS_INVALID_SERVICE = 2
STATUS_INVALID_SIGNATURE = 13
STATUS_INVALID_SK = 9
STATUS_OFFLINE = 11
STATUS_SUBSCRIBERS_ONLY = 12
STATUS_TOKEN_ERROR = 8
STATUS_TOKEN_EXPIRED = 15
STATUS_TOKEN_UNAUTHORIZED = 14
USER_FEMALE = 'Female'
USER_MALE = 'Male'
__author__ = 'Amr Hassan'
__copyright__ = 'Copyright (C) 2008-2010 Amr Hassan'
__email__ = 'amr.hassan@gmail.com'
__license__ = 'apache2'
__version__ = '0.5'

 
Author
        Amr Hassan