Scrape LAST.FM playlists to SQLite
Project description
lastfm
- Scrape LAST.FM user's playlists to SQLite.
- Docs: https://lastfm.readthedocs.io/en/latest/
Usage
pip install lastfm-to-sqlite
Now run CLI:
lastfm export 244ec3b62b2501514191234eed07c75d lastfm_dump.db --user Way4Music
That will use (or create) a SQLite database called lastfm_dump.db
and a table called playlist
to export user's entire playlist.
To scrape specific dates, use --start_date
and --end_date
:
lastfm export 244ec3b62b2501514191234eed07c75 lastfm_dump.db --user way4music --start_date 2021-08-21 --end_date 2021-09-01
Python-based API works like this:
from lastfm import LastFM
# specific date, ommit start_date and end_date to download all tracks
api = LastFM(
api="244ec3b62b2501514191234eed07c75d",
username="way4music",
start_date="2021-08-21",
end_date="2021-09-01"
)
data = api.fetch()
song = next(data)
print(song)
container = []
for item in data:
container.append(item)
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
lastfm-to-sqlite-0.2.3.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for lastfm_to_sqlite-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2351510a420518d605104ceec5b204aa1af7853448f07156e8a20202a4fd5b1a |
|
MD5 | 7fc59fcb173b261fb13a73abd645da0b |
|
BLAKE2b-256 | 91724fbeac6c4b557bcacff5bb3f559bb56dee3d7b35bd20547d169d581d6221 |