{"id":26575694,"url":"https://github.com/d3r3k23/lastfmget","last_synced_at":"2026-02-11T00:02:37.087Z","repository":{"id":62575138,"uuid":"387688414","full_name":"D3r3k23/LastFmGet","owner":"D3r3k23","description":"Python package for accessing Last.fm scrobble data","archived":false,"fork":false,"pushed_at":"2022-08-02T04:21:22.000Z","size":303,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T18:51:09.645Z","etag":null,"topics":["lastfm","music","pypi","python","scrobble"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/D3r3k23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-20T05:59:31.000Z","updated_at":"2023-10-12T13:02:12.000Z","dependencies_parsed_at":"2022-11-03T18:57:25.589Z","dependency_job_id":null,"html_url":"https://github.com/D3r3k23/LastFmGet","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/D3r3k23%2FLastFmGet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/D3r3k23%2FLastFmGet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/D3r3k23%2FLastFmGet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/D3r3k23%2FLastFmGet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/D3r3k23","download_url":"https://codeload.github.com/D3r3k23/LastFmGet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245047977,"owners_count":20552429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lastfm","music","pypi","python","scrobble"],"created_at":"2025-03-23T02:29:56.670Z","updated_at":"2026-02-11T00:02:36.979Z","avatar_url":"https://github.com/D3r3k23.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LastFmGet\n\n[![PyPI](https://badge.fury.io/py/lastfmget.svg)](https://pypi.org/project/lastfmget)\n[![Latest Release Tests](https://github.com/D3r3k23/LastFmGet/actions/workflows/test_release.yaml/badge.svg)](https://github.com/D3r3k23/LastFmGet/actions/workflows/test_release.yaml)\n[![Current Source Tests](https://github.com/D3r3k23/LastFmGet/actions/workflows/test_source.yaml/badge.svg)](https://github.com/D3r3k23/LastFmGet/actions/workflows/test_source.yaml)\n\n\n`LastFmGet` is a Python package for accessing [Last.fm](https://www.last.fm) scrobble data using the public API.\n\n* Provides functions for calling specific Last.fm API methods\n* Methods request data from the Last.fm API and return the response in a Python dictionary\n* Must use a cfg YAML file and call `lastfmget.init()` before use (this allows you to store your private key in an untracked file)\n* Examples of the response for each method shown in [`data/dump`](https://github.com/D3r3k23/LastFmGet/blob/master/data/dump/)\n* Use `_raw` method verions for more direct access to the Last.fm API\n\n\n## Installation\n`pip install lastfmget`\n\n### Dependencies\n* **`python3.10`**\n* `requests`\n* `requests_cache` (used only if configured in `api_cfg.yaml`)\n* `pyyaml`\n\n\n## Documentation\n### [lastfmget](https://raw.githack.com/D3r3k23/LastFmGet/master/docs/pdoc/lastfmget.html)\n\n\n## Usage\n\n### Import\n`import lastfmget`\n\n### Config\n`lastfmget.init('api_cfg.yaml')`\n\n#### `api_cfg.yaml` [example](https://github.com/D3r3k23/LastFmGet/blob/master/data/example_api_cfg.yaml)\n```yaml\napi_url: http://ws.audioscrobbler.com/2.0/\napi_key: \u003cAPI KEY\u003e\nuser_agent: \u003cUSER AGENT\u003e\ncall_rate: 5 # Calls per second\ncache:\n  enable: true\n  dir: .cache\n  backend: sqlite\n  lifetime: 120 # Seconds\n# or (defaults)\ncache:\n  enable: true\n# or (disable)\ncache:\n  enable: false\n```\n\n| Field        | Description                                                 |\n|--------------|-------------------------------------------------------------|\n| `api_url`    | API root URL, should be `http://ws.audioscrobbler.com/2.0/` |\n| `api_key`    | Your private API key. See [here](https://www.last.fm/api)   |\n| `user_agent` | Identifiable user agent for requests                        |\n| `call_rate`  | Max API requests per second                                 |\n| `cache`      | enable: use `requests_cache`\u003cbr\u003edir: (optional) cache location\u003cbr\u003ebackend: (optional) sqlite recommended\u003cbr\u003elifetime: (optional) `expire_after` time in seconds |\n\n### Code Examples\n\n#### Getting user information using the user.getInfo method\n```python\n\u003e\u003e\u003e info = lastfmget.user_info('D3r3k523')\n\u003e\u003e\u003e info['playcount']\n161602\n\u003e\u003e\u003e info['user']['url']\n'https://www.last.fm/user/D3r3k523'\n```\n\n#### Getting a user's top 10 artists using the user.getTopArtists method\n```python\n\u003e\u003e\u003e topartists = lastfmget.user_top_artists('D3r3k523', 10)\n\u003e\u003e\u003e [ artist['name'] for artist in topartists ]\n['Radiohead', 'Converge', 'Pink Floyd', 'Queens of the Stone Age', 'Beach House', 'Bon Iver', 'Thee Oh Sees', 'Mastodon', 'King Gizzard \u0026 The Lizard Wizard', 'Swans']\n```\n\n### Example Projects\n* [LastFmTimeline](https://github.com/D3r3k23/LastFmTimeline)\n* [~~PlaylistRanker~~](https://github.com/D3r3k23/PlaylistRanker)\n* [Tests](https://github.com/D3r3k23/LastFmGet/blob/master/test/test/tests.py)\n\n\n## Last.fm API Methods Available\n| Function                             | Last.fm API method          |\n|--------------------------------------|-----------------------------|\n| `lastfmget.user_info`                | `user.getInfo`              |\n| `lastfmget.user_recent_tracks`       | `user.getRecentTracks`      |\n| `lastfmget.user_top_artists`         | `user.getTopArtists`        |\n| `lastfmget.user_top_albums`          | `user.getTopAlbums`         |\n| `lastfmget.user_top_tracks`          | `user.getTopTracks`         |\n| `lastfmget.user_weekly_chart_list`   | `user.getWeeklyChartList`   |\n| `lastfmget.user_weekly_artist_chart` | `user.getWeeklyArtistChart` |\n| `lastfmget.user_weekly_album_chart`  | `user.getWeeklyAlbumChart`  |\n| `lastfmget.user_weekly_track_chart`  | `user.getWeeklyTrackChart`  |\n\n\n## Last.fm API Reference\n* ### [Introduction](https://www.last.fm/api/intro)\n* ### [Terms of Service](https://www.last.fm/api/tos)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3r3k23%2Flastfmget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd3r3k23%2Flastfmget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3r3k23%2Flastfmget/lists"}