An awesome and easy-to-use CLI for various Spotify® utility tasks
Project description
spotify-utils
An awesome and easy-to-use CLI for various Spotify® utility tasks!
Report Bug
·
Request Feature
Table of Contents
About The Project
There are many Spotify® clients out there; however, I didn't find one that really suited my needs so I created this one. I want to create a Spotify® CLI which is easy-to-use, packed with useful functionalities and with a sophisticated documentation built-in.
Key features:
- Playlists
- List information about playlists of the authenticated user in various output formats (Console, JSON)
- Find duplicate tracks across all playlists
- Export playlist information in various formats (JSON, HTML template)
- More coming soon
Of course, this CLI will not serve all needs, especially during development. So I'll be adding more features in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue. Thanks to all the people have contributed!
Getting Started
Prerequisites
- Python 3.8 or higher
Installation
pip install spotify-utils
Configuration
All methods require user authorization. You will need to register your app at My Dashboard to get the credentials necessary to make authorized calls (a client id and client secret). Click here to go to the step-by-step guide for creating a Spotify® application.
The CLI uses the Authorization Code flow, which the user logs into once. It provides an access token that can be refreshed.
Environment variables are being used for configuration. In order for the CLI to function properly you need to provide the following environment variables (use export instead of SET on Linux):
set SPOTIFY_UTILS_CLIENT_ID='your-spotify-client-id'
set SPOTIFY_UTILS_CLIENT_SECRET='your-spotify-client-secret'
set SPOTIFY_UTILS_REDIRECT_URI='your-app-redirect-url'
In addition the use of an .env
file is supported:
SPOTIFY_UTILS_CLIENT_ID='your-spotify-client-id'
SPOTIFY_UTILS_CLIENT_SECRET='your-spotify-client-secret'
SPOTIFY_UTILS_REDIRECT_URI='your-app-redirect-url'
Usage and examples
In this section you can find usage examples of the CLI
List all playlists of the current authenticated user in JSON format
spotify-utils playlists list --json
[
{
"collaborative":false,
"description":"Car Music Mix 2022 \ud83d\udd25 Best Remixes of Popular Songs 2022 EDM, Bass Boosted by Rise Music",
"external_urls":{
"spotify":"https://open.spotify.com/playlist/0fM4AkfoGygOHVXjsNB7io"
},
... more
}
]
Find duplicates across all playlists and display additional details:
spotify-utils playlists duplicates --verbose
Found 43 duplicate tracks across 20 playlists
name | artists | playlists | track_id | |
---|---|---|---|---|
0 | Piercing Light | League of Legends, Mako | Rock, Sonos Mainstream | 0163ud7I4Vb0ID5K7WBkq9 |
1 | Edge Of The Earth | Thirty Seconds To Mars | Rock, Pop | 0g9IOJwdElaCZEvcqGRP4b |
... | ... | ... | ... | ... |
Export playlist as beautiful HTML file
spotify-utils playlists export --html
Roadmap
- Improve help sections of the CLI
- Add additional functionality
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the GPL-3.0 License. See LICENSE for more information.
Contact
Fabian Eulitz - @sustineo_ - dev@sustineo.de
Acknowledgments
Disclaimer
This project isn’t endorsed by Spotify AB and doesn’t reflect the views or opinions of Spotify AB or anyone officially involved in producing or managing Spotify®
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spotify_utils-1.0.13.tar.gz
.
File metadata
- Download URL: spotify_utils-1.0.13.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.12.3 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c578d241b65c881138450db3960d7d180e1c4b0bf1f48feec492e745153cc74 |
|
MD5 | fbcbc53394da878ad34e0b12602819f4 |
|
BLAKE2b-256 | 63e0386affcc0f5cfb276be2957a1227166d081cef00e08eb403e693012f7e21 |
File details
Details for the file spotify_utils-1.0.13-py3-none-any.whl
.
File metadata
- Download URL: spotify_utils-1.0.13-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.12.3 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4942c90d04b89c6e09730748aa64b7194a4102aefe154e8f47b174e9485f3af5 |
|
MD5 | a64a2bd5d7aac7fda9a1ab013e4fe2c6 |
|
BLAKE2b-256 | 0e2c9a2250eead747270638ce9ce3ac4d0ecf17e305f6dc89d8e1af0c2b79ec1 |