Skip to main content

Super-simple CLI tool for backing up Last.fm scrobbling data

Project description

lastfm-backup-cli

Super-simple CLI tool for backing up Last.fm scrobbling data into CSV file

installation

  • pre-requisites: Python 3.7 or newer, pip
  • installation: pip install --user lastfm-backup-cli
    • or, if your default Python is 2.x: python3 -m pip install --user lastfm-backup-cli

usage

  • get your LastFM API key here
  • run: lastfm-backup <PATH TO BACKUP CSV FILE> --user <YOUR LASTFM USERNAME> --api-key <YOUR API KEY> --time-from <DATE OF FIRST SCROBBLE IN BACKUP FILE> --time-to <DATE OF LAST SCROBBLE IN BACKUP FILE>
    • example: lastfm-backup lastfm-backup-2021-01.csv --user Rezult --api-key <YOUR API KEY> --time-from 2021-01-01 --time-to 2021-02-01
  • you can also set env variables: LASTFM_API_KEY and LASTFM_USER

output

  • output CSV file structure is:
<SCROBBLE DATE>,<SCROBBLE TIME (UTC)>,<ARTIST>,<TITLE>
...
  • output CSV example:
2021-05-26,06:05:49,Alice Coltrane,Journey in Satchidananda
2021-05-25,14:16:08,London Music Works,"S.T.A.Y. (From ""Interstellar"")"
2021-05-25,13:18:39,Pantha du Prince,Silentium Larix
2021-05-25,13:11:10,Avenade,Have It Your Way
2021-05-25,13:03:51,Four Tet,Planet
2021-05-25,12:57:58,Songs: Ohia,Steve Albini's Blues
2021-05-25,12:52:31,Andy Stott,It Should Be Us

options

usage: lastfm-backup [-h] [--user USER] [--api-key API_KEY] [--time-from TIME_FROM] [--time-to TIME_TO] [-d] file

Super-simple CLI tool for backing up Last.fm scrobbling data

positional arguments:
  file                  CSV file path where backup should be written to. Defaults to lastfm.csv

optional arguments:
  -h, --help            show this help message and exit
  --user USER           The last.fm username to fetch the recent tracks of.Might be provided by env variable LASTFM_USER
  --api_key API_KEY     A Last.fm API key. Might be provided by env variable LASTFM_API_KEY
  --time-from TIME_FROM
                        Beginning timestamp of a range - only display scrobbles after this time. Must be in UTC. Example: 2021-05-13
  --time-to TIME_TO     End timestamp of a range - only display scrobbles before this time. Must be in UTC. Example: 2021-05-15
  -d, --debug           Enable more verbose logging

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-backup-cli-0.2.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

lastfm_backup_cli-0.2.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file lastfm-backup-cli-0.2.1.tar.gz.

File metadata

  • Download URL: lastfm-backup-cli-0.2.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.8.0-1033-azure

File hashes

Hashes for lastfm-backup-cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f3a37fcf15b4d81760bab4a4b23bd5422a2be478b851a917a583e7eafa4706c4
MD5 343cbe19370944e02715b6cac4f3c6ee
BLAKE2b-256 97f7453e282052793a43cca876f40855ead5ca7d62b8e650a49e745dfbc50982

See more details on using hashes here.

File details

Details for the file lastfm_backup_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: lastfm_backup_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.8.0-1033-azure

File hashes

Hashes for lastfm_backup_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 474d3c36870c21f5f4654c219409536b7c9baf4cb77a6810f98f988379acb6dd
MD5 00c546725b8fe95706dc4e1cbf77c583
BLAKE2b-256 c5abdc5b53adcbb8028712d6bca7cca7a3062348de70c97f4827a79765b0f39a

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