[PR #567] [MERGED] Made cache_path and username optional #945

Closed
opened 2026-02-28 00:02:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/spotipy-dev/spotipy/pull/567
Author: @stephanebruckert
Created: 8/30/2020
Status: Merged
Merged: 8/30/2020
Merged by: @stephanebruckert

Base: masterHead: empty-username


📝 Commits (5)

📊 Changes

9 files changed (+128 additions, -139 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 README.md (+0 -1)
📝 examples/my_top_tracks.py (+0 -8)
📝 examples/remove_specific_tracks_from_playlist.py (+1 -1)
📝 examples/replace_tracks_in_playlist.py (+1 -1)
📝 examples/show_user.py (+1 -2)
📝 spotipy/oauth2.py (+109 -113)
📝 spotipy/util.py (+10 -11)
📝 tests/unit/test_oauth.py (+2 -2)

📄 Description

As suggested here https://github.com/plamere/spotipy/issues/533#issuecomment-682304023

The API itself does not require a username but Spotipy was still asking for it in order to know where to store the token.

I think most devs want to get started quickly and will by default only use their main account, so storing that main account token in a cache called .cache should be fine.

Apps that specify a username should still work.

Fixes https://github.com/plamere/spotipy/issues/507, https://github.com/plamere/spotipy/issues/512, https://github.com/plamere/spotipy/issues/549


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/spotipy-dev/spotipy/pull/567 **Author:** [@stephanebruckert](https://github.com/stephanebruckert) **Created:** 8/30/2020 **Status:** ✅ Merged **Merged:** 8/30/2020 **Merged by:** [@stephanebruckert](https://github.com/stephanebruckert) **Base:** `master` ← **Head:** `empty-username` --- ### 📝 Commits (5) - [`be10d57`](https://github.com/spotipy-dev/spotipy/commit/be10d579b404b7833b456051758e24038f44d835) Made cache_path and username optional - [`3979701`](https://github.com/spotipy-dev/spotipy/commit/3979701f80213349b4c083b3c639f57a35ae076e) Update readme and example - [`983d57c`](https://github.com/spotipy-dev/spotipy/commit/983d57caf1efdd6c3eec77f03224282fe05628e1) Lint - [`2709eae`](https://github.com/spotipy-dev/spotipy/commit/2709eae27bf401f6da744cdbf06feae9802af101) Lint - [`1b45e8e`](https://github.com/spotipy-dev/spotipy/commit/1b45e8eb313976539dcb149536f3aaf134995c62) Feedback / add warning ### 📊 Changes **9 files changed** (+128 additions, -139 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `README.md` (+0 -1) 📝 `examples/my_top_tracks.py` (+0 -8) 📝 `examples/remove_specific_tracks_from_playlist.py` (+1 -1) 📝 `examples/replace_tracks_in_playlist.py` (+1 -1) 📝 `examples/show_user.py` (+1 -2) 📝 `spotipy/oauth2.py` (+109 -113) 📝 `spotipy/util.py` (+10 -11) 📝 `tests/unit/test_oauth.py` (+2 -2) </details> ### 📄 Description As suggested here https://github.com/plamere/spotipy/issues/533#issuecomment-682304023 The API itself does not require a username but Spotipy was still asking for it in order to know where to store the token. I think most devs want to get started quickly and will by default only use their main account, so storing that main account token in a cache called `.cache` should be fine. Apps that specify a username should still work. Fixes https://github.com/plamere/spotipy/issues/507, https://github.com/plamere/spotipy/issues/512, https://github.com/plamere/spotipy/issues/549 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:02:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#945
No description provided.