This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Python client for the Last.fm API with a pythonic interface. Also includes an async variant of the client for Tornado.

Usage

Regular

from lastfmclient import LastfmClient

api = LastfmClient(
    api_key=KEY,
    api_secret=SECRET,
    session_key=session_key
)

resp = api.track.update_now_playing(
    track='Paranoid Android',
    artist='Radiohead',
    album='OK Computer',
)

print resp

Asynchronous (uses tornado.httpclient.AsyncHTTPClient)

import tornado.web
import tornado.gen
from lastfmclient.async import AsyncLastfmClient

class Scrobbler(tornado.web.RequestHandler):

    @tornado.gen.coroutine
    def post(self):
        api = AsyncLastfmClient(
            api_key=KEY,
            api_secret=SECRET,
            session_key=session_key
        )

        resp = yield api.track.update_now_playing(
            track='Paranoid Android',
            artist='Radiohead',
            album='OK Computer',
        )
        self.finish(resp)

See also examples.

Client methods

All the methods the Last.fm API provides are mirrored in the client with rich docstrings and arguments description. This code is actually generated directly from the online API documentation pages (see ./generate.py, ./api.json, and ./lastfmclient/api.py).

The defined methods be updated to the current version of the documentation via:

$ pip install -r requirements.txt lxml

# 1. Generate fresh api.json from docs at http://www.last.fm/api:
$ make spec

# 2. Generate `lastfm/api.py` from `api.json`:
$ make code

# Or, all the above in one step:
$ make
Release History

Release History

0.0.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1-alpha

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
lastfmclient-0.0.4.tar.gz (17.6 kB) Copy SHA256 Checksum SHA256 Source Oct 20, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting