Skip to main content

An API Wrapper for Last.FM

Project description

lastfmpy - Last.FM API wrapper written in Python

widget

Maintained by Myer (also known as myerfire, MyerFire)

This library is an async wrapper for the last.fm API.

Features

  • Currently, any API methods that do not require the authentication process are supported.

Installation

lastfmpy is available from the official pYpI package index.

python -m pip install -U lastfmpy

Documentation

  • There are relevant docstrings on the functions of the main wrapper class.
  • Object attribute documentation may (?) be worked on but the code in objects.py is easily readable.
  • ****There is no API method for a user's currently playing song. The way to get the currently playing song of a user is to request recent tracks and check whether the first index of the list has the attribute playing set to true.

Quick Start

from lastfmpy import LastFM
import asyncio

API_KEY = "hahagetbaited"
# if it isn't obvious enough, replace this string 
# with your API key obtained by going to https://last.fm/api/applications and creating an application

async def main():
    lastfm = await LastFM(API_KEY)
    recent = await lastfm.user.get_recent_tracks(user="myerfire")
    print(f"{recent.items[0].name}")

if __name__ == "__main__":
    asyncio.get_event_loop().run_until_complete(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lastfmpy-1.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

lastfmpy-1.1-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file lastfmpy-1.1.tar.gz.

File metadata

  • Download URL: lastfmpy-1.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.2

File hashes

Hashes for lastfmpy-1.1.tar.gz
Algorithm Hash digest
SHA256 550e8007ff5fd15278091c7be9a30a943360ca95fe837087bd7c509ae822703a
MD5 0180d607f313936048b8018331cf5ea3
BLAKE2b-256 8a42803af935fdbb224092d46aeb92ceaa79dd79dbdcab831fb1ce848ec6efdc

See more details on using hashes here.

File details

Details for the file lastfmpy-1.1-py3-none-any.whl.

File metadata

  • Download URL: lastfmpy-1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.2

File hashes

Hashes for lastfmpy-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3cef441c9bc36083b127f11f3c73c3e2e88b8fc63eb573f6cde9eac61e633fd6
MD5 d9f7178b5ffe75825350e5d9b8789d8a
BLAKE2b-256 f2bedceeb428d3183cdf1170c6c4e144c24543f6814a63e282157930258c9f91

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page