{"library":"pylast","title":"pylast","description":"A Python interface to Last.fm and Libre.fm. Current version 7.0.2 (requires Python >=3.10). Uses httpx for HTTP requests. Active development; releases every few months.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install pylast"],"cli":null},"imports":["from pylast import LastFMNetwork","from pylast import Track","from pylast import Album","from pylast import Artist","from pylast import User"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pylast import LastFMNetwork\n\napi_key = os.environ.get('LASTFM_API_KEY', '')\napi_secret = os.environ.get('LASTFM_API_SECRET', '')\nnetwork = LastFMNetwork(api_key=api_key, api_secret=api_secret)\n\n# Get top tracks for a user\ntry:\n    user = network.get_user('RJ')\n    top_tracks = user.get_top_tracks(limit=3)\n    for track in top_tracks:\n        print(track.item)\nexcept Exception as e:\n    print(f\"Error: {e}\")","lang":"python","description":"Initialize LastFMNetwork with API credentials and fetch top tracks for a user.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}