Skip to main content

A Python script that exports all of your Spotify playlists.

Project description

spotify-backup PyPI - Python Version CI

Fork of caseychu/spotify-backup

Python CLI tool that exports all of your Spotify playlists and/or liked songs into CSV file

installation

  • pre-requisites: Python >=3.7, pip
  • command to install: pip install spotify-backup (dependency-free)

usage

  • get your Spotify OAuth Token here
    • required scopes: user-read-private, user-library-read, playlist-read-private
  • execute spotify-backup <OUTPUT FILE> --dump playlists,liked --token <YOUR TOKEN>
    • example: spotify-backup my_backup.csv --dump playlists,liked --token SOME_VERY_LONG_TOKEN

output format

<PLAYLIST NAME>,<TRACK URI>,<COMMA-SEPARATED TRACK ARTISTS>,<ALBUM NAME>,<TRACK NAME>

output example

Liked Songs,spotify:track:7eMlLQXY5QICXuafv4haUg,"Massive Attack, Azekel",Ritual Spirit,Ritual Spirit
Liked Songs,spotify:track:53Zvj4xbSFKwSJeXjyocHK,Boy Harsher,Careful,Fate
Liked Songs,spotify:track:1IP0wkv3Hj7cPE159G9c2O,"PRO8L3M, Brodka",Fight Club,Żar
test,spotify:track:4u3cJaAUcmp4qPKUUcxXZv,UNKLE,War Stories,Mistress (feat Alicia Temple)
test,spotify:track:0MabrxpL9vrCJeOjGMnGgM,"Perturbator, Greta Link",The Uncanny Valley,Venger (feat. Greta Link)
test,spotify:track:0FoR0PrLkw6t64waJX3qT5,"Brodka, A_GIM",Wszystko czego dziś chcę (z serialu Rojst na Showmax),Wszystko czego dziś chcę (z serialu Rojst na Showmax)
test,spotify:track:5b2ACxzxhGeLPDr500fQzy,"deadmau5, Rob Swire",Ghosts 'n' Stuff,Ghosts 'N' Stuff - Radio Edit
test,spotify:track:4oezx4rQJnIBpKurukB2gN,trentemøller,Moan,Moan - Trentemøller Remix - Radio Edit
test,spotify:track:1itVstaGVBLPXqlv50HvDn,Goldfrapp,Ride A White Horse,Ride a White Horse - Serge Santiágo Re-Edit

options

usage: spotify-backup [-h] [--token TOKEN] --dump {liked,playlists,playlists,liked,playlists,liked} [-d] file

Exports your Spotify playlists and/or Liked songs to CSV file.

positional arguments:
  file                  output filename

optional arguments:
  -h, --help            show this help message and exit
  --token TOKEN         Spotify OAuth token; requires `playlist-read-private` and `user-library-read` scopes; to get it, visit
                        https://developer.spotify.com/console/get-playlists/ may also use SPOTIFY_OAUTH_TOKEN env var
  --dump {liked,playlists,playlists,liked,playlists,liked}
                        dump playlists or liked songs, or both (default: playlists)
  -d, --debug           Enable more verbose logging

known issues

  • collaborative playlists and playlist folders don't show up in the API, sadly.
  • tool downloads everything into memory before writing to file, need to rewrite client and use streaming / generators

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

spotify-backup-0.0.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

spotify_backup-0.0.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file spotify-backup-0.0.3.tar.gz.

File metadata

  • Download URL: spotify-backup-0.0.3.tar.gz
  • Upload date:
  • Size: 5.8 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 spotify-backup-0.0.3.tar.gz
Algorithm Hash digest
SHA256 cd9243ecc3271c2bed3f26ef6d1006f7256839fe80cf6635131e4aaa9146a661
MD5 c1bd94bd9bd5324ae918e903887ef3e1
BLAKE2b-256 f5a0725ae3328d5156f90f1cffe42d44b61723010170f31068659cd003723e99

See more details on using hashes here.

File details

Details for the file spotify_backup-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: spotify_backup-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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 spotify_backup-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 035484de37d3a4135241a075bd7156b95aa71a329af9c0aedeca51c632d59e47
MD5 1216fdc6059f552d5f54f8dc98ab8cf0
BLAKE2b-256 7386b08fb9c102aa491fbbea3c8af0a70dfb1ef2d890fb54a7f5a0d07ada24e5

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